Skip to content

imtia33/ClassRep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ ClassRep

ClassRep is a comprehensive education platform designed to streamline classroom management, communication, and resource allocation for students and class representatives (CRs) in educational institutions.

Next.js React Appwrite Tailwind CSS


🌟 Features

πŸ‘€ Authentication & User Management

  • Email/Password Authentication with secure password hashing
  • Google OAuth Integration for seamless sign-in
  • Email Verification system with automatic link generation
  • Password Reset functionality with secure token-based recovery
  • Automatic CR Label Assignment - Students matching CR database entries are automatically assigned CR roles
  • Role-Based Access Control (Student/CR/Admin permissions)

πŸ“’ Announcement System

  • Course-Based Channels - Dedicated communication channels for each course
  • Join Request Management - Students can request to join channels, CRs approve/reject
  • Real-Time Announcements - CRs can post announcements to their channels
  • File Attachments - Support for sharing files with announcements (coming soon)
  • Channel Administration - CRs can manage their course channels
  • Multi-Section Support - Channels organized by section and department

🏫 Classroom Management

  • Empty Room Finder - Real-time detection of available classrooms/labs
  • Gender-Specific Schedules - Automatic schedule detection based on user section
  • Building Selection - Filter rooms by building (Main, Annex, etc.)
  • Room Booking System (CR Only) - CRs can book empty rooms for their sections
  • My Bookings (CR Only) - View and manage booked classrooms
  • Time Slot Management - Period-based room availability checking

πŸ“… Academic Tools

  • Class Routine Viewer - Display weekly class schedules
  • Teacher Information - Access teacher contact details and office hours
  • Section-Based Content - Personalized content based on user's section and department
  • Course Management - Organized by course codes and departments

🎨 User Experience

  • Dark/Light Theme Toggle - Seamless theme switching with persistence
  • Responsive Design - Mobile-first approach, works on all devices
  • Modern UI Components - Built with Radix UI primitives
  • Smooth Animations - Framer Motion & GSAP for delightful interactions
  • Sidebar Navigation - Collapsible sidebar with dynamic menu items
  • Breadcrumb Navigation - Clear navigation hierarchy

πŸš€ Tech Stack

Frontend

Backend

  • BaaS: Appwrite (Client & Server SDKs)
    • Authentication (Email/Password, OAuth)
    • Database (TablesDB)
    • Storage
    • Functions
    • Real-time subscriptions

Developer Tools

  • Language: TypeScript 5
  • Package Manager: npm
  • Linting: ESLint
  • Build Tool: Next.js built-in compiler

πŸ“¦ Installation

Prerequisites

  • Node.js 18+ and npm
  • An Appwrite instance (Cloud or Self-hosted)
  • Appwrite project with configured database and tables

1. Clone the Repository

git clone https://github.com/yourusername/classrep.git
cd classrep

2. Install Dependencies

npm install

3. Environment Setup

Create a .env.local file in the root directory:

# Appwrite Configuration (Public)
NEXT_PUBLIC_ENDPOINT=https://fra.cloud.appwrite.io/v1
NEXT_PUBLIC_PROJECTID=your_project_id
NEXT_PUBLIC_DATABASE_ID=your_database_id
NEXT_PUBLIC_STUDENTS=students
NEXT_PUBLIC_CLASS_ROOMS=class_rooms
NEXT_PUBLIC_LAB_ROOMS=lab_rooms
NEXT_PUBLIC_MALE_TEACHERS=male_teachers
NEXT_PUBLIC_FEMALE_TEACHERS=female_teachers
NEXT_PUBLIC_MALE_CR=male_cr
NEXT_PUBLIC_FEMALE_CR=female_cr
NEXT_PUBLIC_ROUTINE_TABLE=routine

# Appwrite Server-Side API Key (Secret - NEVER commit)
# Required for API routes: assign-cr-label and leave-channel
# Get this from Appwrite Console: Settings > API Keys
# Ensure the key has Users.read, Users.write, and Databases permissions
APPWRITE_API_KEY=your_appwrite_api_key_here

4. Appwrite Database Setup

Create the following tables in your Appwrite database:

Tables

  1. students - User profile data

    • name (string)
    • section (string) - Format: 5FM (Semester + Section + Gender)
    • dept (string)
    • studentID (string)
  2. class_rooms - Classroom data

  3. lab_rooms - Laboratory data

  4. male_teachers & female_teachers - Teacher information

  5. male_cr & female_cr - CR registry for auto-labeling

  6. routine - Class schedule data

  7. channels - Announcement channels

  8. join_request - Channel join requests

  9. joined_channels - User-channel memberships

  10. announcements - Channel announcements

