A full-stack web application built with MERN Stack. The system allows:
- User Authentication (register/login)
- PDF Report Generation from pre-existing assessment data
- Authentication: Implemented with JWT tokens, password hashing & comparison for secure login.
- Configuration-driven flexibility (support new assessment types without code changes)
Health & Fitness Assessment_session_001 (7).pdf
- User signup with validation
- Secure login
- After login, if the JWT token is valid and not expired, user is automatically redirected to the /generate-report endpoint.
- Backend API for authentication operations
- React + HTML + CSS forms for UI
- Generate reports from pre-existing assessment data (
data.js/data.ts) - Dynamic report templates based on
assessment_id - Configuration-driven design: Add new assessment types, mappings, and ranges without touching code
- Uses Puppeteer to convert HTML templates into styled PDFs
- Stores generated PDFs in the local filesystem
Assessment-Management-System/
βββ components/ # React components (e.g., AssessmentReport.js)
β βββ AssessmentReport.js
βββ config/ # Config files (sections, mappings, classifications)
βββ Controllers/ # Controllers (e.g., reportController.js)
βββ middlewares/ # Middlewares (errorHandler.js, tokenHandler.js)
β βββ errorHandler.js
β βββ tokenHandler.js
βββ Models/ # Database models (if needed for users/auth)
βββ node_modules/ # Dependencies
βββ public/ # Public assets (if used for frontend)
βββ reports/ # π Generated PDF reports are saved here
βββ Routes/ # API route definitions
β βββ reportRoute.js # Handles /generate-report endpoint
β βββ userRoute.js # Handles signup/login/auth endpoints
βββ views/ # HTML templates (used by Puppeteer for PDF generation)
βββ .env # Environment variables (JWT secret, etc.)
βββ .gitignore
βββ app.js # Express app entry point
βββ constants.js # Constant values (config keys, enums, etc.)
βββ data.js # Pre-existing assessment data (session-based)
βββ package.json
βββ package-lock.json
Perfect π Hereβs the updated Setup & Installation section for your README based on your actual folder structure and implementation:
git clone https://github.com/kaushikkanduri/Assessment-Management-System.git
cd Assessment-Management-Systemnpm installCreate a .env file in the root directory with the following keys:
PORT=5000
JWT_SECRET=your_jwt_secret_key
TOKEN_EXPIRY=1hStart the server:
node app.js- Frontend (React) runs from
components/(served by backend or standalone if you configure it). - Backend API runs on
http://localhost:5000. - PDFs generated will be saved inside the
/reportsdirectory.
- Register a user β
POST /auth/signup - Login user β
POST /auth/login(receives JWT token) - If token is valid and not expired β system automatically redirects user to
/generate-report?session_id=your_session_id - PDF will appear in
/reports/.
Do you want me to also include sample API calls with curl/Postman for signup, login, and report generation in the README?
POST /api/registerβ Register userPOST /api/loginβ Login user
-
POST /generate-report/:id- Params:
{ session_id: "session_001" } - Action: Reads
data.js, identifiesassessment_id, applies config, generates PDF, saves toreports/
- Params:
- All sample assessment data lives in **
data.js** - Each record has a
session_id - Example:
{
"session_id": "session_001",
"assessment_id": "as_hr_02",
"accuracy": 80,
"bodyCompositionData": { "BMI": "33.145" },
"vitalsMap": {
"vitals": { "heart_rate": 75, "bp_sys": 124, "bp_dia": 82 }
}
}The core challenge is maximum flexibility.
{
"as_hr_02": ["Key Body Vitals", "Heart Health", "Posture", "Body Composition"],
"as_card_01": ["Key Body Vitals", "Cardiovascular Endurance", "Body Composition"]
}{
"overallHealthScore": "accuracy",
"heartRate": "vitalsMap.vitals.heart_rate",
"bmi": "bodyCompositionData.BMI",
"bp_sys": "vitalsMap.vitals.bp_sys",
"bp_dia": "vitalsMap.vitals.bp_dia"
}{
"bmi": {
"underweight": "<18.5",
"normal": "18.5-24.9",
"overweight": "25-29.9",
"obese": "30+"
}
}π Adding a New Assessment Type:
- Add new entry in
config/structedRecord.json - Define field mappings in
config/dataMapper.json - Update classification ranges in
config/classifications.json - Add template in
templates/No code changes required! β
-
Signup/Login via frontend UI
-
Call API
/generate-reportwithsession_id -
System:
- Reads data from
data.js - Determines
assessment_id - Loads config + template
- Generates PDF using Puppeteer
- Saves it to
/generated-reports/
- Reads data from
-
Open generated PDF π
- Frontend: React.js, HTML5, CSS3, EJS
- Backend: Node.js (JavaScript), Express
- PDF Generation: Puppeteer
- Storage: Local filesystem (for reports)
- Data Source:
data.js