IMM9O / -capstone-udacity-storefront

A full-stack Shopping app built with PERN Stack πŸ“¦

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Storefront

CircleCI

Link To Live Web

Full stack app built with Postgres-Express-React-Nodejs Stack, hosted on AWS, and use CircleCI as CI/CD.

Table of content

Tech stack

  • DB
    • postgres
  • API
    • NodeJs
    • Typescript
    • ExpressJs
  • UI
    • ReactJs
    • AntD
  • Hosted
    • AWS
  • CI/CD
    • CircleCI

Project setup

  1. Clone the project git clone https://github.com/IMM9O/udacity-storefront.git.

  2. Installation is done using the npm install command: npm install.

Note: Install command will also install client&server dependencies

  1. Install postgres on your local machine from this link.

  2. Open Sql Shell (psql).

  3. Connect to the default postgres database user psql -U postgres.

  4. In psql run the following to create the dev, test, and production databases.

/** DEV database **/
CREATE DATABASE udacity_storefront_dev;
/** Test database **/
CREATE DATABASE udacity_storefront_test;
/** Production database **/
CREATE DATABASE udacity_storefront;
  1. Setup database npm run db:up.

  2. Make a copy for .env.example file to .env and then change the variables to match your environment.

Don't forget to replace {database_password} with your current postgres password

NODE_ENV=dev
DB_HOST=127.0.0.1
DB_USER=postgres
DB_PASSWORD={database_password}
DB_DATABASE_DEV=udacity_storefront_dev
DB_DATABASE_TEST=udacity_storefront_test
DB_DATABASE_PROD=udacity_storefront
BCRYPT_PASSWORD=
SALT_ROUNDS=
TOKEN_SECRET=
  1. To start the app run npm start.

Note: This command will start both app the client and the server

Database Port Server Port Client Port
5432 3001 3000

Available scripts

  • To start both frontend and backend app run npm start
  • To check app format run npm run prettier
  • To check app error run npm run lint
  • To test both frontend and backend app run npm run test
  • To build both frontend and backend app run npm run build

Database

For More information go to here => Database

APIs

For More information go to here => REQUIREMENTS

URL Type Token Required
/api/products/ GET ❌
/api/products/:id GET ❌
/api/products/ POST βœ”
/api/products/:id UPDATE βœ”
/api/products/:id DELETE βœ”
/api/users/ GET βœ”
/api/users/:id GET βœ”
/api/users/ POST ❌
/api/users/:id UPDATE βœ”
/api/users/:id DELETE βœ”
/api/users/:id/authenticate POST ❌
/api/orders/:userId GET βœ”
/api/orders/completed/:userId GET βœ”
/api/orders/active/:userId GET βœ”
/api/orders/:id GET βœ”
/api/orders/ POST βœ”
/api/orders/:id UPDATE βœ”
/api/orders/:id DELETE βœ”
/api/orders/:id/products POST βœ”
/api/orders/:id/products GET βœ”

UI

The UI built with the help of create react app. For More information go to here => UI

About

A full-stack Shopping app built with PERN Stack πŸ“¦


Languages

Language:TypeScript 86.8%Language:JavaScript 7.2%Language:HTML 2.9%Language:CSS 2.5%Language:Shell 0.7%