User Labels

Configure the following labels in Appwrite Users:

  • MCR - Male Class Representative
  • FCR - Female Class Representative
  • MACR - Male Assistant Class Representative
  • FACR - Female Assistant Class Representative

5. Run the Development Server

npm run dev

Visit http://localhost:3000

6. Build for Production

npm run build
npm start

πŸ“ Project Structure

ClassRep/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ dashboard/                # Main dashboard page
β”‚   β”œβ”€β”€ login/                    # Login page
β”‚   β”œβ”€β”€ sign-up/                  # Registration page
β”‚   β”œβ”€β”€ forgot-password/          # Password reset request
β”‚   β”œβ”€β”€ reset-password/           # Password reset confirmation
β”‚   β”œβ”€β”€ verify-email/             # Email verification
β”‚   β”œβ”€β”€ oauth/callback/           # OAuth callback handler
β”‚   β”œβ”€β”€ api/                      # API Routes
β”‚   β”‚   β”œβ”€β”€ assign-cr-label/      # CR label assignment API
β”‚   β”‚   └── leave-channel/        # Leave channel API
β”‚   β”œβ”€β”€ layout.jsx                # Root layout with providers
β”‚   β”œβ”€β”€ page.jsx                  # Landing page
β”‚   └── globals.css               # Global styles
β”‚
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ Announcement/             # Announcement system
β”‚   β”‚   β”œβ”€β”€ ChannelChat.jsx       # Channel messaging interface
β”‚   β”‚   β”œβ”€β”€ ChannelsList.jsx      # Available channels list
β”‚   β”‚   └── JoinRequestManager.jsx # CR join request management
β”‚   β”œβ”€β”€ Classroom/                # Classroom features
β”‚   β”‚   β”œβ”€β”€ EmptyRoomFinder.jsx   # Find empty rooms
β”‚   β”‚   β”œβ”€β”€ MyBookings.jsx        # CR booking management
β”‚   β”‚   β”œβ”€β”€ routine.jsx           # Class schedule viewer
β”‚   β”‚   β”œβ”€β”€ TeacherInfo.jsx       # Teacher directory
β”‚   β”‚   └── AddClassForm.jsx      # Add class utility
β”‚   β”œβ”€β”€ Dashboard/                # Dashboard components
β”‚   β”‚   β”œβ”€β”€ app-sidebar.jsx       # Main navigation sidebar
β”‚   β”‚   β”œβ”€β”€ nav-main.jsx          # Primary navigation
β”‚   β”‚   β”œβ”€β”€ nav-secondary.jsx     # Secondary navigation
β”‚   β”‚   └── nav-user.jsx          # User profile menu
β”‚   β”œβ”€β”€ auth/                     # Authentication forms
β”‚   β”‚   β”œβ”€β”€ login.jsx             # Login form component
β”‚   β”‚   └── sign-up.jsx           # Registration form
β”‚   β”œβ”€β”€ landingPage/              # Marketing site components
β”‚   β”‚   β”œβ”€β”€ hero.jsx              # Hero section
β”‚   β”‚   β”œβ”€β”€ features.jsx          # Features showcase
β”‚   β”‚   β”œβ”€β”€ cta.jsx               # Call-to-action
β”‚   β”‚   └── testimonials.jsx      # User testimonials
β”‚   β”œβ”€β”€ ui/                       # Reusable UI components (Radix UI)
β”‚   β”œβ”€β”€ AnimatedComponents/       # Animation components
β”‚   β”œβ”€β”€ background/               # Background effects
β”‚   β”œβ”€β”€ AuthWrapper.jsx           # Auth state wrapper
β”‚   └── theme-provider.tsx        # Theme context provider
β”‚
β”œβ”€β”€ appwrite/
β”‚   β”œβ”€β”€ appwrite.js               # Appwrite client & functions
β”‚   └── appwriteContext.js        # Global auth context
β”‚
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ crLabelUtils.js           # CR label assignment logic
β”‚   β”œβ”€β”€ utils.ts                  # Utility functions
β”‚   └── fonts.ts                  # Font configurations
β”‚
β”œβ”€β”€ hooks/                        # Custom React hooks
β”œβ”€β”€ public/                       # Static assets
β”œβ”€β”€ styles/                       # Additional styles
β”œβ”€β”€ .env.local.example            # Environment template
β”œβ”€β”€ components.json               # Shadcn UI config
β”œβ”€β”€ next.config.mjs               # Next.js configuration
β”œβ”€β”€ tailwind.config.js            # Tailwind configuration
β”œβ”€β”€ tsconfig.json                 # TypeScript configuration
└── package.json                  # Dependencies & scripts

