2022-05-24 01:48:50 +00:00
# Shelf Project
2022-04-19 14:47:00 +00:00
2022-05-24 01:48:50 +00:00
An online storefront to showcase products. Users is able to browse an index of all products, see the specifics of a single product, and add products to an order that they can view in a cart page.
2022-05-24 17:42:02 +00:00
# Installation
1 - Install packages dependencies. `npm install`
2 - Inside shelf folder mount the database. `docker compose up`
3 - Run tests. `npm run test`
4 - Run the database `npm run up`
5 - Launch the application `npm run start`
2022-05-24 19:09:28 +00:00
Note : If needed you can reset the tables by closing the app and running the following commands :
- `npm run down`
- `npm run up`
2022-05-24 17:42:02 +00:00
# Availaible endpoints
- Products :
2022-05-24 19:09:28 +00:00
| HTTP Verb | Endpoint | CRUD |
|:--------------:|:--------------------|:-----------------|
| Get | `/products` | Index |
| Get | `/products/:id` | Read |
| Post | `/products` | Create ( Token ) |
| Put | `/products/:id` | Update ( Token ) |
| Delete | `/products/:id` | Delete ( Token ) |
2022-05-24 17:55:47 +00:00
2022-05-24 17:42:02 +00:00
- Users :
2022-05-24 19:09:28 +00:00
| HTTP Verb | Endpoint | CRUD |
|:--------------:|:--------------------|:-----------------------|
| Get | `/users` , | Index ( Token ) |
| Get | `/users/:id` | Read ( Token ) |
| Post | `/users` | Create |
| Put | `/users/auth` | Authenticate ( Token ) |
| Put | `/users/:id` | Update ( Token ) |
| Delete | `/users/:id` | Delete ( Token ) |
- Orders
2022-05-24 17:42:02 +00:00
2022-05-24 19:09:28 +00:00
| HTTP Verb | Endpoint | CRUD |
|:--------------:|:-----------------------|:-----------------|
| Get | `/orders` , | Index ( Token ) |
| Get | `/orders/:id` | Read |
| Post | `/orders` | Create |
| Post | `/orders/:id/products` | Create ( Token ) |
| Delete | `/orders/:id/products` | Delete ( Token ) |
2022-05-24 17:42:02 +00:00
# Built with
- Typescript
2022-05-24 19:09:28 +00:00
- Postgres
- Node
- Express
- Dotenv
- Db-migrate
- Jsonwebtoken
- Jasmine
- Supertest
2022-05-24 17:42:02 +00:00
# Author
Anis Benziane.