Welcome to the PaperPal application! This project is designed to manage and interact with study material files, handle user responses, and assist with posting and resolving doubts. The application also integrates an AI assistant for answering general questions. It provides functionalities for uploading, downloading, and managing exam-related files, posting and replying to doubts, and interacting with an AI assistant.
The PaperPal application has been refactored from HTML/CSS/JS to React with TypeScript for improved type safety and component-based architecture. The application provides a web interface for users to upload, manage, and download exam files. It supports managing user responses and linking those responses to exam files. Additionally, users can interact with an AI assistant powered by Google Gemini via the home page. The application also allows users to post and resolve doubts related to exams, fostering better learning and communication.
Moreover, when a PDF is uploaded, it is analyzed by AI to ensure it meets the required guidelines. If the document does not comply, it gets rejected automatically, reducing manual effort in the review process.
-
Question Paper and Notes Upload and Download:
- Users can upload exam files and download them by accessing the file details through the application.
- When a user uploads a PDF, it is analyzed by Google Gemini AI in parallel using multithreading to ensure the file meets guidelines and is study-related.
- If the file is not related to study materials, it is automatically rejected, reducing manual effort.
-
Ask AI:
- The integrated AI assistant allows users to ask questions, similar to ChatGPT, to get instant responses for better learning and problem-solving.
-
Doubts Postings:
- Users can post doubts, respond to others' doubts, and manage their doubts effectively. This feature promotes collaboration and clarity among students.
The Authentication API handles user registration, login, and authentication processes.
-
POST /user/redirectHome: Registers a new user.
- Request Body:
{ username, email, password } - Response:
{ message, token }
- Request Body:
-
POST /user/login: Authenticates a user and provides a JWT token.
- Request Body:
{ email, password } - Response:
{ message, token, userData }
- Request Body:
The User API handles user-related actions such as password management and profile updates.
-
POST /user/changePassword: Sends an OTP for user verification.
- Request Body:
{ email } - Response:
{ message, success }
- Request Body:
-
POST /user/otp: Verifies the OTP entered by the user.
- Request Body:
{ email, otp } - Response:
{ message, success }
- Request Body:
-
PUT /user/setNewPassword: Changes the user's password.
- Request Body:
{ email, newPassword } - Response:
{ message, success }
- Request Body:
-
GET user/activate: Verifies the code and redirect to homepage. -Request Body:
{ code }-Response:{ redirect to paperpals.onrender.com}
The UserResponse API manages uploading and retrieving educational files with course-specific metadata and PDF analysis capabilities.
-
POST /userresponse: Uploads and analyzes educational files.
- Headers:
Authorization: {JWT token} - Request Body:
form-data: { course, branch, semester, fileType, file, title, description } - Response:
HTTP 200 OK
- Headers:
-
GET /userresponse/getlinks: Retrieves download links for files based on course criteria.
- Headers:
Authorization: {JWT token} - Query Parameters:
course, branch, semester(required) - Response:
{ List<FileDto> }
- Headers:
The Doubts API manages posting, replying to, and retrieving doubts.
-
POST /doubts/postDoubts: Creates a new doubt.
- Headers:
Authorization: {JWT token} - Request Body:
{ title, description } - Response:
{ message, doubtData }
- Headers:
-
GET /doubts/allDoubts: Retrieves all doubts with optional filtering.
- Headers:
Authorization: {JWT token} - Query Parameters:
user, solved(optional) - Response:
{ doubts }
- Headers:
-
GET /doubts/{id}: Retrieves a specific doubt with its replies.
- Headers:
Authorization: {JWT token} - Path Parameter:
id - Response:
{ doubt, replies }
- Headers:
-
POST /doubts/addReply: Adds a reply to a doubt.
- Headers:
Authorization: {JWT token} - Path Parameter:
id - Request Body:
{ content } - Response:
{ message, reply }
- Headers:
-
DELETE /doubts/deleteDoubt/{id}: Deletes a specific doubt.
- Headers:
Authorization: {JWT token} - Path Parameter:
id - Response:
{ message, success }
- Headers:
The AI Assistant API provides interaction with the integrated AI assistant.
- POST /api/ai/ask: Sends a query to the AI assistant and receives a response.
- Headers:
Authorization: {JWT token} - Request Body:
{ query } - Response:
{ answer }
- Headers:
The PaperPal application's frontend is built using React with TypeScript, featuring the following key components:
- RegisterForm: Handles user registration with form validation
- LoginForm: Manages user login and authentication
- PasswordReset: Facilitates the password reset flow with OTP verification
- Navbar: Main navigation with responsive design for both mobile and desktop
- Sidebar: Context-aware sidebar that changes based on the current section
- ThemeToggle: Switches between light and dark themes
- FileUpload: Multi-step form for uploading exam files with metadata
- FileList: Displays filterable list of available files with download options
- FileViewer: Preview component for PDF files
- DoubtsList: Displays all doubts with filtering and sorting options
- DoubtDetail: Shows a single doubt with all replies and actions
- DoubtForm: Form for creating new doubts
- ReplyForm: Component for adding replies to existing doubts
- AIChatInterface: Real-time chat interface for interacting with the AI assistant
- QueryHistory: Shows previous AI interactions
- Button: Reusable button component with various states
- Modal: Reusable modal for confirmations and forms
- Dropdown: Custom dropdown component for selections
- Toast: Notification system for success/error messages
- LoadingSpinner: Visual indicator for loading states
To run the application locally, follow these steps:
git clone https://github.com/Medhansh-32/Paper_Pal.gitcd Frontend
npm install
npm run devcd Backend
# Add the required configuration in `application.properties`
mvn clean install
java -jar target/PaperPal-0.0.1-SNAPSHOT.jarIf you have Docker and Docker Compose installed, you can run the entire application using:
docker-compose up --buildIf Docker v20.10 or greater use this :
docker compose up --buildThis will build and start both the frontend and backend services together.
- Frontend: http://localhost:5173
- Backend: http://localhost:8080
- Frontend is available at: http://localhost:5173
- Backend is available at: http://localhost:8080
If you find this project helpful or interesting, don't forget to give it a β on GitHub! Your support is greatly appreciated and helps the project grow!
- Node.js (v14 or higher)
- Java (v11 or higher)
- Maven (v3.6 or higher)
- Docker and Docker Compose (for containerized deployment)
Make sure to configure your application.properties file in the Backend directory with the necessary database and API configurations before running the application.
If you encounter any issues:
- Ensure all prerequisites are installed
- Check that ports 5173 and 8080 are available
- Verify your
application.propertiesconfiguration - For Docker issues, ensure Docker daemon is running
For additional support or questions, please visit the GitHub repository and create an issue.