πŸ”‘ Key Features Explained

CR Label Auto-Assignment

When a user signs up or authenticates via OAuth, the system automatically:

  1. Checks if their email matches an entry in the CR database tables
  2. Assigns appropriate CR label (MCR, FCR, MACR, FACR) via Appwrite API
  3. Updates user session to reflect new permissions
  4. Grants access to CR-only features (room booking, join request management)

Implementation: lib/crLabelUtils.js + app/api/assign-cr-label/route.js

Channel System

  • Students: Browse available channels, request to join, view announcements
  • CRs: Create channels, approve/reject join requests, post announcements, manage members
  • Features: Course-based organization, section-specific content, admin controls

Room Booking System

CRs can:

  • Search for empty rooms by building, time slot, and room type
  • View real-time availability based on routine data
  • Book rooms for their section
  • View and manage their bookings
  • Gender-specific schedule handling (Male/Female timings)

Authentication Flow

User Sign Up
    ↓
Email Verification Sent
    ↓
User Clicks Verification Link
    ↓
Email Verified β†’ Check CR Status
    ↓
Auto-Assign CR Label (if eligible)
    ↓
Redirect to Dashboard

πŸ” Security Features

  • βœ… Secure Password Storage - Handled by Appwrite
  • βœ… Email Verification - Required before dashboard access
  • βœ… Token-Based Password Reset - Secure recovery flow
  • βœ… OAuth 2.0 - Google authentication
  • βœ… API Key Protection - Server-side only API keys
  • βœ… Role-Based Permissions - Appwrite permissions & labels
  • βœ… Session Management - Secure HTTP-only cookies
  • βœ… CSRF Protection - Built into Next.js

🎨 UI Components

All UI components are built using:

  • Radix UI Primitives - Accessible, unstyled components
  • Tailwind CSS - Utility-first styling
  • CVA (Class Variance Authority) - Type-safe component variants
  • Custom Animations - Framer Motion & GSAP

Component Library includes:

  • Forms, Inputs, Selects, Textareas
  • Buttons, Button Groups
  • Cards, Dialogs, Sheets, Drawers
  • Tables, Tabs, Accordions
  • Toast Notifications, Alerts
  • Dropdowns, Popovers, Tooltips
  • Navigation Menus, Breadcrumbs
  • Progress Bars, Spinners, Skeletons
  • And 40+ more components!

πŸ“ Scripts

# Development
npm run dev          # Start development server

# Production
npm run build        # Build for production
npm start            # Start production server

# Code Quality
npm run lint         # Run ESLint

🌐 Deployment

Appwrite (Recommended)

  1. Push your code to GitHub
  2. Import project to Appwrite
  3. Add environment variables in Appwrite dashboard
  4. Deploy automatically on every push

Other Platforms

  • Netlify: Configure build command as npm run build
  • Railway: Add environment variables and deploy
  • Docker: Create Dockerfile with Node.js 18+ base image

Important: Ensure all environment variables are set in your deployment platform!


🀝 Contributing

Contributions are welcome! Please follow these steps:

  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

Development Guidelines

  • Follow the existing code style
  • Write meaningful commit messages
  • Test your changes thoroughly
  • Update documentation as needed

πŸ› Known Issues & Roadmap

Current Limitations

  • File attachment support in announcements (planned)
  • Mobile app version (future consideration)
  • Email notifications for announcements (planned)

Upcoming Features

  • πŸ“± Push notifications
  • πŸ“Ž File sharing in announcements
  • πŸ“Š Analytics dashboard for CRs
  • πŸ”” Real-time notification system
  • πŸ“… Calendar integration
  • πŸŽ“ Attendance tracking

πŸ“„ License

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


πŸ‘₯ Authors

ClassRep Team


πŸ™ Acknowledgments

  • Appwrite - Backend as a Service and Hosting
  • Radix UI - UI Primitives
  • Shadcn UI - Component inspiration
  • All open-source contributors

πŸ“ž Support

For support and questions:


πŸ”— Links


Made with ❀️ by the Core3 Devs

⭐ Star this repo if you find it helpful!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors