Skip to content
Β 
Β 

Latest commit

Β 

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PlacePrep - Online Placement Preparation Platform

A comprehensive online platform for placement preparation with contests, practice tests, and resource management.

πŸš€ Features

For Students

  • Practice Tests: Take practice tests with questions from various categories
  • Contests: Participate in timed contests with real-time monitoring
  • Bookmarks: Save important questions for later review
  • Results & Analytics: View detailed performance analytics
  • Resources: Access study materials, PDFs, and videos
  • Real-time Notifications: Get notified about new contests and results

For Administrators

  • User Management: Manage students and moderators
  • Question Bank: Add, edit, and manage questions
  • Contest Creation: Create and manage contests
  • Analytics Dashboard: View platform statistics and user performance
  • Resource Management: Upload and manage study materials

For Moderators

  • Question Management: Add and edit questions
  • Contest Management: Create contests and monitor participation
  • Content Moderation: Review and approve content

πŸ› οΈ Tech Stack

Backend

  • Node.js with Express.js
  • PostgreSQL with Prisma ORM
  • Socket.IO for real-time features
  • JWT for authentication
  • Multer for file uploads
  • Nodemailer for email notifications
  • Cron jobs for automated tasks

Frontend

  • React 18 with Vite
  • React Router for navigation
  • Tailwind CSS for styling
  • Lucide React for icons
  • React Toastify for notifications
  • Socket.IO Client for real-time features
  • Chart.js for analytics
  • Recharts for data visualization

πŸ“‹ Prerequisites

  • Node.js (v16 or higher)
  • PostgreSQL (v12 or higher)
  • npm or yarn

πŸš€ Installation

1. Clone the repository

git clone <repository-url>
cd PlacePrep

2. Install dependencies

# Install backend dependencies
cd backend
npm install

# Install frontend dependencies
cd ../frontend
npm install

3. Set up environment variables

Create a .env file in the backend directory:

# Database Configuration
DATABASE_URL="postgresql://username:password@localhost:5432/placeprep_db"

# JWT Configuration
JWT_SECRET="your-super-secret-jwt-key-here"

# Server Configuration
PORT=5001
NODE_ENV="development"

# Google OAuth Configuration
GOOGLE_CLIENT_ID="your-google-client-id-here"

# Email Configuration (for password reset)
EMAIL_USER="your-email@gmail.com"
EMAIL_PASS="your-app-password"

# Cloudinary Configuration (for file uploads)
CLOUDINARY_CLOUD_NAME="your-cloud-name"
CLOUDINARY_API_KEY="your-api-key"
CLOUDINARY_API_SECRET="your-api-secret"

4. Set up the database

cd backend
npx prisma generate
npx prisma db push
npx prisma db seed

5. Start the development servers

# Start backend server (from backend directory)
npm run dev

# Start frontend server (from frontend directory)
npm run dev

The application will be available at:

πŸ“ Project Structure

PlacePrep/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/     # API controllers
β”‚   β”‚   β”œβ”€β”€ middleware/      # Authentication & authorization
β”‚   β”‚   β”œβ”€β”€ routes/          # API routes
β”‚   β”‚   β”œβ”€β”€ lib/             # Utilities
β”‚   β”‚   └── server.js        # Main server file
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   β”œβ”€β”€ schema.prisma    # Database schema
β”‚   β”‚   └── migrations/      # Database migrations
β”‚   └── uploads/             # File uploads
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/           # Page components
β”‚   β”‚   β”œβ”€β”€ contexts/        # React contexts
β”‚   β”‚   └── main.jsx         # App entry point
β”‚   └── public/              # Static assets
└── README.md

πŸ”§ API Endpoints

Authentication

  • POST /api/auth/signup - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/logout - User logout
  • GET /api/auth/me - Get current user
  • POST /api/auth/forgot-password - Password reset request
  • POST /api/auth/reset-password - Reset password

Questions

  • GET /api/questions - Get all questions
  • POST /api/questions - Add new question (admin/moderator)
  • PUT /api/questions/:id - Update question
  • DELETE /api/questions/:id - Delete question

Contests

  • GET /api/testseries - Get all contests
  • POST /api/testseries - Create contest (admin/moderator)
  • GET /api/testseries/:id - Get contest details
  • POST /api/testseries/:id/join - Join contest
  • POST /api/testseries/:id/submit - Submit contest answers

Practice

  • POST /api/free-practice/start - Start practice test
  • POST /api/free-practice/:id/practice-submit - Submit practice test
  • GET /api/free-practice/student/stats - Get student statistics

Resources

  • GET /api/resources - Get all resources
  • POST /api/resources - Add resource (admin/moderator)
  • PUT /api/resources/:id - Update resource
  • DELETE /api/resources/:id - Delete resource

Notifications

  • GET /api/notifications - Get user notifications
  • PUT /api/notifications/:id/read - Mark notification as read
  • DELETE /api/notifications/:id - Delete notification

πŸ” Authentication & Authorization

The application uses JWT tokens for authentication. Users are assigned roles:

  • user: Regular students
  • moderator: Can manage questions and contests
  • admin: Full access to all features

πŸ“Š Database Schema

Core Models

  • User: Students, moderators, and admins
  • Question: MCQ questions with categories and difficulty levels
  • TestSeries: Contests with start/end times
  • Participation: User participation in contests
  • StudentActivity: User answers and performance tracking
  • Bookmark: User bookmarked questions
  • Notification: Real-time notifications
  • Resource: Study materials (PDFs, videos, MCQs)

πŸš€ Deployment

Backend Deployment

  1. Set up a PostgreSQL database
  2. Configure environment variables
  3. Run database migrations
  4. Deploy to your preferred hosting service

Frontend Deployment

  1. Build the application: npm run build
  2. Deploy the dist folder to your hosting service

πŸ› Known Issues & Fixes

Backend Issues Fixed

  1. Missing nodemon dependency - Added to devDependencies
  2. Missing cors dependency - Added to dependencies
  3. Field name inconsistency - Fixed fullname vs fullName
  4. Missing environment variables - Created env.example file
  5. Error handling improvements - Added proper error logging

Frontend Issues Fixed

  1. API endpoint mismatches - Fixed route paths
  2. Missing error handling - Added proper catch blocks
  3. Authentication flow - Improved session management

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“ License

This project is licensed under the MIT License.

πŸ†˜ Support

For support, please contact the development team or create an issue in the repository.

πŸ”„ Updates

  • v1.0.0: Initial release with core features
  • v1.1.0: Added real-time notifications
  • v1.2.0: Added resource management
  • v1.3.0: Added bookmark functionality
  • v1.4.0: Added comprehensive analytics

Note: Make sure to update the environment variables with your actual values before running the application.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages