cpsc455-bugstorm / TravelersTea

A Trip Planning App that tailors travel itineraries based on user preferences and providing detailed information about destinations; making travel planning less daunting and more enjoyable.
https://travelerstea-906d.onrender.com
MIT License
6 stars 2 forks source link

Router -> Controller -> Model Pattern for User #30

Closed AndyLiang1 closed 11 months ago

AndyLiang1 commented 11 months ago

Created the Router -> Controller -> Model Pattern for User. This PR also contains code to connect to our mongoDB.

Router calls controllers and is responsible for only exposing the route. Controller contains business logic and accesses the DB. Controllers may also call other controllers. Models define the schema of a collection (think of a table in SQL).

To test this PR, you need a .env file in the server folder. See the secrets channel. In postman or google, put in http://localhost:5000/api/user to see the result. image

L0Lmaker commented 11 months ago

I think you have to whitelist public IPs to connect to the Atlas cluster @AndyLiang1

L0Lmaker commented 11 months ago

Related to #28

L0Lmaker commented 11 months ago

@AndyLiang1 Can you also add instructions for local development without connecting to Atlas Cluster, incase we want to perform testing, local environment and data would be super useful so we dont nuke the "production" database

AndyLiang1 commented 11 months ago

@AndyLiang1 Can you also add instructions for local development without connecting to Atlas Cluster, incase we want to perform testing, local environment and data would be super useful so we dont nuke the "production" database

Not actually sure how to do local development with Atlas... I will look into this soon

AndyLiang1 commented 11 months ago

I think you have to whitelist public IPs to connect to the Atlas cluster @AndyLiang1

My thinking is just whoever uses it would whitelist their own IPs...I should add this to the read me