Coder Social home page Coder Social logo

moondev's Introduction

TMD: FullStack Intern Assignment

Overview

This assignment involves setting up a simple username/password authentication system using Redux for state management and Next.js for the front-end and back-end. You will create API endpoints with bearer token authentication and implement a custom useAuthSession hook to manage the user's session on the client side.

Your Tasks

  1. Implement the useAuthSession Hook:

    • In hooks/useAuthSession.ts, create a custom hook that manages the user's authentication session.
    • The hook should handle checking if a user is authenticated and fetching user data.
  2. Create and Complete the API Endpoints:

    • create the required apis
  3. Bearer Token Authentication:

    • Implement bearer token authentication in your API endpoints.
    • Ensure that API requests are secured and only accessible to authenticated users.

Example Usage of useAuthSession Hook

const { user } = useAuthSession();

if (user) {
  console.log('User:', user.username);
}

Estimated Time

Please spend no more than 3-4 hours on this assignment and submit whatever you can complete within that time frame.

Bonus Tasks

  1. Add validation checks for the login form.
  2. Show toast notifications for errors and successful login.

Submission

  1. Ensure all your changes are committed.
  2. Push your changes to a new repository on your personal GitHub account with public access.
  3. Provide a link to your repository, along with your email and phone number, in the provided Google Form. Do not create pull requests in the shared repository.

moondev's People

Contributors

adeesh-bode avatar

Watchers

 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.