This is a pair-programming project made my Gabriella Bolin and Sara Stjernberg. In Backend have we built an API with authentication to implement a registration flow. In Frontend do we have forms to register and log in a user, we show content for a logged in user and we have the possibility to log out a user.
We started with the Backend where we created a User
model using mongoose with properties for register a user and the possibility to store a user's access token.
We created the following enpoint for our API:
- Registration endpoint, to register a new user
- Sign In enpoint, to authenticate a returning user.
- An authenticated endpoint which only return "secret" content if the
Authorization
header with the user's token is correct. - Log Out enpoint, for logging out the user.
In the Frontend we built up registration and log in form that POST
to the API. When user is logged in we make a GET
request to see the "secret".
In Frontend we used Redux to store the possible actions to take.
Both in Backend and Frontend we have implemented valuable error messages to appear if anything goes wrong.
-
How to build a registration flow
-
How to handle authentication, both in Backend and Frontend
-
How to build Frontend and Backend at the same time
-
Node.js
-
MongoDB
-
JavaScript React
-
Redux
-
Styled Components
Link to view the webpage (frontend) live: https://reveal-secrets.netlify.app/
Link to deployed API: https://reveal-secrets-gabriella-sara.herokuapp.com/