Skip to content

ZeyadTarekk/ShoppingStore-REST-API

Repository files navigation

GitHub contributors GitHub issues GitHub license GitHub forks GitHub stars GitHub Language

📝 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

  1. Clone the repository
$ git clone https://github.com/ZeyadTarekk/ShoppingStore-REST-API.git
  1. Navigate to repository directory
$ cd ShoppingStore-REST-API
  1. Install dependencies
npm install

Running

  1. 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
  1. Running database migrations
npm run migrateup
  1. Running on development mode
npm run start

Building for production

  1. 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
Zeyad Tarek

License

This software is licensed under MIT License, See License for more information ©ZeyadTarekk.

Releases

No releases published

Packages

No packages published