Indigenous Plant Go is a mobile application that allows BCIT Students to explore the BCIT Burnaby campus and discover plants, and points-of-interests that have significance in the indigenous culture.
Table Of Contents
- Core Application Features
- Application Features
- Technology Stack
- Entity Relationship Diagram (ERD)
- Road-mapped Features
- Installation Documents
This specific repository houses the server-side functions of the mobile application's content management system (cms).
- User authentication
- Users can create, read, update, delete resources:
- Plants
- Waypoints
- Locations
- Media (Images, Video, Audio)
- Categories + Tags
- CMS Exposes a Restful API for the Mobile application to consume
- Authentication with JWT
- User credentials are stored encrypted into the database
- Forgot password function allows users to recover their accounts
- Server-side & client-side input type and format validation
- Image and Audio uploads are stored in s3 and read from s3
- Videos will be uploaded exclusively via youtube link.
- PERMISSIONS are currently not implemented.
- Programmatic database backups stored to S3
- Allow input for QR code data on a plant and/or waypoint resource
- Implement (2) more resource types: "tours", and "learn more"
- Database: MongoDB Cloud
- Server: NodeJS, express
- Clone the repo with the following code:
git clone https://github.com/BCITConstruction/indigenousplantgo-cms-server.git
And navigate into the folder:
cd indigenousplantgo-cms-server
- Install all the node module with
npm install
. - Few things related to .env file needs to be set up:
- To run this locally you will need to set up a S3, see S3 doc for how to set that up.
- To run this locally you will need to set up mongoDb, if you have mongo shell and stuff you can just set
MONGO_DB_URL=mongodb://localhost:27017/<Your Db name>
in .env file. For mongoDb atlas set up, see MongoDb Atlas doc.- This also includes a seeder to fill the database with sample data, see Seeder doc for how to use the seeder.
- One more thing to set up in .env file is sender email for recovering password.
- For gmail you do need to have less secure app access on Final .env file should have the following field:
MONGO_DB_URL=<Your mongo_db url>
AWS_BUCKET_NAME=<Your s3 bucket name>
AWS_BUCKET_REGION=<Your s3 bucket region>
AWS_ACCESS_KEY=<Your s3 access key>
AWS_SECRET_KEY=<Your s3 secret key>
SENDER_EMAIL=<Your email that handles sending recovery email>
SENDER_PASSWORD=<Your password for the email above>
- Running
npm start
now should run the api stuff athttp://localhost:8080
, for the routes see All route docs for all the routes.
- Set up the app on heroku site and download heroku cli, typing heroku --version in your terminal to check if you install heroku cli correctly.
- Add add the heroku git url as a remote to this repo (you can get this from the setting from the app you set up on heroku site) and push to heroku.
git add remote heroku <Your heroku git url>
git push heroku master
- You also need to set up s3 and mongoDb separately, but you put the variable that is suppose to go in .env file into config vars in heroku app's setting, see above to run locally step 2 to see what environmental variables are required.
- An extra variable you can add is ACCESS_TOKEN_SECRET to separate the jwt token generated from your local with ones generated from your deployed app, the secret can be anything you want.
- Once you set up all the environmental variables in config vars on heroku, you should be able to run it on your deployed domain, route still follow those in All route docs.