Phantom is an online platform with facilitate the transport into town, we are tracking buses, we assign the buses to drivers and operators.
Modernize the public transport, in order to accelerate and facilitate the displacement of the client and reduce the time spending on the bus station
- Get some stuffs on table
- Run in terminal
npm install
- Create
.env
file in project root directory - Create the variables for
.env
taken.env.example
as reference for the environment to create which are used in the project - You can add other extra environment if you want other specific things
Note: Add keys in
.env.example
to ease next setup for other developers.
- Time to serve
-
For you to use your new environment variable you have to import
dotenv
module in the file where you want to utilise your environment variables and configure it. like this:import dotenv from 'dotenv'; dotenv.config();
-
Then you'll be able to access your environment variables via
process.env.YOUR_KEY
-
TYou can then proceed with the other installation!. , happy coding!
- Configuring
.env
- Download and install pgAdmin
- Create two databases, one for testing and another for development.
- Copy
DATABASE_DEV_URL=postgres://your_db_user:[email protected]:5432/your_dev_db_name
DATABASE_TEST_URL=postgres://your_db_user:[email protected]:5432/your_test_db_name
URLs from.env.example
to.env
- Edit them with your real database user, password, port(if you changed the default one) and database name.
- Running Migrations (this is to undo and redo migration)
- Run
npm run migrate:reset
in terminal to fire up migration
- Run
- Running Seeds
- Run
npm run seed
in terminal to run all seeds
- Run
npm run dev
in terminal
- Run
npm test
in terminal