Giter VIP home page Giter VIP logo

tembea's Introduction

tembea

CircleCI

Maintainability

Test Coverage

Trip management at it's best for Andela.

Description

Tembea is the our solution for making trip request, scheduling, reporting and analytics very easy at Andela.

Table of Contents

Documentation

/api/v1/slack : our slack integration is our MVP

Setup

Dependencies

  • NodeJS - A JavaScript runtime environment
  • Express - A web application framework for NodeJS
  • PostgreSQL - A relational database management system that extends SQL
  • Sequelize - A promise-based ORM for NodeJS

Getting Started

Follow these steps to set up the project in development mode

  • Install Nodejs

  • Install and setup PostgreSQL

  • Clone the repository by running the command

    git clone https://github.com/andela/tembea.git
    
  • Run cd tembea to enter the application's directory

  • Install the application's dependencies by running the command

    yarn install
    
  • Create the .env or .env.development file by running cp .env.sample .env or cp .env .env.development

  • Populate the env file created above by obtaining valid values for the environment variables. (Consult your teammates).

  • Setup the database and migrations (see database setup)

  • Start the application by running

    yarn run start:dev
    

    The application should now be running at http://127.0.0.1:5000

Database and ORM

  • Create a database in PostgreSQL and name it tembea

  • Set the following environment variables in .env (to be created in the env directory):

    • DATABASE_USERNAME - this is the database username
    • DATABASE_PASSWORD - this is the database password. Ignore if you don't have a database password
    • DATABASE_NAME - set this to tembea
  • Run database migrations

    yarn run db:migrate
    
  • Check the database and confirm that the users table has been created

More about environmental variables

After setting up your .env from the template provided in the env/.env.sample file; to use these environment variables anywhere in the app, simply:

process.env.MY_ENV_VARIABLE

Run the Service Using Docker

NOTE: Make sure no service is running on port 5000 and ensure there is a .env file with all the necessary environment variables.

To run the application just type: make start

this would run your application inside a container which you can easily access using localhost:5000.

To stop the application, you can just hit ^c.

To delete the containers: make stop

WARNING: Running below command will make you loose all your data including data in the database!

To cleanup all the containers + volumes: make clean

NOTE: The below commands should be run when the application is running inside container

To migrate database: make migrate

To seed database: make seed

To rollback migrations: make rollback

To get inside the container: make ssh

HINT: To use docker, ensure that your .env file does not contain DATABASE_URL as it conflicts with the value in docker-compose.yml

Testing

Jest is used as the testing framework for both the unit tests and integration tests. To execute all tests, run the command

  yarn test or make test

Deployment

TODO - add deployment commands

Docker for Local development

tembea's People

Contributors

adaezeodurukwe avatar ah-med avatar akhilome avatar akinmyde avatar allan690 avatar bileonaire avatar blackshady avatar davidshare avatar derkip avatar dev-jey avatar devdbrandy avatar e-ian avatar fabzer0 avatar filschristian avatar fridolinho avatar gransono avatar imire avatar iyikuyoro avatar jamesenejo avatar johnmadakin avatar johnwayodi avatar kibetchirchir avatar macphilips avatar micah-akpan avatar muhwezideo avatar njeri-ngigi avatar reiosantos avatar sokopaulsokool avatar thegaijin avatar tomiadebanjo avatar

Stargazers

 avatar

Watchers

 avatar  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.