Giter Club home page Giter Club logo

winners-c8-bn-be's Introduction

winners-c8-bn-be

Example:

CircleCI Reviewed by Hound Coverage Status

Basic folder structure:

ROOT FOLDER: WINNERS-C8-BN-BE
├───lib                        : /lib folder contains codes compiled by babel from the /src folder
│   ├───controllers
│   ├───database
│   │   ├───migrations
│   │   ├───models
│   │   └───seeders
│   ├───routes
    ├───test
    └───validations
├───node_modules                  : /node_modules folder is mentioned in the .gitignore file
│   ├─── ...
│   └─── ...
│       └─── ...
│           └─── ...
└───src                            : /src folder contains the source code,
    ├───controllers                  and should be written using **ES6**,
    ├───database                     and can be compiled by running
    │   ├───config                    "npm run build"  (this uses babel to compile)
    │   ├───migrations
    │   ├───models
    │   └───seeders
    ├───routes
    ├───test
    └───validations

Dotenv usage:

To use dotenv, one should:

  1. Add the .env file in the root folder of the project, with the environment variables declarations; for e.g, the .env file can contain this text:
    SOME_TEXT=this_is_a_text
    SOME_KEY=this_is_a_key
    
  2. Next, use import 'dotenv/config'; in any JS file (in the /src folder) to ensure that the process.env object's properties will include those from the .env file. for e.g, as a continuation to the example given above, the JS file may look like: import 'dotenv/config'; console.log(process.env.SOME_TEXT); // This displays "this_is_a_text" console.log(process.env.SOME_KEY); // This displays "this_is_a_key" Note that the JS file will need to be compiled using babel.

Project Setup


Sequelize ORM

SETUP

  1. Install and setup postgres

    • install postgres
    • Create two databases: Testing and Development
  2. Configure .env

    • fill .env file with the names and credentials of the databases, basing on the .env.example file
  3. Run Migrations

    • Run npm run dbmigrate in terminal to migrate the migrations to the database

Other Sequelize options

  • To Undo Migrations

    • Run npm run dbmigrate:undo to undo all migrations
  • To Run seeders

    • Run npm run dbseed to seed the database
  • To undo seeders

    • Run npm run dbseed:undo to undo the seeders

Integrate githubCI with README BADGES

winners-c8-bn-be's People

Contributors

nyakamwe avatar k-ds avatar himbaza123h avatar ihimbazwe avatar pacomesimon avatar munezerobagira avatar alicepretty avatar t2003 avatar habaumugisha1 avatar tetoalia avatar nadinefiona avatar elissadesign avatar

Stargazers

 avatar  avatar

Watchers

Alpha Omondi Ogilo avatar mukunzidd avatar  avatar DUSHIMIMANA Bernard avatar anguandia mike 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.