NeuNotes is a comprehensive academic notes sharing platform designed to facilitate knowledge exchange among students and faculty members. The application allows users to share, discover, and organize academic content within an intuitive and collaborative environment.
- Features
- System Architecture
- Database Schema
- Database Programming Objects
- Installation
- Usage Guide
- API Documentation
- Technology Stack
- Project Structure
- Security Features
- CRUD Operations
- Contributors
- User Authentication: Secure login and registration system
- Role-Based Access Control: Three user roles with different permissions:
- Admin: Full system access and user management
- Faculty: Course creation and content management
- Student: Enrollment in courses and note sharing
- Course Organization: Hierarchical structure with categories and subcategories
- Notes Upload: Support for PDF and image files
- Preview Capabilities: Direct viewing of uploaded content
- Search Functionality: Find notes by various criteria
- Favorites System: Bookmark notes for quick access
- Rating System: Rate notes on a 5-star scale with average calculations
- Tagging System: Categorize notes with custom tags
- Comments: Discuss notes with other users
- Analytics Dashboard: View statistics about note engagement
- Activity Logging: Track user actions throughout the system
- Enrollment Management: Students can join courses to access content
NeuNotes follows a client-server architecture with:
- Frontend: React with Vite for the user interface
- Backend: Node.js and Express for the application server
- Database: MySQL for data persistence
- API Layer: RESTful endpoints for communication between client and server
- Authentication: Session-based authentication for security
The database consists of 12 tables, exceeding the required 9 tables for a 2-person team. All tables are normalized to 3NF:
- users: Stores user credentials and profile information
- Primary user entity with role-based access control
- Supports different academic statuses (Undergraduate/Graduate)
- categories: Represents courses/subjects
- Each category has an auto-generated unique code
- Includes metadata like creation time and creator
- subcategories: Represents sections within courses
- Hierarchical relationship with categories
- Enables granular organization of content
- enrollments: Tracks student enrollment in courses
- Many-to-many relationship between students and categories
- Contains enrollment timestamps
- uploads: Stores uploaded files
- Central table for note management
- Contains metadata and statistical counters
- file_metadata: Contains details about uploaded files
- Separates file metadata from upload management
- Stores file names, types, sizes, and URLs
- comments: Stores user comments on uploads
- Enables discussions about academic content
- Timestamps for chronological ordering
- activities: Logs user actions throughout the system
- Comprehensive activity tracking for auditing
- Records actions with timestamps
- favorites: Tracks users' favorite notes
- Implements bookmarking functionality
- Enables personalized content collections
- tags: Stores available tags for categorization
- Flexible content classification system
- User-generated taxonomy
- note_tags: Junction table connecting notes to tags
- Many-to-many relationship implementation
- Enables multi-dimensional categorization
- ratings: Stores user ratings for notes
- Five-star rating system
- Tracks individual ratings and updates aggregates
- generate_category_code: Automatically generates unique 6-character category codes
- Combines first 3 letters of name with 3 random digits
- Ensures uniqueness and readability
-
create_category: Handles category creation with automated code generation
- Centralizes business logic for category creation
- Performs activity logging
- Returns generated ID and code
-
add_or_update_rating: Manages rating creation and updates
- Validates rating value (1-5 range)
- Handles both new ratings and updates to existing ones
- Logs user activity
- Uses output parameters to indicate if rating is new
-
add_comment: Manages comment creation with validation
- Validates comment content
- Creates comment record
- Logs activity
- Returns the new comment ID
-
after_subcategory_insert/after_subcategory_delete: Maintain subcategory counts
- Automatically updates category's subcategory count
- Ensures data consistency without application code
-
after_rating_insert/update/delete: Manage rating statistics
- Automatically calculates and updates average ratings
- Maintains accurate rating counts
- Ensures data consistency across the application
-
after_comment_insert/delete: Track comment counts
- Automatically updates comment counts on uploads
- Ensures accurate comment statistics
- Node.js (v16.0 or higher)
- MySQL (v8.0 or higher)
- npm or yarn
The project includes a complete SQL file (schema.sql) with all 12 tables, stored procedures, functions, and triggers already defined:
-
Use the MySQL Data Import Feature:
- Open MySQL Workbench or your preferred MySQL client
- Connect to your MySQL server
- Create a new database named "neunotes"
- Select the "neunotes" database
- Go to "Server" > "Data Import" (in MySQL Workbench)
- Select "Import from Self-Contained File" and browse to the provided
neunotes_schema.sql
file - Click "Start Import"
-
Verify Installation:
- Ensure all 12 tables are created
- Verify stored procedures, functions and triggers are properly installed
-
Clone the repository:
git clone https://github.com/your-username/neunotes.git cd neunotes
-
Install backend dependencies:
cd backend npm install
-
Configure environment variables: Create a
.env
file in the backend directory:PORT=9090 DB_HOST=localhost DB_PORT=3306 DB_USER=root DB_PASSWORD=your_mysql_password DB_NAME=neunotes SESSION_SECRET=your_secret_key FRONTEND_URL=http://localhost:5173
-
Start the backend server:
npm run dev
-
Install frontend dependencies:
cd ../frontend npm install
-
Configure environment variables: Create a
.env
file in the frontend directory:VITE_API_URL=http://localhost:9090/api
-
Start the frontend development server:
npm run dev
-
Access the application: Open your browser and navigate to
http://localhost:5173
- Click "Sign Up" to create a new account
- Fill in your details (name, email, password, academic status)
- Log in with your credentials
- Browse available courses on the home page
- Enroll in courses you're interested in
- View course content by clicking on a course card
- Upload notes to subcategories within enrolled courses
- Rate, comment on, and favorite notes
- Add tags to notes for better organization
- View your favorites, uploads, and activity in your profile
- Create new courses (categories) using the "Create Category" button
- Create subcategories within your courses
- Upload notes to any subcategory
- Manage the content you've created
- Access the Admin Dashboard to manage users
- Create, edit, and delete any content
- View system-wide activity logs
- Change user roles as needed
POST /api/auth/signup
: Register a new userPOST /api/auth/login
: Log in a userPOST /api/auth/logout
: Log out the current userGET /api/auth/me
: Get the current user's information
GET /api/category
: Get all categoriesGET /api/category/:id
: Get a specific categoryPOST /api/category
: Create a new categoryPUT /api/category/:id
: Update a categoryDELETE /api/category/:id
: Delete a category
GET /api/subcategory/by-category/:categoryId
: Get subcategories for a categoryPOST /api/subcategory
: Create a new subcategoryDELETE /api/subcategory/:id
: Delete a subcategory
GET /api/upload/by-subcategory/:subcategoryId
: Get uploads for a subcategoryGET /api/upload/:id
: Get upload detailsGET /api/upload/my-uploads
: Get current user's uploadsPOST /api/upload
: Upload a new noteDELETE /api/upload/:id
: Delete an upload
GET /api/comment/by-upload/:uploadId
: Get comments for an uploadPOST /api/comment
: Add a commentDELETE /api/comment/:id
: Delete a comment
GET /api/favorites/my-favorites
: Get user's favoritesGET /api/favorites/check/:uploadId
: Check if user has favorited an uploadPOST /api/favorites
: Add a favoriteDELETE /api/favorites/:id
: Remove a favorite
GET /api/ratings/user/:uploadId
: Get user's rating for an uploadGET /api/ratings/average/:uploadId
: Get average rating for an uploadPOST /api/ratings
: Rate an uploadDELETE /api/ratings/:id
: Delete a rating
GET /api/tags
: Get all tagsGET /api/tags/by-upload/:uploadId
: Get tags for an uploadPOST /api/tags
: Create a new tagPOST /api/tags/note-tag
: Add a tag to a noteDELETE /api/tags/note-tag/:id
: Remove a tag from a note
- React: UI component library
- Vite: Build tool for modern web development
- Tailwind CSS: Utility-first CSS framework
- Zustand: State management
- Axios: HTTP client for API requests
- React Router: Client-side routing
- Node.js: JavaScript runtime environment
- Express: Web application framework
- MySQL: Relational database management system
- express-session: Session-based authentication
- bcrypt: Password hashing (for production use)
- multer: File upload handling
- cors: Cross-Origin Resource Sharing support
backend/
├── src/
│ ├── controllers/ # API logic
│ ├── middleware/ # Express middleware
│ ├── routes/ # API routes
│ ├── db.js # Database connection
│ ├── app.js # Express app setup
│ └── server.js # Server entry point
├── uploads/ # Uploaded files
├── database/ # Database scripts
│ └── neunotes_schema.sql # Complete database schema
├── .env # Environment variables
└── package.json # Dependencies
frontend/
├── src/
│ ├── components/ # Reusable UI components
│ ├── contexts/ # State management
│ ├── pages/ # Page components
│ ├── services/ # API services
│ ├── App.jsx # Main component
│ └── main.jsx # Entry point
├── .env # Environment variables
└── package.json # Dependencies
- Session-Based Authentication: Secure user sessions with HTTP-only cookies
- Password Storage: Hashed and secure password storage (for production)
- Input Validation: Server-side validation for all user inputs
- Role-Based Access Control: Different permissions based on user roles
- CORS Protection: Configured Cross-Origin Resource Sharing for API security
- Database Constraints: Proper foreign key constraints and data validation
- Error Handling: Comprehensive error management to prevent information leakage
- Register new users
- Create categories and subcategories
- Upload notes
- Add comments and ratings
- Create tags
- Add favorites
- View available categories
- Browse subcategories
- View uploaded notes
- Read comments
- View ratings
- See user profiles
- Update user profiles
- Edit categories
- Update ratings
- Modify tags
- Delete uploaded notes
- Remove comments
- Delete categories and subcategories
- Remove ratings
- Delete tags
- Unfavorite notes
The application uses session-based authentication with cookies, managed through express-session on the backend and a custom auth store (using Zustand) on the frontend.
Files are stored on the server filesystem with metadata stored in the database. The application supports PDFs and images with built-in preview capabilities.
The application uses raw SQL queries (no ORM) to interact with the MySQL database, demonstrating direct SQL usage and optimization.
Comprehensive error handling is implemented throughout the application using try-catch blocks and a global error handler middleware.
- CORS protection
- Session cookies with proper security attributes
- Input validation
- Role-based access control
- Proper error messaging to prevent information leakage
Possible enhancements for the NeuNotes platform:
- Advanced Search: Implement full-text search for note content
- Collaborative Editing: Real-time collaborative note editing
- Version Control: Track changes to notes over time
- Notifications: Alert users to new notes, comments, etc.
- Mobile App: Develop a mobile application for on-the-go access
- Analytics Dashboard: Provide usage statistics and insights
- Content Recommendations: Suggest notes based on user behavior and interests
- Integration with LMS: Connect with learning management systems
- Verify MySQL is running
- Check database credentials in .env file
- Ensure the database exists and is accessible
- Make sure atabase: process.env.DB_NAME || 'yourDBname' is changed in backend/src/db.js
- Check that frontend URL matches CORS settings in backend
- Verify that credentials: true is set in CORS configuration
- Check uploads directory permissions
- Verify file size limits in Multer configuration
- Clear browser cookies
- Check session configuration in app.js
- Verify SESSION_SECRET is set properly
NeuNotes extensively uses database programming objects to ensure data integrity and consistency:
- Stored Procedures: Centralize business logic at the database level
- Triggers: Automate statistics updates and ensure data consistency
- Functions: Generate codes and perform data validations
- Constraints: Enforce data integrity rules
- Transactions: Ensure atomicity of complex operations
These features demonstrate a sophisticated understanding of database design principles and showcase the ability to leverage database-level programming for application optimization.
- Achyut Katiyar | 002034885
- Anand Pinnamaneni | 002037203
© 2025 NeuNotes. All rights reserved.