KamSafer is a web app that enables you to log your trip's information. The purpose, total kilometers travelled by your vehicle, and notes to include your destination.
- Create logs that enables you to log your trip's information using modern technologies:React.js.
- Allows the users used app to download his logs in excel version.
- Can log in using the general user and password of the Mercy Corps organization
- Select the car I’ll be using
- Confirm your trips and keep track of my kilometers travelled
- Show the report of all logged trips
- View trips by date
- Download an excel version of my reports
- Leave the account
- React.js : https://reactjs.org/docs/getting-started.html
- Sequalize : http://docs.sequelizejs.com/
- Express JS : https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/Introduction
- Material UI : https://material-ui.com/
- The client folder contains the front end code
- The src folder contains the backend and DB code
- The editor begins at client/components/login/index.js
- config.js contains the dummy data for the app
- The entry point is an app.js file which manages all components, get and send data to the src/app.js file which contains all app endpoints
- node 8 & npm>5
- postgres
- run
git cloneof this repo andcdinto the folder - Provision a postgres database (either locally or remotely)
- In the root directory create a
.envfile- Add the following database environment variables, taking the values from the database you set up in the previous step:
DB_DIALECT, DB_HOST, DB_NAME,DB_PASSWORD, DB_USER - A jwt secret variable, named
SECRET - User log in variables,
USERNAMEandHASHED. To generate the hash runnode lib/hasher [plaintext password]and copy the printed value.
- Add the following database environment variables, taking the values from the database you set up in the previous step:
- commands (from root):
npm iinstall server dependenciesnpm startrun production servernpm run devrun dev server using nodemoncd client && npm iinstall react app dependenciescd client && npm startrun dev-server react appcd client && npm buildbuild react app
- The server will run on
PORT=4000while the dev react app will run atPORT=3000 - To initialise some cars in your database you need to run the
db_build.jsfile insrc/database/config/- Edit the file to change the
carsArraydata if you want to. - When you are happy with it, run the file using
node [path to file]NOTE This will wipe the database completely. Do not attempt to run to edit anything in a production base. The file should abort ifDB_HOSTis notlocalhostanyway but you should not even think about running this file if you have production database credentials in your.env.
- Edit the file to change the
https://kamsafer.herokuapp.com/
- you should have a general username and password related to Mercy Core employees to login
- select the car model you want to use
- click add trip button to add trip, then add information about your trip
- click show report button to see all trips related to this car model
- click on Download report to get a excel version
- click logout to leave account
- Sama Amro
- Shaima Ihdoosh
- Orjwan Rajaby