Git Product home page Git Product logo

storefront_backend's Introduction

Storefront_Backend

Database Setup

-> Start postgres database on port 5432

  1. you need to open sql shell (psql)
  2. if you have different password you can put in .env file instead of my password in variable called POSTGRES_PASSWORD .
  3. write the following queries to create databases.

Create database called store_database.

  1.  CREATE DATABASE store_database;
    

Create database called storetest_database for testing.

  1.  CREATE DATABASE storetest_database;
    

connect to store_database database.

  1.  \c store_database
    

project Setup

1- Install Dependencies:

    npm install

2- Create .env file

    ENV=dev
    POSTGRES_HOST=localhost
    POSTGRES_DB=store_database
    POSTGRES_TEST_DB=storetest_database
    POSTGRES_USER=postgres
    POSTGRES_PASSWORD=0000
    BCRYPT_PASSWORD=nasdno!sAOP\SSA
    SALT_ROUNDS= 15
    TOKEN=secret_token

3- setUp database

start postgres database on port 5432
    db-migrate up 

4- Build the project

    npm run build

5- start server

    npm run start

6- server listen on port 3000

    -> localhost:3000

Testing

To test every action happened to database & test every endpoint action

npm run test 

storefront_backend's People

Contributors

alyzakaria avatar

Watchers

 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.