Deployed Project URL - https://compassionate-dijkstra-1aaa11.netlify.app/index.html
- Express
- CORS
- Helmet
- Knex
- SQLite3
- Postgres
- Supertest
- Jest
- Nodemon
- Dotenv
- Cross-env
- BcryptJS
- JSON Web Tokens
- Knex Cleaner
- fork and clone this repository.
- CD into the folder where you downloaded the repository.
- run
npm ito download all dependencies.
| field | data type | metadata |
|---|---|---|
| id | unsigned integer | primary key, auto-increments, generated by database |
| username | string, 128 characters | username, required, unique. |
| password | string, hashed | required |
| field | data type | metadata |
|---|---|---|
| project_id | unsigned integer | primary key, auto-increments, generated by database |
| user_id | string | joined with users table id, required |
| title | string, 256 characters | Required. |
| description | string | not required |
| goal_amount | string | not required |
| amount_received | string | not required |
| funding_completed | boolean | not required |
BaseURL: https://sixr-clone.herokuapp.com
-
Project Overview:
GET All Projects - /api/overview/
-
REGISTER:
POST a new User - /api/auth/register/
{ "username":"insert username here", <----required "password":"insert password here" <----required } -
LOGIN:
POST to log in as a User - /api/auth/login/
{ "username":"insert username here", <----required, unique. "password":"insert password here" <----required } * returns a token. Assign token to "Authorization" header.
-
GET All Users:
GET - /api/users/ * requires token from login function set to "Authorization" header. -
GET A Single User:
GET - /api/users/:userId * requires token from login function set to "Authorization" header. -
UPDATE A User:
PUT - /api/users/:userId { "username":"insert username here", <----required "password":"insert password here" <----required } -
DELETE A User:
DELETE - /api/users/:userId
-
GET All Projects for a User :
GET - /:userId/projects/ * requires token from login function set to "Authorization" header. -
GET A Single Project attached to a User :
GET - /:userId/projects/:id * requires token from login function set to "Authorization" header. -
ADD A User:
POST - /:userId/projects/ { user_id: same # as user.id <----required title: string, required <----required description: string goal_amount: integer amount_received: integer funding_completed: boolean } * requires token from login function set to "Authorization" header. -
UPDATE A User:
PUT - /:userId/projects/:id { user_id: same # as user.id <----required title: string, required <----required description: string goal_amount: integer amount_received: integer funding_completed: boolean } * requires token from login function set to "Authorization" header. -
DELETE A User:
DELETE - /:userId/projects/:id * requires token from login function set to "Authorization" header.