PaperTrail is a centralized workspace designed for student research teams and faculty guides to collaborate throughout the research lifecycle. It addresses the fragmentation of information caused by managing papers, notes, progress reports, faculty feedback, and team discussions across separate channels such as Google Docs, Drive, WhatsApp, and email.
- Leader: Create research projects, invite team members, invite faculty guides, and manage tasks.
- Member: Upload research papers, add reference notes, log project progress, and participate in discussions.
- Faculty Guide: Review team progress logs, add suggestions/comments, and comment on document submissions.
- Leader registers and creates a project.
- Leader invites members and faculty guides via email.
- Invitees accept the invitation to join the project workspace.
- Team members upload relevant research papers, write notes, and log project progress.
- Faculty guides review the progress logs and leave suggestions or comments.
- The project dashboard visualizes the active timeline (activity feed), documents, progress log contributions, and project comments.
- React
- Tailwind CSS
- React Router
- Lucide React Icons
- Node.js
- Express
- MongoDB
- Mongoose ODM
- JWT (JSON Web Tokens) for session authorization
- bcryptjs for secure password hashing
- Nodemailer for email-based invitation flows
- Cloudinary for paper storage
- Multer for file upload handling
- CORS for cross-origin resource sharing
The application uses an MVC (Model-View-Controller) architecture on the backend to decouple database schemas, application controllers, and route definitions. Source code is organized under a src/ subdirectory within server/.
PaperTrail/
├── client/ # Frontend React application
│ ├── src/
│ │ ├── components/ # Shared React components (PortalLayout, etc.)
│ │ ├── context/ # Auth and Theme React Contexts
│ │ ├── pages/ # Frontend pages (Dashboard, ProjectWorkspace, Login, etc.)
│ │ └── index.css
│ ├── package.json
│ └── vite.config.js
├── server/ # Backend Node.js / Express application
│ ├── src/
│ │ ├── config/ # DB, Mailer, and Cloudinary configurations
│ │ ├── controllers/ # Business logic handlers
│ │ ├── middlewares/ # Auth & Upload middlewares
│ │ ├── models/ # Mongoose schemas (User, Project, Paper, Note, Comment, ProgressLog, Invitation)
│ │ └── routes/ # Express API route endpoints
│ ├── tests/ # Integration tests and utility scripts
│ ├── server.js # Backend entry point
│ ├── package.json
│ └── .env
├── vercel.json # Monorepo Vercel deployment configuration
└── README.md
- User: name, email, password (hashed), role (LEADER, MEMBER, FACULTY)
- Project: title, description, leader (Ref: User), faculty (Ref: User), members (Ref: User Array)
- Paper: title, authors, year, keywords, projectId (Ref: Project), uploadedBy (Ref: User), pdfUrl
- Note: paperId (Ref: Paper), authorId (Ref: User), content
- Invitation: email, projectId (Ref: Project), role, token, status (PENDING, ACCEPTED, REJECTED)
- ProgressLog: projectId (Ref: Project), userId (Ref: User), description, date
- Comment: projectId (Ref: Project), authorId (Ref: User), content
| Method | Route | Description | Auth Required |
|---|---|---|---|
| POST | /register |
Register a new user | No |
| POST | /login |
Login and receive JWT token | No |
| GET | /me |
Get current user profile | Yes |
| Method | Route | Description | Auth Required | Role Required |
|---|---|---|---|---|
| POST | / |
Create a new project | Yes | LEADER |
| GET | / |
Get all projects for current user | Yes | Any |
| GET | /:id |
Get a specific project by ID | Yes | Any (member) |
| DELETE | /:projectId/members/:memberId |
Remove a member from the project | Yes | LEADER/FACULTY |
| Method | Route | Description | Auth Required | Role Required |
|---|---|---|---|---|
| POST | / |
Send project invitation email | Yes | LEADER |
| POST | /accept |
Accept project invitation | Yes | Any |
| GET | /verify/:token |
Verify invitation token status | No | Any |
| Method | Route | Description | Auth Required |
|---|---|---|---|
| POST | / |
Upload a new PDF paper to project | Yes |
| GET | /project/:projectId |
Fetch all papers for a project | Yes |
| DELETE | /:id |
Delete a paper (and Cloudinary asset) | Yes |
| Method | Route | Description | Auth Required |
|---|---|---|---|
| POST | / |
Add note to a paper | Yes |
| GET | /paper/:paperId |
Get all notes for a specific paper | Yes |
| PUT | /:id |
Update an existing note (author only) | Yes |
| DELETE | /:id |
Delete a note (author or project lead) | Yes |
| Method | Route | Description | Auth Required |
|---|---|---|---|
| POST | / |
Add a new progress log entry | Yes |
| GET | /project/:projectId |
Fetch progress logs for a project | Yes |
| Method | Route | Description | Auth Required |
|---|---|---|---|
| POST | / |
Add a new project comment | Yes |
| GET | /project/:projectId |
Fetch project comments | Yes |
| Method | Route | Description | Auth Required |
|---|---|---|---|
| GET | /project/:projectId |
Fetch combined project activity feed | Yes |
- Node.js (version 18 or above recommended)
- MongoDB database instance (local community server or MongoDB Atlas cluster)
-
Clone and navigate to the project directory:
cd PaperTrail -
Configure environment variables: Create a
.envfile in theserverdirectory and configure the variables based on the template:PORT=5000 MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key JWT_EXPIRES_IN=7d CLIENT_URL=http://localhost:3000 EMAIL_USER=your_email_address EMAIL_PASSWORD=your_email_app_password CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
-
Install Dependencies:
- Inside the server directory:
cd server npm install - Inside the client directory:
cd client npm install
- Inside the server directory:
-
Run the Application locally:
- Start the backend server:
cd server npm run dev - Start the frontend development server:
cd client npm run dev
- Start the backend server:
All integration tests are placed in the server/tests/ directory. They dynamically resolve server configurations using your .env variables.
-
Run all integration tests: Ensure the server is running locally on port 5000, then execute:
node tests/testProjects.js node tests/testInvitations.js node tests/testPapers.js node tests/testNotes.js node tests/testProgress.js node tests/testComment.js node tests/testActivity.js
-
Reset/Clean Test Database: To purge all automated test projects, progress logs, comments, and temporary users while keeping base accounts intact:
node tests/cleanDb.js