- Rahul R P
- Noel
This project is a backend system for generating official college letters. Users can input their details, and an AI-generated letter will be created and stored. The system also provides authentication features like user registration and login.
Many students struggle with writing formal letters for applications, leave requests, and duty leave. Manual letter writing is time-consuming and error-prone.
Our system automates letter generation using AI, ensuring correctness and professionalism. It also provides authentication for secure access and management.
- Backend: Node.js, Express.js
- Database: MongoDB, Mongoose
- Authentication: JWT, bcrypt.js
- AI Letter Generation: OpenRouter API
- Frontend: React.js
npm installnpm startEndpoint: POST /api/auth/register
{
"name": "John Doe",
"email": "[email protected]",
"password": "securepassword"
}✅ Response:
{
"message": "User registered successfully",
"token": "jwt_token_here"
}Endpoint: POST /api/auth/login
{
"email": "[email protected]",
"password": "securepassword"
}✅ Response:
{
"message": "Login successful",
"token": "jwt_token_here"
}Endpoint: GET /api/auth/me
✅ Headers:
{
"Authorization": "Bearer jwt_token_here"
}✅ Response:
{
"id": "user_id",
"name": "John Doe",
"email": "[email protected]"
}Endpoint: POST /api/letters/submit
{
"fullName": "John Doe",
"rollNumber": "123456",
"department": "CSE",
"semester": 6,
"recipient": "Principal",
"letterType": "Leave Letter",
"reason": "Medical leave",
"description": "I was sick for 3 days.",
"fromDate": "2025-03-01",
"endDate": "2025-03-03"
}✅ Response:
{
"message": "Letter generated successfully",
"letterId": "letter_unique_id",
"generatedLetter": "Your formatted letter text here..."
}Endpoint: GET /api/letters/:id
✅ Response:
{
"letterId": "letter_unique_id",
"generatedLetter": "Your formatted letter text here..."
}- Rahul R P: Backend development, API design, MongoDB integration, authentication, AI integration.
- Noel: Frontend development, API integration, UI design, testing.
Dept. of Computer Applications, CUCEK