0% found this document useful (0 votes)
4 views15 pages

FSD 6thEXP 5thSEM

The document outlines the implementation of authentication and user roles using JWT in a backend setup with Express. It details the server configuration, authentication routes, protected task routes, and the task model, emphasizing security through .env usage. Additionally, it highlights the importance of API testing with Postman for validating functionality and security features, along with suggested enhancements for task management and frontend integration.

Uploaded by

2023.gargi.dhuri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views15 pages

FSD 6thEXP 5thSEM

The document outlines the implementation of authentication and user roles using JWT in a backend setup with Express. It details the server configuration, authentication routes, protected task routes, and the task model, emphasizing security through .env usage. Additionally, it highlights the importance of API testing with Postman for validating functionality and security features, along with suggested enhancements for task management and frontend integration.

Uploaded by

2023.gargi.dhuri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

​ ​ ​ ​ Experiment - 6

Aim
Implement authentication and user roles with JWT

INPUT AND OUTPUT :

Backend :

A] Code :

a) Server Setup (server.js)

●​ Show how Express is configured, CORS setup, middleware, and database connection.​

●​ Include .env usage with process.env.MONGO_URI to highlight security.


b) Authentication Route (routes/auth.js)

●​ Include login and registration endpoints, showing JWT issuance.

c) Protected Task Routes (routes/task.js)

●​ Show how authorization middleware is used for secure endpoints.


d) Task Model (models/task.js)

●​ Show Mongoose schema, especially required fields like title, priority, category, userName.
D] .env

Postman API request + response snippet

Why it’s necessary


1.​ Shows that your backend works:​
A proof that your RESTful APIs are functional. Screenshots from Postman act as evidence.​

2.​ Captures API input/output:​


You can show the request payload (JSON sent to API) and the response (JSON returned). This
is critical for documentation.​

3.​ Validates security features:​


Testing with JWT authentication shows that only authorized users can perform actions like
creating or deleting tasks.​

4.​ Required for report completeness:​


Most experiments require code + output images. Without testing APIs, your report will be
incomplete.​
30% extra :

Task enhancements: categories, priority levels, checklists, and assignments​

Analytics endpoints for task statistics​

Frontend integration: React + Vite with JWT token handling​


Real-time updates reflected on the UI​

React-Redux for state management​

Environment-based config using .env​

Frontend
Creation of tasks :
Delete :
Editing tasks :

Update task status :

You might also like