π
Table of Contents
π
About
- A RESTful API to support online store.
π
API Endpoints
Products
- Index
GET /products
- Show
GET /products/:product_id
- Create [token required]
POST /products
Users
- Index [token required]
GET /users
- Show [token required]
GET /users/:user_id
- Create [token returned]
POST /users
Orders
- Current Order by user [token required]
GET /orders/:user_id
- Completed Orders by user [token required]
GET /completedorders/:user_id
π
Getting Started
This is an list of needed instructions to set up your project locally, to get a local copy up and running follow these instructuins.
Installation
- Clone the repository
$ git clone https://github.com/ZeyadTarekk/ShoppingStore-REST-API.git
- Navigate to repository directory
$ cd ShoppingStore-REST-API
- Install dependencies
npm install
Running
- Create .env file and add your environment variables
POSTGRES_HOST
POSTGRES_DB
POSTGRES_TEST_DB
POSTGRES_USER
POSTGRES_PASSWORD
ENV="dev"
BCRYPT_PASSWORD
SALT_ROUNDS
TOKEN_SECRET
- Running database migrations
npm run migrateup
- Running on development mode
npm run start
Open http://localhost:3000 with your browser to see the result
Building for production
- Compiling for production mode
npm run build
Running Tests
npm run test
π»
Built Using
- Node.js
- Express.js
- TypeScript
- PostgreSQL
- Jasmine for testing
Contributors
Zeyad Tarek |
License
This software is licensed under MIT License, See License for more information Β©ZeyadTarekk.