Coder Social home page Coder Social logo

storefront-backend's Introduction

Storefront Backend Project

Getting Started

  1. To install required dependencies run yarn

  2. Update the variables in .env && .env.test with your values

PORTS

  • Dev server port: 3000

  • Dev db port: 5432

  • Test server port: 3000

  • Test db port: 5432

Database setup for development

  1. Create user
        Create User 3to1dash With Password '5937865562';
  1. Create the development and test databases
        Create database shopfront_api;
        Create database shopfront_api_test;
  1. Grant all databases privileges to user in both databases
        Grant All Privileges On Database shopfront_api To 3to1dash;
        Grant All Privileges On Database shopfront_api_test To 3to1dash;

Setup for development

  1. To run the development migrations

     $ npm run db:up
    
  2. To run build and run the server

     $ npm run server
    

After finishing testing the api run:

  1. To drop the development database

     $ npm run db:drop
    

API Endpoints And DB Tables

To check the api endpoints and the database tables open: REQUIREMENTS.md.

Environment Variables

Dev

    POSTGRES_HOST=127.0.0.1
    POSTGRES_PORT=5432
    POSTGRES_USER=3to1dash
    POSTGRES_PASSWORD=5937865562
    POSTGRES_DB=shopfront_api
    ENV=dev
    BCRYPT_SECRET=cobalt-giraffe-25
    SALT_ROUNDS=10
    TOKEN_SECRET=manurus2684!

Test

    POSTGRES_HOST=127.0.0.1
    POSTGRES_PORT=5432
    POSTGRES_USER=3to1dash
    POSTGRES_PASSWORD=5937865562
    POSTGRES_DB=shopfront_api_test
    ENV=test
    BCRYPT_SECRET=cobalt-giraffe-25
    SALT_ROUNDS=10
    TOKEN_SECRET=manurus2684!

Steps to run the test suites

  1. To run build and run the server

     $ npm run server:test
    
  2. To run the test Suites

     $ npm run test
    

storefront-backend's People

Contributors

3to1dash 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.