Thank you for your interest in contributing to ClassHub. This document outlines the process for proposing changes, setting up your development environment, and submitting pull requests.
Please read our Code of conduct before participating.
- Project overview and scope
- Getting started
- Development workflow
- Coding standards
- Database and security rules
- Testing requirements
- Commit message conventions
- Submitting a pull request
- Out-of-scope features
ClassHub is a multi-tenant academic progressive web application built for college sections. It coordinates class schedules, subject attendance tracking, assignments, announcements, and polls under section-level access control.
- Stack: React 19, TypeScript (Strict), Vite 8, Tailwind CSS v3, Supabase (PostgreSQL 15, Auth, Storage, Edge Functions), TanStack Query v5, Zustand v5, Vitest 4.
- Repository: github.com/Hanu2908/ClassHub
- Node.js 18 or higher
- npm 9 or higher
- Git
-
Fork the repository on GitHub and clone your fork locally:
git clone https://github.com/<your-username>/ClassHub.git cd ClassHub
-
Add the upstream remote:
git remote add upstream https://github.com/Hanu2908/ClassHub.git
-
Install project dependencies:
npm install
-
Set up local environment variables:
cp .env.example .env
Fill in your Supabase project URL, anonymous public key, and VAPID key in
.env. -
(Optional) Run local Supabase database stack:
supabase start # Starts local Postgres, Auth, Storage, and Studio supabase db reset # Applies all migrations and seeds deterministic Section P2 data from supabase/seed.sql
For detailed database architecture and seeding documentation, refer to docs/backend.md.
-
Start the Vite development server:
npm run dev
-
Ensure your local
mainbranch is synchronized with upstream:git checkout main git pull upstream main
-
Create a dedicated feature or fix branch from
main:git checkout -b feat/attendance-export-filters # or git checkout -b fix/poll-vote-duplicate-toast -
Make your changes and run verification scripts locally:
npm run lint # Runs ESLint checks across source code npm test # Runs Vitest unit and integration suites npm run build # Compiles TypeScript and builds production assets
- Enable TypeScript strict mode at all times. Do not use
anytypes. - Define explicit interfaces and types for component props, data models, and API responses.
- Place shared types in
src/types/or co-located utility type files.
- Use functional components with React hooks.
- Server state: Use TanStack Query (
useQuery,useMutation). Always invalidate relevant queries on mutation success. - Client and UI state: Use Zustand stores (
src/store/appStore.ts) for modal states, local drafts, or transient filters. - Form validation: Use React Hook Form with Zod schemas where complex validation is required.
- Use Tailwind CSS utility classes defined in
tailwind.config.js. - Use the shared design system variables (
var(--border-default),var(--text-primary),var(--font-display)). - Support dark-mode aesthetics consistently across all components.
All contributors must adhere to the following non-negotiable security requirements:
- Row-Level Security (RLS): Every new database table must have Row-Level Security enabled with explicit policies for SELECT, INSERT, UPDATE, and DELETE.
- Section tenant isolation: Every table containing section data must include a
section_idforeign key. Application queries on these tables must explicitly filter bysection_id. - Domain restriction: Only
@skit.ac.inGoogle Workspace accounts are permitted to authenticate. - Zero ERP credentials: Never build features that request, scrape, or store student or faculty ERP passwords.
- Vote integrity: Anonymous polls must never store
student_idin general vote records. Use the databasecalculate_anonymous_tokenfunction for one-way voter tokens. - Migrations: Database schema changes must be submitted as SQL migration files under
supabase/migrations/with UTC timestamp prefixes.
ClassHub relies on Vitest and React Testing Library to prevent regressions:
- Add unit tests for calculation algorithms, parsing logic, and permission helpers in
tests/unit/. - Add integration tests for composite UI workflows in
tests/integration/. - Run the full test suite before committing:
npm test -- --run - All 210+ tests must pass before submitting a pull request.
ClassHub follows the Conventional Commits specification. Keep commit subject lines under 60 characters and write in the imperative mood.
feat: A new feature or capabilityfix: A bug fixrefactor: Code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding or correcting testsdocs: Documentation changeschore: Maintenance tasks, dependency updates, or configuration changes
feat(attendance): add WhatsApp plain-text report exportfix(polls): resolve double-vote state on slow networkdocs(readme): update role workspaces and schema diagram
-
Push your branch to your GitHub fork:
git push origin feat/attendance-export-filters
-
Open a pull request against the
mainbranch ofHanu2908/ClassHub. -
Fill out the pull request template completely.
-
Link the relevant issue number in the PR description (such as
Fixes #42). -
Ensure continuous integration checks (lint, build, test) pass in GitHub Actions.
-
Respond to code review feedback promptly.
To maintain focus and security, the following features are explicitly out of scope for ClassHub:
- Automated ERP scraping or credential vaults
- Public unrestricted file drops or community file dumps
- Anonymous grievance boards without section accountability
- Generic chat applications replacing existing messaging channels
Thank you for helping build ClassHub for the college community.