Social Media platform hosted by Heroku where users can communicate via CLI in the browser. Users can create an account and post, edit, and delete "Creets" on a public live timeline.
We will add an edit function allowing users to edit "creets" so they can correct "creets" they did not think about before "creeting". It is a lightweight version of Twitter and is a great way to connect with others.
MVP
- Tweet Database
- Sign up sign in feature
- Create a live timeline
- Ability to view timeline and post, edit, and delete Tweets in terminal.
- Testing for each functional module
STRETCH
- Hashtag system
- Xterm
Brady Camp, Jeffrey Jenkins, Rey Mercado
- Clone the repo from
/~https://github.com/BJR-Cubed/Critter.git
cd
intoCritter
- Run
npm i
Optionally, create an env file with PORT
and SECRET
to set your own port number and JWT secret respectively:
PORT=<my favorite port>
Defaults to PORT 3000.SECRET=<my favorite secret alphanumeric>
- Run
npm start
to start the server application. - Use an HTTP client to send requests to the API.
- Run
npm run client-start
to start the client application. - Follow the on-screen prompts to sign-up / sign-in and choose a CRUD request to send.
- Run
npm test
to run the Jest test suites.
- POST
/signup
- Requires a JSON body with properties
handle
,displayName
,password
. - On success, returns
201
with user record just created in the database- Returns an error
500
if credentials are incomplete or invalid.
- Returns an error
- Requires a JSON body with properties
- POST
/signin
- Requires a Basic auth header with base-64-encoded auth string (
handle:password
) - On success, returns
200
with the user record which matches the provided credentials- Returns an error
403
if credentials are invalid.
- Returns an error
- Requires a Basic auth header with base-64-encoded auth string (
All routes require Bearer auth header with a valid token from a user record.
- GET
/messages[/:id]
- Payload:
- Optional: an
id
param on the route to specify a record to find.
- Optional: an
- On success, returns
200
and an array of all the messages in the database, or the message specified in theid
param.
- Payload:
- POST
/messages
- Payload:
- JSON body with a
body
property.
- JSON body with a
- On success, returns
201
and the created message in the database.
- Payload:
- PUT
/messages/:id
- Payload:
- JSON body with a
body
property. - An
id
param on the route to specify a record to update.
- JSON body with a
- On success, returns
200
and the updated message in the database.
- Payload:
- DELETE
/messages/:id
- Payload:
- An
id
param on the route to specify a record to delete.
- An
- On success, returns
204
status.
- Payload:
These are the "general-purpose" SQL schemas for our databases.
{
author: STRING, // Required
body: STRING, // Required
length: INTEGER, // Required and auto populated
}
{
displayName: STRING, // Required
handle: STRING, // Required and must be unique
password: STRING, // Required
role: ENUMERATED, // Required, roles include 'user' and 'admin'. Default role is 'user'
token: VIRTUAL, // Token generated upon signup allows for authentication upon HTTP requests
}