------------------- -----------------------Project Progress Report-----------------------------------------------Date: 31-10-2023
1.Authentication
1. JWT Token Authentication:
Users can securely log in, and JWT tokens are generated for authorized access.
Library Used: [JWT Library]
Api created[/login,/signup]
Functionalities:
1. Token generation
2. Token validation
3. User authentication flow
2 . Password Reset Functionality:
Password reset feature is operational, allowing users to recover forgotten passwords.
Password reset tokens are generated and sent to users' email addresses.
Library Used: [NodeMailer]
Api created:[/check-email-exists,/forgot-password,/update-password-by-token']
Functionalities:
1. Token generation for password reset.
2. Email verification flow
3. Secure Password Management:
User passwords are securely hashed and stored in the database to prevent data breaches.
Library Used: [Crypto,Bycrypt]
Functionalities:
1) Secure password hashing
4.Authorization
Role-Based Authorization:
1. The system distinguishes between two roles: admin and user.
2. Each role has specific access permissions and restrictions.
Admin Role Functionality:
1. The admin role is equipped with the capability to create new user accounts.
2. Admins can access a user management panel with user creation functionality.
Library Used: [MoongooseObjectId]
Api using this[/login,/profile,/users-data]
5.Folder Upload and Managementent for Python script
Libraries Used:
1) multer: Multer is used for handling file uploads. It provides configuration options for specifying
the destination and filename of uploaded files.
2) fs: The 'fs' (File System) module is part of Node.js's core modules and is used for working with
the file system, including creating directories and checking if they exist.
3) child_process: The 'child_process' module is used to spawn a child process for executing the
Python script. It provides a way to run external commands and handle their output.
6. Multer Storage Configuration:
A 'storage' configuration is defined for Multer, specifying the destination and filename for
uploaded files.
The destination function creates a directory based on the 'folderPath' received in the request
and sets it as the destination path for uploaded files.
If the directory does not exist, it is created using 'fs.mkdirSync'.
Libraries used:[Multer]
7. JWT Token-Based Authentication Middleware
Api created [/api/admim,/api/user]
Middleware Function:
The authenticateMiddleware function is responsible for validating JWT tokens in the
'authorization' header of incoming HTTP requests.
It checks the token format, verifies the token's authenticity using the 'jsonwebtoken' library,
and sets user data in the request object if the token is valid.
Library Used[mongoose,jsonwebtoken,express]
Project Components:
user-login
signup
services
reset-password
email-provider
confirmation
adminsign-up
tasks
Angular Services:
1. Angular AuthService Service: Angular AuthService service, which is responsible for
handling user authentication, authorization, and related operations within an Angular
application
Libraries used [@angular/core,HttpClient,rxjs,@angular/router
2. Angular AdminService:The primary purpose of the AdminService is to facilitate the
retrieval of information specific to logged-in admin users.
Service Functionality:
The AdminService features a single method:
fetchLoggedInAdminInfo: This method retrieves admin information for the currently
logged-in admin user. It starts by checking for the presence of an admin JWT token in local
storage. If a valid token is found, it constructs the necessary HTTP headers with the token
for authentication.