Skip to content

rprahul07/autodraftai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

AutoDraft.Ai 🚀

Basic Details

Team Name: The Code Father

Team Members

  • Rahul R P
  • Noel

Project Description

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.

The Problem Statement

Many students struggle with writing formal letters for applications, leave requests, and duty leave. Manual letter writing is time-consuming and error-prone.

The Solution

Our system automates letter generation using AI, ensuring correctness and professionalism. It also provides authentication for secure access and management.


Technical Details

Technologies Used

  • Backend: Node.js, Express.js
  • Database: MongoDB, Mongoose
  • Authentication: JWT, bcrypt.js
  • AI Letter Generation: OpenRouter API
  • Frontend: React.js

Implementation

Installation

npm install

Run the Server

npm start

API Endpoints 📌

1️⃣ User Authentication APIs

🔹 Register User

Endpoint: POST /api/auth/register

{
  "name": "John Doe",
  "email": "[email protected]",
  "password": "securepassword"
}

Response:

{
  "message": "User registered successfully",
  "token": "jwt_token_here"
}

🔹 Login User

Endpoint: POST /api/auth/login

{
  "email": "[email protected]",
  "password": "securepassword"
}

Response:

{
  "message": "Login successful",
  "token": "jwt_token_here"
}

🔹 Get Current User (Protected)

Endpoint: GET /api/auth/meHeaders:

{
  "Authorization": "Bearer jwt_token_here"
}

Response:

{
  "id": "user_id",
  "name": "John Doe",
  "email": "[email protected]"
}

2️⃣ Letter Generation APIs

🔹 Submit Letter Request

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..."
}

🔹 Get Generated Letter by ID

Endpoint: GET /api/letters/:idResponse:

{
  "letterId": "letter_unique_id",
  "generatedLetter": "Your formatted letter text here..."
}

Team Contributions 👥

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •