Skip to content

stjernberg/project-auth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Auth 🎁

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.

The problem

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.

Learning Objectives

  • 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

Tech

  • Node.js

  • MongoDB

  • JavaScript React

  • Redux

  • Styled Components

View it live

Link to view the webpage (frontend) live: https://reveal-secrets.netlify.app/

Link to deployed API: https://reveal-secrets-gabriella-sara.herokuapp.com/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 92.3%
  • CSS 4.8%
  • HTML 2.9%