Skip to content

Kush05Bhardwaj/Notes-Finder

Repository files navigation

Notes Finder - Full Stack Application

A comprehensive notes sharing platform for students and teachers, built with React.js frontend and Express.js backend with MongoDB database.

πŸš€ Features

  • User Authentication: Register, login, password reset
  • Role-based Access: Student, Teacher, and Admin roles
  • Notes Management: Upload, view, download, rate and comment on notes
  • Subject Organization: Browse notes by subjects and categories
  • File Upload: Support for multiple file formats
  • Search & Filter: Advanced search with filters
  • User Profiles: Personal profiles with uploaded notes
  • Responsive Design: Mobile-friendly interface with Tailwind CSS

πŸ› οΈ Tech Stack

Frontend

  • React 18
  • React Router v6
  • Tailwind CSS
  • React Icons
  • Axios

Backend

  • Node.js
  • Express.js
  • MongoDB with Mongoose
  • JWT Authentication
  • Bcrypt for password hashing
  • Multer for file uploads
  • Express Validator

πŸ“‹ Prerequisites

Before running this application, make sure you have the following installed:

  • Node.js (v16 or higher)
  • MongoDB (locally or MongoDB Atlas)
  • npm or yarn

βš™οΈ Installation & Setup

1. Clone the repository

git clone <repository-url>
cd Notes-Finder

2. Install Frontend Dependencies

cd frontend
npm install

3. Install Backend Dependencies

cd backend
npm install
cd ..

4. Environment Configuration

Create environment files from examples:

# Root environment
cp .env.example .env

# Frontend environment  
cp frontend/.env.example frontend/.env

Update the .env file with your configuration:

NODE_ENV=development
PORT=5000
MONGODB_URI=mongodb://localhost:27017/notes_finder
JWT_SECRET=your_super_secure_jwt_secret_32_chars_minimum
JWT_EXPIRE=30d
UPLOAD_PATH=./uploads
MAX_FILE_SIZE=5000000
FRONTEND_URL=http://localhost:3000
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret

⚠️ Important:

  • Never commit .env files to git
  • Use strong, random JWT_SECRET (32+ characters)
  • For production, use environment-specific values

5. Start MongoDB

Make sure MongoDB is running on your system:

# If using local MongoDB
mongod

# Or if using MongoDB as a service
sudo systemctl start mongod

6. Seed the Database (Optional)

To add sample data to your database:

cd backend
node seeder.js

This will create sample users, subjects, and notes. Login credentials:

πŸƒβ€β™‚οΈ Running the Application

Option 1: Run Both Frontend and Backend Together

npm run dev

Option 2: Run Separately

Backend (Terminal 1):

cd backend
npm run dev

Frontend (Terminal 2):

cd frontend
npm start

The application will be available at:

πŸ“ Project Structure

Notes-Finder/
β”œβ”€β”€ frontend/             # React frontend application
β”‚   β”œβ”€β”€ public/          # Public assets
β”‚   β”œβ”€β”€ src/             # Frontend source code
β”‚   β”‚   β”œβ”€β”€ components/  # React components
β”‚   β”‚   β”œβ”€β”€ services/    # API services
β”‚   β”‚   β”œβ”€β”€ App.js      # Main App component
β”‚   β”‚   └── index.js    # Entry point
β”‚   β”œβ”€β”€ .env            # Frontend environment variables
β”‚   β”œβ”€β”€ package.json    # Frontend dependencies
β”‚   └── README.md       # Frontend documentation
β”œβ”€β”€ backend/             # Express.js backend application
β”‚   β”œβ”€β”€ controllers/    # Route controllers
β”‚   β”œβ”€β”€ middleware/     # Custom middleware
β”‚   β”œβ”€β”€ models/         # MongoDB models
β”‚   β”œβ”€β”€ routes/         # API routes
β”‚   β”œβ”€β”€ .env           # Backend environment variables
β”‚   β”œβ”€β”€ seeder.js      # Database seeder
β”‚   β”œβ”€β”€ server.js      # Entry point
β”‚   └── package.json   # Backend dependencies
β”œβ”€β”€ .env                # Main environment variables
└── README.md          # Main documentation

πŸ”§ API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user
  • GET /api/auth/me - Get current user
  • PUT /api/auth/profile - Update profile
  • PUT /api/auth/change-password - Change password

Notes

  • GET /api/notes - Get all notes
  • GET /api/notes/:id - Get single note
  • POST /api/notes - Create new note
  • PUT /api/notes/:id - Update note
  • DELETE /api/notes/:id - Delete note
  • GET /api/notes/featured - Get featured notes

Subjects

  • GET /api/subjects - Get all subjects
  • GET /api/subjects/:id - Get single subject
  • POST /api/subjects - Create subject (Teacher/Admin)
  • PUT /api/subjects/:id - Update subject (Teacher/Admin)
  • GET /api/subjects/:id/notes - Get notes for subject

Users

  • GET /api/users/:id - Get user profile
  • GET /api/users/:id/notes - Get user's notes

πŸ”’ Authentication & Authorization

The application uses JWT-based authentication with role-based access control:

  • Public: View notes and subjects
  • Students: Upload notes, comment, rate
  • Teachers: All student privileges + create subjects
  • Admins: All privileges + user management

πŸ“¦ Database Models

User Model

  • Personal information (name, email, university, course)
  • Authentication (password, role)
  • Profile data (bio, avatar, reputation)
  • Relationships (uploaded notes, saved notes)

Subject Model

  • Subject details (name, code, department)
  • Academic info (credits, semester, year)
  • Metadata (difficulty, tags, prerequisites)

Note Model

  • Content (title, description, files)
  • Academic context (subject, semester, type)
  • Interactions (ratings, comments, likes)
  • Metadata (views, downloads, tags)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ› Troubleshooting

Common Issues

  1. MongoDB Connection Error

    • Ensure MongoDB is running
    • Check the MONGODB_URI in .env file
  2. Port Already in Use

    • Change the PORT in .env file
    • Kill the process using the port: lsof -ti:5000 | xargs kill
  3. Module Not Found Errors

    • Delete node_modules and package-lock.json
    • Run npm install again

Environment Variables

Make sure all required environment variables are set in your .env file:

  • MONGODB_URI - MongoDB connection string
  • JWT_SECRET - Secret key for JWT tokens
  • PORT - Backend server port (default: 5000)

πŸ“ž Support

If you encounter any issues or have questions, please:

  1. Check the troubleshooting section above
  2. Search existing issues in the repository
  3. Create a new issue with detailed information

Happy Coding! πŸš€

About

A Personalized Web Application for Notes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages