Make company global travel and accommodation easy and convenient for the strong workforce of savvy members of staff, by leveraging the modern web.
-
Navigate to the directory where you want to copy this repo,clone it by running
git clone <link of the repo>
-
Install
postgresql
into your computer -
Create two databases:
- for development
- for testing
-
add connection string Urls to the
.env
file :-
DEV_DATABASE_URL=postgres://<username>:<password>@127.0.0.1:5432/<database for dev>
for development -
TEST_DATABASE_URL=postgres://<username>:<password>@127.0.0.1:5432/<database for test>
for testing -
Make a copy of the .env.example and rename it .env, add the corresponding project variables
-
-
Run migrations using
npm run migrate
-
Run
npm run db:seed
for commit the seeds to the database -
To undo: - all seeders run
npm run db:seed:undo
- all migrations runnpm run migrate:undo
- Run
npm run watch
to start the server - Use postman to test the endpoints
This app will be deployed on heroku, To access this app go to these link: - Production URL
Request Route | Methods | Description |
---|---|---|
/api/v1/auth/signup | POST | Users can sign up |
/api/v1/auth/signin | POST | Users can sign in |
/api/v1/auth/verification | GET | Users should be sent a verification email after signup |
/api/v1/auth/reverifyUser | GET | Users should be able to re-request for the verification if it expires |
/api/v1//auth/forgotPassword | POST | Users should be sent a reset password link when it's requested |
/api/v1/auth/resetPassword' | PATCH | Users should be to update their password |
/api/v1/trips/return | POST | Users can request for a return trip |
/api/v1/trips/oneway | POST | Users can request for a return trip |
-
Install Docker on your pc using instruction here. Make sure it's running well
-
Navigate to the directory where you want to copy this repo,clone it by running
git clone <link of the repo>
-
Follow the
.env.example
file to setup your environment and populate with corresponding values -
In your root directory run
docker build -t <your username>/node-web-app .
to build your docker image -
Run
docker images
to assure that image was successfully created -
Run
docker run -p <given port>:3000 -d <your username>/<image name>
to run your image
-
Run
docker-compose build
to create and start containers -
Run
docker ps
to get container ID -
Run
docker exec -it <container id> sh
to enter container -
Run
npm migrate
followed bynpx sequelize-cli db:seed:all
-
Run
npm run watch
and test endpoint using postman using routehttp://localhost:3000/<endpoind route>