Skip to content

Latest commit

 

History

History
executable file
·
160 lines (121 loc) · 3.76 KB

README.md

File metadata and controls

executable file
·
160 lines (121 loc) · 3.76 KB

Build Status Coverage Status Reviewed by Hound

Barefoot Nomad - Making company travel and accomodation easy and convinient.

Vision

Make company global travel and accommodation easy and convenient for the strong workforce of savvy members of staff, by leveraging the modern web.

This is the swagger API documentation link

Heroku backend endpoint

This the heroku staging Api https://script-heroes-bn-backend-stgng.herokuapp.com/

This the production Api https://script-heroes-bn-backend.herokuapp.com/

Setup Dotenv

  • Create .env file in project root directory
  • Copy keys in .env-example file, which is in the project root directory and assign values to those keys.
  • You can add more environmenta variables to the .env file
  • To use declared variables, require dotenv at the top of your file import dotenv from 'dotenv' and call its method config dotenv.config()
  • Access environment variable value by using process.env.KEY_NAME where KEY_NAME is the variable name.

Note: If you make changes that uses environmental variables make sure to add those variables with example values in the .env.example file.

Sequelize and Sequelize-cli

1 Installing cli

npm install

2 Running Migrations

sequelize db:migrate

3 Running Seeds

sequelize db:seed:all

Signup Endpoint

User Registration Model

{
  "firstName": "name",
  "lastName": "lastName",
  "email": "[email protected]",
  "phoneNumber": "12345678",
  "password": "mypassword"
}

Forgot password

{
  "email": "[email protected]"
}

Reset password

{
  "password": "newPassword",
  "confirmPassword": "newPassword"
}

Profile Page Settings Endpoints

Complete Profile Model

{
gender: DataTypes.STRING,
birthdate: DataTypes.DATE,
language: DataTypes.STRING,
currency: DataTypes.STRING,
country: DataTypes.STRING,
department: DataTypes.STRING,
linemanager: DataTypes.INTEGER
}

Update Profile Model

{
firstName: DataTypes.STRING,
lastName: DataTypes.STRING,
phoneNumber: DataTypes.STRING,
gender: DataTypes.STRING,
birthdate: DataTypes.DATE,
language: DataTypes.STRING,
currency: DataTypes.STRING,
country: DataTypes.STRING,
department: DataTypes.STRING,
linemanager: DataTypes.INTEGER
}

Profile Schema

{
  "firstName": "name",
  "lastName": "lastName",
  "email": "[email protected]",
  "phoneNumber": "12345678",
  "gender": "Male",
  "birthdate": "1978-05-04T00:00:00.000Z",
  "language": "Kinyarwanda",
  "currency": "US$",
  "country": "Rwanda",
  "department": "IT",
  "linemanager": "JOHN Doe"
}

Accommodation model

{
  "facilityName": "facility Name",
  "locationId": 1,
  "description": "Full description of the facility",
  "roomType": "room type",
  "photoUrl": "Url for image"
}

Return Trip model

{
  "origin": 1,
  "destination": 3,
  "from": "2020-10-10",
  "till": "2020-10-15",
  "travelReasons": "vacation",
  "accomodationId": 1
}

Endpoints

  • Hosted url: https://script-heroes-bn-backend-stgng.herokuapp.com/
  • Signup: /api/auth/signup
  • Login: /api/auth/login
  • Complete Profile: /api/profile/complete
  • Display Profile: /api/profile
  • Update Profile: /api/profile/update
  • Accomodations: /api/accomodations
  • Forgot Password: /api/forgotPassword
  • Trip With Return Date: /api/trip/return-trip