Coder Social home page Coder Social logo

project-auth's Introduction

Project Auth - Developers: Anna Lindgren, Sofia Arzt Wallén, Elaine Bergstrom

What did we Learn? -How to combine Frontend and Backend applications together. -Built an API with authentication to create registration flow. -Connected Frontend to create or register a user to our DB that is then linked in to our main page of content.

The problem

For this project we aimed to create our own backend to pull from to the frontend and display data on our main page after successfully logging in. The setup for this Express API consists of a MongoDB stored in Atlas and then deployed to Heroku. Mongoose was used for creating endpoints and manipulating the data. We then created a Schema, for the user, which defines the structure of the document.

Our Base URL for the API is: https://secret-auth-api.herokuapp.com/

Our Endpoints:

GET /secret Restricted endpoint - the user's accessToken must be included in the GET request from the frontend for the user to be able to see the secret message. We decided to redirect our users from this page instead of an error message if they try to access it without a proper accessToken.

POST /login Endpoint to login for users that have already registered.

POST /register Endpoint to register as a new user. This endpoint expects a name and password in the body from the POST request from the Frontend.

The frontend was built using React Redux and styled-components. We created one reducer for all the User logic (login, register, authenticate token, etc).

If we had more time in the backend we'd love to build our own data collection to pull from and display in the frontend. We also would of added local storage, and email input with validation. We'd also like to use more re-useable components to avoid repeatition in our code.

View it live

Netlify: https://romantic-torvalds-704609.netlify.app/ Heroku: https://secret-auth-api.herokuapp.com/

project-auth's People

Contributors

emolsz avatar sofarz avatar dependabot[bot] avatar thecorgicoder avatar idlefingers avatar

Stargazers

Anna Lindgren avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.