Giter Club home page Giter Club logo

node-auth1-project's Introduction

Introduction to Authentication Module Project

Introduction

Use Node.js, Express and Knex to build an API that provides register, login and logout functionality.

Instructions

Task 1: Project Setup

Your instructor should have communicated which method to use for this project during the Guided Project and in your cohort's Slack channel. If you are still unsure, reach out to Lambda Staff.

Task 2: Minimum Viable Product

2A - Database Access Functions

Write the following user access functions inside api/users/users-model.js:

  • find
  • findBy
  • findById
  • add

2B - Middleware Functions

Write the following auth middlewares inside api/auth/auth-middleware.js:

  • restricted
  • checkUsernameFree
  • checkPasswordLength
  • checkUsernameExists

2C - Endpoints

Authentication will be tracked using sessions and cookies. See api/server.js for more instructions.

Write the following endpoints. The first one belongs inside api/users/users-router.js and the rest inside api/auth/auth-router.js:

  • [GET] /api/users
  • [POST] /api/auth/register
  • [POST] /api/auth/login
  • [GET] /api/auth/logout

Users Schema

The database auth.db3 includes a single users table:

field data type metadata
user_id unsigned integer primary key, auto-increments, generated by db
username string required, unique
password string required

Notes

  • Run tests locally executing npm test.
  • The project comes with migrate, rollback and seed scripts in case you need to reset the database.
  • You are welcome to create additional files but do not move or rename existing files or folders.
  • Do not alter your package.json file except to install extra libraries or add extra scripts. Do not update existing libraries.
  • In your solution, it is essential that you follow best practices and produce clean and professional results.
  • Schedule time to review, refine, and assess your work.
  • Perform basic professional polishing including spell-checking and grammar-checking on your work.

Task 3: Stretch Goals

  • Build a React application that implements components to register, login and view a list of users. Gotta keep sharpening your React skills.

node-auth1-project's People

Contributors

luishrd avatar ladrillo avatar jleegwater avatar mixelpixel avatar karthikv avatar ryan-hamblin 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.