Skip to content

Backend for the Time Capsule project built by Sofia Vaz Sousa and Vanessa Sue Smith πŸš€ A RESTful API using Express and Node.js, and for storage MongoDB with mongoose πŸ‘Ά

Notifications You must be signed in to change notification settings

sofiavazs/final-project-backend

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Time Capsule Backend πŸš€ - Architecture for this API

"Time Capsule" is a student project developed by Sofia Vaz Sousa and Vanessa Sue Smith.

Read more about Time Capsule here: https://time-capsule-final.netlify.app/about

For our Time Capsule Backend we are working with a RESTful API built with Express on Node.js. We are storing our data in a Mongo Database structured with mongoose. Server deployed to Heroku and MongoDB stored in Atlas.

We work with 3 main collections in our database: User, BabyProfile and DailyEntry. We have connected the collections by creating a relation to the User model, so for example each DailyEntry entry includes an entryBy property, which lists the ID of the user who authored this entry.

We have implemented validation where possible on each of our models, in order to control that the data stored in our database is clean and proper ✨

Frontend - See it in Action πŸ’₯

You can find the Time Capsule Frontend repository here, where we have put this API to the test πŸ’ͺ: https://github.com/VanessaSue27/final-project-frontend

And a deployed LIVE version of it here: https://time-capsule-final.netlify.app/

CORE ROUTES - Documentation ⭐

Restricted endpoints : These can only be accessed after the user has successfully signed up or logged in. In order for it to be validated, these endpoints expect the user's valid access token included in the POST request's authorization header.

Base URL πŸ‘Ά

https://time-capsule-final.herokuapp.com/

GET /

Home Page, shows a list of the endpoints.

GET /entries/latest

Restricted endpoint: Endpoint to show the last 5 daily entries for a specific baby.

GET /profiles

Restricted endpoint: Endpoint to show the baby details (BabyProfile data) for a specific baby.

POST /users

Registration endpoint: creates a new user (Sign Up) This endpoint expects a name and password in the client's POST request body in order to create a new User in the database.

POST /sessions

Login endpoint: login for an already existing user. This endpoint expects a username and password in the client's POST request in order to authenticate an already existing User.

POST /profiles

Restricted endpoint: Endpoint to create a new Baby Profile. The POST request done in the Frontend must include in the body: babyName, dateOfBirth, timeOfBirth, gestationalAge, sex, weight and length values.

POST /entries

Restricted endpoint: Endpoint to create a new Daily Entry. The POST request done in the Frontend must include in the body: dailyActivities, dailyWeight and dailyReflection values.

POST /profile/image

Restricted endpoint: Endpoint to add a personalised profile picture. The POST request done in the Frontend must include multipart form data for image handling.

DELETE /entries/:entryId

Restricted endpoint: Endpoint to delete a specific entry. It takes the ID from the entry the user wants to delete and removes it from the database.

PATCH /entries/:entryId

Restricted endpoint: Endpoint to edit a specific daily entry. It takes the entry ID from the entry the user wants to update, included in the request URL and updates it. The PATCH request done in the Frontend must include in the body: dailyActivities, dailyWeight, dailyReflection.

About

Backend for the Time Capsule project built by Sofia Vaz Sousa and Vanessa Sue Smith πŸš€ A RESTful API using Express and Node.js, and for storage MongoDB with mongoose πŸ‘Ά

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%