Code Monkey home page Code Monkey logo

storefront-backend's Introduction

Storefront Backend Project

This project is a backend storefront for website that can make user register and create orders with a specifics products, the project was made as requirement project for udacity

Getting Started

This repo contains storefront backend application

Technologies Stack

The Following technologies stack was used in this project:

  • PostgresSQL
  • dotenv
  • Node/Express
  • db-migrate
  • Json Web Token (JWT)
  • Bcrypt
  • jasmine from npm for testing

Setup the Database

Create the database for both dev and test to start the application

  • Connect to the base route in postgres psql -U postgres
  • Create a user if with the credential CREATE USER postgres WITH PASSWORD postgres;
  • Create Databases for dev CREATE DATABASE "Storefront-database";
  • Create Database for test CREATE DATABASE "Storefront-database_test";

Environment Variables

```
NODE_ENV=dev
PORT=3000
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DATABASE=Storefront-database
POSTGRES_DATABASE_test=Storefront-database_test
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
TOKEN_SECRET=a74085e0f502135b6d1fb90d0ac6c52da219ea6f84f3f1e7b8bd36131e7d31d540aaff49e2c7418555fbff8301990000281cbabf4771a3cee769963a0801f9e1
```

Steps to start the application

  • Install the required packages yarn
  • Run the script to run all migrations: yarn table:run
  • To start the application: yarn start
  • For testing it will build and migrate and start jasmine by this script: yarn test

Scripts

  • Install dependencies: yarn
  • To start the server: yarn start
  • To start the server with nodemon: yarn dev
  • To start the test with jasmine: yarn test it will run build before start and migrate test db
  • To run all migration files: yarn table:run
  • To revert the migration: yarn table:down

API Requirement

Check the REQUIREMENT.md for the data shape and the endpoint as required

storefront-backend's People

Contributors

404303 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.