This project is a demo that shows several things explained in the Skylab Coders Bootcamps (Autumn 2016 Edition). It uses the restaurants collection provided in the official Mongo site
Can be seen online at: https://restaurantsfinder.herokuapp.com/
## Topics
Topics covered in this demo:
- API endpoints using data from a MongoDb collection to retrieve data or perform actions:
GET
/restaurants
→ get all restaurantsGET
/restaurants/borough/:borough
→ get restaurants by boroughGET
/restaurants/cuisine/:cuisine
→ get restaurants by cuisineGET
/restaurants/cuisine/not/:cuisine
→ get restaurants by NOT cuisineGET
/restaurant/:id
→ get restaurant by IDPOST
/restaurant/:id
→ update restaurantGET
/:id/around/:km
→ get restaurants by proximityGET
/boroughs
→ get boroughsGET
/cuisines
→ get cuisines
- API endpoints accepting parameters to filter results
?limit=10
→ limit to 10 results?page=2
→ show page 2 according to the limit to 10 results?show=borough,name
→ show only this fields?hide=_id
→ hide these fields
- Angular App using this data to display the info to the user
- controllers
- directives
- services
- routes
- Use of Bootstrap for Angular
ui.bootstrap
(Modals, dropdowns...) - Results pagination
- Google Maps
- Display coordinates as markers in the map →
marker
- Fit the map to markers →
bounds
- Zoom the map for details →
setPan
- Draggable marker and capture event and new coordinates →
draggable: true
- Display coordinates as markers in the map →
- Upload images to AWS (S3) and get remote link to use it in the DB
- Login & Register w/ Passport (Local) & JWT
- Remember me →
localStorage
orsessionStorage
- Remember me →
- Roles System (admin)
bower
to manage client dependenciesnpm
to manage server dependencies
To run local server you need to create a .env
w/ the following variables...
S3_BUCKET=XXXXXXXXXXXXXXXX
AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXX
AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXX
DB_URI=mongodb://localhost:27017/XXXXX
SECRET=XXXXXXXXXXXXXXXX
With this, to start the project you just can do...
npm run dev
To run remotely (in heroku) the proper environment variables should be set before deploying...
heroku config:set S3_BUCKET=XXXXXXXXXXXXXXXXXXXXXXXX
heroku config:set AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXXXXXXX
heroku config:set AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXX
heroku config:set DB_URI=mongodb://<%USER%>:<%PASS%>@XXXXXXXXX.mlab.com:00000/xxxxxxxxxxx
heroku config:set ENVIRONMENT=production
heroku config:set SECRET=XXXXXXXXXXXXXXX