Skip to content

SniperRavan/RECLAIMX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

171 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ReclaimX β€” Smart Campus Lost & Found

Smart. Secure. Automated.
Privacy-first campus lost & found platform with intelligent heuristic matching and fraud-proof ownership verification.

🌐 Live Demo Β Β·Β  βš™οΈ API Health Β Β·Β  πŸ“¦ Installation Β Β·Β  🀝 Contributing Β Β·Β  πŸ“‘ API

Home Page


πŸ“‘ Table of Contents


🎯 What is ReclaimX?

ReclaimX replaces the traditional campus lost & found notice board with an automated, privacy-first system. Students report lost or found items, and a custom weighted scoring engine matches them in real time based on text similarity, image presence, location overlap, and time proximity.

Key Design Goals

Goal Description
Privacy First Only the item name is publicly visible. Descriptions, photos, and verification details are encrypted and private
Fraud Prevention Ownership verified via 3 secret questions only the real owner could answer. 3 failed attempts = account suspended
Trust System Users earn Bronze β†’ Silver β†’ Gold status for successful returns
Works Offline Full PWA with service worker caching and offline submission queue

✨ Key Features

  • Real-time Matching Engine β€” Custom heuristic scoring (Jaccard similarity + location + time decay)
  • Privacy-First Design β€” Sensitive data encrypted, only item names public
  • Fraud-Proof Verification β€” 3 secret questions with server-side answer scoring
  • Trust Score System β€” Bronze β†’ Silver β†’ Gold progression with points for successful returns
  • PWA Support β€” Installable, works offline with service worker caching
  • Multi-Auth Providers β€” Email/Password, Google, GitHub via Firebase
  • Image Upload β€” Cloudinary integration for item photos
  • Multi-Campus Support β€” Island-based matching by campus_id
  • Rate Limiting β€” 100 requests/15 min per IP to prevent abuse
  • Sensitive Data Filter β€” Blocks Aadhaar, PAN, card numbers in descriptions

πŸ“Έ Screenshots

Home Page Login Page Signup Page
Home Page Login Page Signup Page
Dashboard Browse Items
Dashboard Browse
My Matches Report Lost Item
Matches Report Lost
Report Found Item Profile
Report Found Profile

πŸ“ Full-resolution screenshots live in docs/screenshots/.


πŸ›  Tech Stack

Layer Technology
Frontend Vanilla HTML5, CSS3, JavaScript (ES Modules)
PWA Service Worker + Web App Manifest
Auth Firebase Auth (Email/Password, Google, GitHub)
Backend Node.js + Express.js
Database Supabase (PostgreSQL)
Image Storage Cloudinary v2
Matching Engine Custom heuristic scoring (Jaccard similarity + location + time decay)
Security Helmet.js, express-rate-limit, Firebase ID token verification
Frontend Hosting Vercel
Backend Hosting Render

πŸ— Project Structure

RECLAIMX/
β”œβ”€β”€ frontend/ ← Deployed on Vercel (root dir: frontend/)
β”‚ β”œβ”€β”€ index.html ← Public landing page
β”‚ β”œβ”€β”€ manifest.json ← PWA manifest
β”‚ β”œβ”€β”€ service-worker.js ← Offline caching
β”‚ β”œβ”€β”€ vercel.json ← Clean URL rewrites + cache headers
β”‚ β”œβ”€β”€ .env.example ← No secrets needed for frontend
β”‚ β”‚
β”‚ β”œβ”€β”€ pages/
β”‚ β”‚ β”œβ”€β”€ login.html
β”‚ β”‚ β”œβ”€β”€ register.html
β”‚ β”‚ β”œβ”€β”€ dashboard.html ← Stats, recent activity, my reports
β”‚ β”‚ β”œβ”€β”€ browse.html ← Public browse with search/filter
β”‚ β”‚ β”œβ”€β”€ report-lost.html ← Hidden verification attributes
β”‚ β”‚ β”œβ”€β”€ report-found.html
β”‚ β”‚ β”œβ”€β”€ matches.html ← Score ring, verify claim flow
β”‚ β”‚ β”œβ”€β”€ profile.html ← Avatar, trust score, activity
β”‚ β”‚ └── 404.html
β”‚ β”‚
β”‚ β”œβ”€β”€ assets/
β”‚ β”‚ β”œβ”€β”€ css/global.css ← Full design system (dark theme)
β”‚ β”‚ β”œβ”€β”€ js/
β”‚ β”‚ β”‚ β”œβ”€β”€ main.js ← API_BASE, toast, sidebar init
β”‚ β”‚ β”‚ β”œβ”€β”€ auth-guard.js ← Back/forward button bypass (bfcache)
β”‚ β”‚ β”‚ β”œβ”€β”€ auth.js ← Session guard, token refresh
β”‚ β”‚ β”‚ β”œβ”€β”€ firebase-config.js ← Loads config from backend
β”‚ β”‚ β”‚ └── pwa.js ← SW registration, offline queue
β”‚ β”‚ └── icons/
β”‚ β”‚
β”‚ └── components/
β”‚ β”œβ”€β”€ sidebar.html ← Injected via fetch() on every page
β”‚ └── toast.html ← Rich toast with progress bar
β”‚
└── backend/ ← Deployed on Render (root dir: backend/)
β”œβ”€β”€ server.js ← Express entry point (port 5000)
β”œβ”€β”€ package.json
β”œβ”€β”€ .env ← Secrets β€” never commit
β”œβ”€β”€ .env.example
β”‚
β”œβ”€β”€ config/
β”‚ β”œβ”€β”€ firebase.js ← Firebase Admin SDK
β”‚ β”œβ”€β”€ supabase.js ← Supabase service_role client
β”‚ β”œβ”€β”€ cloudinary.js ← Cloudinary v2 + multer memoryStorage
β”‚ └── serviceAccountKey.json ← Firebase key β€” never commit
β”‚
β”œβ”€β”€ middleware/
β”‚ β”œβ”€β”€ authMiddleware.js ← Firebase token verification
β”‚ └── errorHandler.js ← Global error + 404 handler
β”‚
β”œβ”€β”€ routes/
β”‚ β”œβ”€β”€ authRoutes.js ← /api/auth/*
β”‚ β”œβ”€β”€ itemRoutes.js ← /api/items/*
β”‚ β”œβ”€β”€ matchRoutes.js ← /api/matches/*
β”‚ └── configRoutes.js ← /api/config/firebase
β”‚
β”œβ”€β”€ ai/
β”‚ └── matchingEngine.js ← Heuristic scoring engine
β”‚
└── utils/
β”œβ”€β”€ verificationEngine.js ← Ownership answer scoring
β”œβ”€β”€ sensitiveDataFilter.js ← Blocks Aadhaar, PAN, card numbers
└── emailService.js ← Resend email notifications (planned)

Quick Runtime Reference

Component Port Entry Point Hosting
Frontend 3000 (local) frontend/index.html Vercel
Backend 5000 (local) backend/server.js Render
API Root http://localhost:5000/api β€” β€”

πŸ”§ How the Matching Engine Works

When a lost or found item is submitted, the engine queries all open opposing items on the same campus with the same category, then scores each pair:

Final Score Formula

[ \text{Final Score} = (\text{Text} \times 40%) + (\text{Image} \times 30%) + (\text{Location} \times 20%) + (\text{Time} \times 10%) ]

Signal Method
Text Jaccard similarity on item name (70%) + description (30%)
Image Presence score β€” 65 if both have images, 40 if one, 20 if neither
Location Token overlap between last-seen and found locations
Time decay Linear decay over 72 hours β€” older reports score lower

A claim is created only if score β‰₯ 40 and campus + category both match exactly.

⚠️ Note: Image signal is a presence placeholder. Vector embedding similarity (MobileNet + pgvector) is planned for v2.


πŸ”’ Ownership Verification (Anti-Fraud)

After a match is created, the claimer answers 3 questions drawn from private hidden attributes:

  1. Interior colour / lining
  2. Unique marks, scratches, stickers, or engravings
  3. What the item contains

Answers checked server-side using Jaccard word similarity:

  • Score β‰₯ 60% β†’ verified
  • Below 60% β†’ strike logged
  • 3 strikes β†’ account suspended

πŸ† Trust Score System

Level Points Notes
πŸ₯‰ Bronze Helper 0–49 pts Default on signup
πŸ₯ˆ Silver Helper 50–99 pts Trusted member
πŸ₯‡ Gold Hero 100+ pts Campus hero

+10 points awarded to both parties on each successful item return.


πŸ“Š Database Schema (Supabase / PostgreSQL)

Run this SQL in your Supabase SQL Editor:

CREATE TABLE users (
  id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  firebase_uid TEXT UNIQUE NOT NULL,
  name TEXT NOT NULL,
  email TEXT UNIQUE NOT NULL,
  campus_id TEXT DEFAULT 'campus_a',
  photo TEXT DEFAULT '',
  trust_score INTEGER DEFAULT 0,
  trust_level TEXT DEFAULT 'Bronze',
  failed_claims INTEGER DEFAULT 0,
  is_suspended BOOLEAN DEFAULT false,
  created_at TIMESTAMPTZ DEFAULT NOW()
);

CREATE TABLE lost_items (
  id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  user_id UUID REFERENCES users(id),
  campus_id TEXT NOT NULL,
  item_name TEXT NOT NULL,          -- PUBLIC
  description TEXT,                 -- PRIVATE
  category TEXT,
  last_seen_location TEXT,          -- PUBLIC
  image_urls TEXT[] DEFAULT '{}',   -- PRIVATE
  hidden_color_inside TEXT,         -- PRIVATE (verification)
  hidden_unique_marks TEXT,         -- PRIVATE (verification)
  hidden_contains TEXT,             -- PRIVATE (verification)
  status TEXT DEFAULT 'Lost',       -- Lost \[|\] Pending \[|\] Resolved
  created_at TIMESTAMPTZ DEFAULT NOW()
);

CREATE TABLE found_items (
  id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  user_id UUID REFERENCES users(id),
  campus_id TEXT NOT NULL,
  item_name TEXT NOT NULL,          -- PUBLIC
  description TEXT,                 -- PRIVATE
  category TEXT,
  found_location TEXT,              -- PUBLIC
  image_url TEXT DEFAULT '',        -- PRIVATE
  status TEXT DEFAULT 'Found',      -- Found \[|\] Resolved
  created_at TIMESTAMPTZ DEFAULT NOW()
);

CREATE TABLE claims (
  id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  lost_item_id UUID REFERENCES lost_items(id),
  found_item_id UUID REFERENCES found_items(id),
  claimant_id UUID REFERENCES users(id),
  match_score FLOAT DEFAULT 0,
  answer_1 TEXT, answer_2 TEXT, answer_3 TEXT,
  verification_score FLOAT DEFAULT 0,
  loster_confirmed BOOLEAN DEFAULT false,
  founder_confirmed BOOLEAN DEFAULT false,
  status TEXT DEFAULT 'Pending',    -- Pending \[|\] Verified \[|\] Rejected \[|\] Resolved
  created_at TIMESTAMPTZ DEFAULT NOW()
);

⚠️ Use the service_role key in your backend .env, not the anon key. The anon key will be blocked by Row Level Security.


πŸ“‘ API Reference

Base URL: https://reclaimx.onrender.com/api (production) or http://localhost:5000/api (local)

Auth β€” /api/auth

Method Endpoint Auth Description
POST /session β€” Verify Firebase token + upsert user
GET /me βœ… Get current user profile
PUT /profile βœ… Update display name / clear photo
POST /avatar βœ… Upload profile photo to Cloudinary
POST /forgot-password β€” Send Firebase password reset email

Items β€” /api/items

Method Endpoint Auth Description
GET / β€” Browse open lost & found items
GET /me βœ… Get current user's reports
POST /lost βœ… Report a lost item (triggers matching)
POST /found βœ… Report a found item (triggers matching)
DELETE /lost/:id βœ… Delete own lost report
DELETE /found/:id βœ… Delete own found report

Matches β€” /api/matches

Method Endpoint Auth Description
GET / βœ… Get all claims for current user
POST /verify βœ… Submit ownership verification answers
POST /confirm-handover/:id βœ… Confirm physical handover
POST /dismiss/:id βœ… Dismiss a match

Config & Health

Method Endpoint Auth Description
GET /api/config/firebase β€” Firebase client config (safe to expose)
GET /api/health β€” Server health check

πŸ§ͺ Complete cURL Examples

1. Verify Firebase Token & Create Session

curl -X POST https://reclaimx.onrender.com/api/auth/session \
  -H "Content-Type: application/json" \
  -d '{
    "firebaseToken": "YOUR_FIREBASE_ID_TOKEN_HERE"
  }'

Response:

{
  "success": true,
  "user": {
    "id": "uuid-here",
    "firebase_uid": "firebase-uid",
    "name": "John Doe",
    "email": "john@example.com",
    "campus_id": "campus_a",
    "trust_score": 0,
    "trust_level": "Bronze"
  }
}

2. Get Current User Profile

curl -X GET https://reclaimx.onrender.com/api/auth/me \
  -H "Authorization: Bearer YOUR_FIREBASE_ID_TOKEN_HERE"

Response:

{
  "success": true,
  "user": {
    "id": "uuid-here",
    "firebase_uid": "firebase-uid",
    "name": "John Doe",
    "email": "john@example.com",
    "campus_id": "campus_a",
    "photo": "",
    "trust_score": 10,
    "trust_level": "Bronze",
    "failed_claims": 0,
    "is_suspended": false
  }
}

3. Report a Lost Item

curl -X POST https://reclaimx.onrender.com/api/items/lost \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_FIREBASE_ID_TOKEN_HERE" \
  -d '{
    "campus_id": "campus_a",
    "item_name": "iPhone 13 Pro",
    "description": "Midnight green, 128GB, has a crack on the back",
    "category": "Electronics",
    "last_seen_location": "Library Floor 2",
    "hidden_color_inside": "Black leather lining",
    "hidden_unique_marks": "Crack on back near camera, Apple sticker on case",
    "hidden_contains": "AirPods Pro case, USB-C cable, phone manual"
  }'

Response:

{
  "success": true,
  "message": "Lost item reported successfully",
  "item": {
    "id": "uuid-here",
    "user_id": "uuid-here",
    "campus_id": "campus_a",
    "item_name": "iPhone 13 Pro",
    "category": "Electronics",
    "last_seen_location": "Library Floor 2",
    "status": "Lost",
    "created_at": "2026-06-04T11:00:00.000Z"
  },
  "matches_found": 1,
  "matches": [
    {
      "claim_id": "claim-uuid",
      "found_item_id": "found-uuid",
      "match_score": 67.5,
      "founder_name": "Jane Smith"
    }
  ]
}

4. Report a Found Item

curl -X POST https://reclaimx.onrender.com/api/items/found \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_FIREBASE_ID_TOKEN_HERE" \
  -d '{
    "campus_id": "campus_a",
    "item_name": "iPhone 13 Pro",
    "description": "Found near library, midnight green color",
    "category": "Electronics",
    "found_location": "Library Floor 2"
  }'

Response:

{
  "success": true,
  "message": "Found item reported successfully",
  "item": {
    "id": "uuid-here",
    "user_id": "uuid-here",
    "campus_id": "campus_a",
    "item_name": "iPhone 13 Pro",
    "category": "Electronics",
    "found_location": "Library Floor 2",
    "status": "Found",
    "created_at": "2026-06-04T11:00:00.000Z"
  },
  "matches_found": 1,
  "matches": [
    {
      "claim_id": "claim-uuid",
      "lost_item_id": "lost-uuid",
      "match_score": 67.5,
      "loster_name": "John Doe"
    }
  ]
}

5. Browse All Open Items

curl -X GET "https://reclaimx.onrender.com/api/items?campus_id=campus_a&category=Electronics"

Response:

{
  "success": true,
  "items": [
    {
      "id": "uuid-1",
      "item_name": "iPhone 13 Pro",
      "category": "Electronics",
      "last_seen_location": "Library Floor 2",
      "status": "Lost",
      "created_at": "2026-06-04T10:00:00.000Z",
      "has_image": true
    },
    {
      "id": "uuid-2",
      "item_name": "iPhone 13 Pro",
      "category": "Electronics",
      "found_location": "Library Floor 2",
      "status": "Found",
      "created_at": "2026-06-04T11:00:00.000Z",
      "has_image": false
    }
  ],
  "total": 2
}

6. Submit Ownership Verification Answers

curl -X POST https://reclaimx.onrender.com/api/matches/verify \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_FIREBASE_ID_TOKEN_HERE" \
  -d '{
    "claim_id": "claim-uuid-here",
    "answer_1": "Black leather lining",
    "answer_2": "Crack on back near camera, Apple sticker",
    "answer_3": "AirPods Pro case and USB-C cable"
  }'

Response (Verified):

{
  "success": true,
  "message": "Ownership verified successfully",
  "claim": {
    "id": "claim-uuid",
    "verification_score": 78.5,
    "status": "Verified"
  },
  "trust_score_updated": {
    "previous": 10,
    "current": 20
  }
}

Response (Not Verified):

{
  "success": false,
  "message": "Verification failed β€” answers do not match",
  "claim": {
    "id": "claim-uuid",
    "verification_score": 45.2,
    "status": "Pending",
    "failed_attempts": 1,
    "remaining_attempts": 2
  }
}

7. Confirm Physical Handover

curl -X POST https://reclaimx.onrender.com/api/matches/confirm-handover/claim-uuid-here \
  -H "Authorization: Bearer YOUR_FIREBASE_ID_TOKEN_HERE"

Response:

{
  "success": true,
  "message": "Handover confirmed β€” both parties rewarded",
  "claim": {
    "id": "claim-uuid",
    "status": "Resolved",
    "loster_confirmed": true,
    "founder_confirmed": true
  },
  "trust_score_updates": {
    "loster": {
      "previous": 10,
      "current": 20
    },
    "founder": {
      "previous": 15,
      "current": 25
    }
  }
}

8. Dismiss a Match

curl -X POST https://reclaimx.onrender.com/api/matches/dismiss/claim-uuid-here \
  -H "Authorization: Bearer YOUR_FIREBASE_ID_TOKEN_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Not my item"
  }'

Response:

{
  "success": true,
  "message": "Match dismissed successfully",
  "claim": {
    "id": "claim-uuid",
    "status": "Rejected"
  }
}

9. Get All Your Claims

curl -X GET https://reclaimx.onrender.com/api/matches \
  -H "Authorization: Bearer YOUR_FIREBASE_ID_TOKEN_HERE"

Response:

{
  "success": true,
  "claims": [
    {
      "id": "claim-uuid",
      "lost_item_id": "lost-uuid",
      "found_item_id": "found-uuid",
      "match_score": 67.5,
      "verification_score": 78.5,
      "status": "Pending",
      "item_name": "iPhone 13 Pro",
      "category": "Electronics",
      "created_at": "2026-06-04T11:00:00.000Z"
    }
  ],
  "total": 1
}

10. Update Profile Name

curl -X PUT https://reclaimx.onrender.com/api/auth/profile \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_FIREBASE_ID_TOKEN_HERE" \
  -d '{
    "name": "John Doe Updated"
  }'

Response:

{
  "success": true,
  "message": "Profile updated successfully",
  "user": {
    "id": "uuid-here",
    "name": "John Doe Updated",
    "email": "john@example.com"
  }
}

11. Health Check

curl -X GET https://reclaimx.onrender.com/api/health

Response:

{
  "status": "ok",
  "timestamp": "2026-06-04T11:30:00.000Z",
  "uptime": 86400,
  "database": "connected",
  "firebase": "connected",
  "cloudinary": "connected"
}

12. Get Firebase Client Config (Public)

curl -X GET https://reclaimx.onrender.com/api/config/firebase

Response:

{
  "success": true,
  "firebaseConfig": {
    "apiKey": "AIza...",
    "authDomain": "reclaimx.firebaseapp.com",
    "projectId": "reclaimx",
    "storageBucket": "reclaimx.appspot.com",
    "messagingSenderId": "123456789",
    "appId": "1:123456789:web:abc123"
  }
}

πŸ“¦ Getting Started

Prerequisites

  • Node.js β‰₯ 18
  • npm or yarn
  • Firebase project (Email/Password + Google + GitHub auth enabled)
  • Supabase project
  • Cloudinary account

1. Clone & Install

git clone https://github.com/SniperRavan/RECLAIMX.git
cd RECLAIMX

2. Backend Setup

cd backend
npm install
cp .env.example .env

3. Configure Environment Variables

Edit backend/.env and fill in these values:

# Server
PORT=5000
NODE_ENV=development

# Firebase Admin SDK
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_CLIENT_EMAIL=your-service-account-email@your-project.iam.gserviceaccount.com
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"

# Supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key

# Cloudinary
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret

# CORS (optional)
CORS_ORIGIN=http://localhost:3000

⚠️ Never commit .env or serviceAccountKey.json β€” they're in .gitignore.

4. Firebase Admin Key

  1. Go to Firebase Console β†’ Project Settings β†’ Service Accounts
  2. Click Generate New Private Key
  3. Save as backend/config/serviceAccountKey.json

5. Apply Supabase Schema

  1. Open your Supabase project's SQL Editor
  2. Paste the full Database Schema SQL from above
  3. Click Run

6. Run Locally

Terminal 1 β€” Backend (port 5000):

cd backend
npm run dev

Terminal 2 β€” Frontend (port 3000):

cd frontend
npx serve . -l 3000

Open http://localhost:3000 in your browser.


πŸš€ Deployment

Vercel (Frontend)

  1. Go to Vercel
  2. Import your repo
  3. Settings:
    • Framework Preset: Other
    • Root Directory: frontend
    • Build Command: (leave empty)
    • Output Directory: .
  4. No environment variables needed for frontend
  5. Deploy

Render (Backend)

  1. Go to Render
  2. New Web Service
  3. Settings:
    • Root Directory: backend
    • Start Command: node server.js
    • Environment:
      PORT=5000
      NODE_ENV=production
      FIREBASE_PROJECT_ID=your-project-id
      FIREBASE_CLIENT_EMAIL=your-service-account-email@your-project.iam.gserviceaccount.com
      FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
      SUPABASE_URL=https://your-project.supabase.co
      SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
      CLOUDINARY_CLOUD_NAME=your-cloud-name
      CLOUDINARY_API_KEY=your-api-key
      CLOUDINARY_API_SECRET=your-api-secret
      CORS_ORIGIN=https://reclaimx-chi.vercel.app
      
  4. Deploy

πŸ” Security

Measure Description
Secrets Management All secrets in backend/.env β€” never in frontend HTML
Firebase Config Served from backend endpoint β€” safe public config, not admin keys
Sensitive Data Filter Blocks Aadhaar, PAN, card numbers in descriptions
Security Headers Helmet.js sets strict headers on all responses
Rate Limiting 100 requests / 15 min per IP (trust proxy enabled for Render)
Token Verification Firebase ID token verified server-side on every protected route
Database Access Supabase service role key is backend-only only
File Ignored .env, serviceAccountKey.json in .gitignore

Secret Rotation Best Practices

  • Rotate Firebase private key every 90 days
  • Rotate Supabase service role key if compromised
  • Use Render/Vercel secret management (not plain .env in prod)
  • Enable secret scanning in GitHub repo settings

πŸ§ͺ Testing & CI

Running Tests (Current Status)

⚠️ Tests are not yet implemented β€” this is a TODO for v1.1.

Planned Testing Stack

  • Backend: Jest + Supertest for API endpoint tests
  • Frontend: Vitest + Testing Library for component tests
  • E2E: Playwright for critical user flows (login β†’ report β†’ match β†’ verify)

How to Add Tests (Contributor Guide)

  1. Install dev dependencies:
    cd backend
    npm install --save-dev jest supertest
  2. Create backend/tests/api.test.js
  3. Add test:
    const request = require('supertest');
    const app = require('../server');
    
    describe('GET /api/health', () => {
      it('should return 200 OK', async () => {
        const response = await request(app).get('/api/health');
        expect(response.status).toBe(200);
        expect(response.body.status).toBe('ok');
      });
    });
  4. Run: npm test

CI Pipeline (Planned β€” GitHub Actions)

Create .github/workflows/ci.yml:

name: CI

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '18'
      - run: cd backend && npm install
      - run: cd backend && npm test
      - run: cd backend && npm run lint

πŸ—Ί Roadmap

Priority Feature Status Target
πŸ”΄ High Image similarity via vector embeddings (MobileNet + pgvector) ❌ Todo v2.0
πŸ”΄ High Full Supabase RLS policies ❌ Todo v1.1
🟑 Medium Email notifications on match creation (Resend integration) ❌ Todo v1.2
🟑 Medium Verification modal UI in matches.html ❌ Todo v1.1
🟑 Medium Admin dashboard for campus coordinators ❌ Todo v2.0
🟒 Low Mobile app (React Native / Flutter) ❌ Todo v3.0
🟒 Low Accessibility improvements (WCAG 2.1 AA) ❌ Todo v1.2
🟒 Low Multi-language support (English + Hindi) ❌ Todo v2.0

πŸ‘₯ Team

Role Name GitHub
Lead Developer Sniper Ravan @SniperRavan
Team Member Member 2 Add GitHub
Team Member Member 3 Add GitHub
  • Institution: Private Institute
  • Project Type: Final Year Project
  • Supervisor: [Add Supervisor Name]

🀝 Contributing

We welcome contributions! This section explains how to get started, our workflow, and expectations.

How to Contribute

  1. Fork the repository

    • Click Fork at the top-right of the repo page
    • You'll get https://github.com/YOUR_USERNAME/RECLAIMX.git
  2. Clone your fork

    git clone https://github.com/YOUR_USERNAME/RECLAIMX.git
    cd RECLAIMX
  3. Add upstream remote

    git remote add upstream https://github.com/SniperRavan/RECLAIMX.git
  4. Create a feature branch

    git checkout -b feature/your-feature-name

    Branch naming convention:

    • feature/add-dark-mode-toggle
    • fix/resolve-login-bug
    • docs/update-api-reference
    • test/add-backend-tests
  5. Make your changes

    • Follow existing code style
    • Add comments for complex logic
    • Update documentation if needed
  6. Test your changes

    cd backend
    npm run lint
    # TODO: npm test (once tests are added)
  7. Commit your changes

    git add .
    git commit -m "feat: add dark mode toggle button"

    Commit message convention (Conventional Commits):

    • feat: β€” New feature
    • fix: β€” Bug fix
    • docs: β€” Documentation changes
    • style: β€” Code style (formatting, semicolons)
    • refactor: β€” Code refactoring (no feature change)
    • test: β€” Adding tests
    • chore: β€” Maintenance (deps, build tools)
  8. Sync with upstream (before pushing)

    git fetch upstream
    git rebase upstream/main
  9. Push to your fork

    git push origin feature/your-feature-name
  10. Open a Pull Request

    • Go to your fork on GitHub
    • Click Compare & pull request
    • Select base repository: SniperRavan/RECLAIMX
    • Select base branch: main
    • Fill in the PR template below

Pull Request Template

Copy this into your PR description:

## Description
<!-- Briefly describe what this PR does -->

## Related Issue
<!-- Link to issue number if applicable -->
Closes #123

## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update

## Testing Done
<!-- Describe how you tested this -->
- [ ] Local testing completed
- [ ] Screenshots attached (if UI change)
- [ ] New tests added (if applicable)

## Checklist
- [ ] My code follows the project's style guidelines
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All new and existing tests passed

Code Style Guidelines

  • Frontend: Vanilla JS, ES Modules, no frameworks
  • Backend: Express.js, async/await, error handling
  • Naming:
    • Variables: camelCase
    • Constants: UPPER_SNAKE_CASE
    • Files: kebab-case.html, kebab-case.js
  • Comments: JSDoc for functions, inline comments for complex logic
  • Indentation: 2 spaces (HTML, CSS, JS)
  • Quotes: Single quotes ' for JS, double quotes " for JSON

Code of Conduct

  • Be respectful and inclusive
  • Provide constructive feedback
  • Accept constructive criticism
  • Focus on what's best for the community

Getting Help

  • Open an issue for bugs or questions
  • Tag issues with appropriate labels (bug, enhancement, question)
  • Join discussions in GitHub Discussions tab

Review Process

  1. Maintainer reviews your PR within 3–5 business days
  2. Feedback may be given β€” address comments and push updates
  3. Once approved, PR is merged into main
  4. Your contribution is credited in CONTRIBUTORS.md

πŸ“„ License

MIT License β€” see LICENSE for full text.

Brief summary: You're free to use, modify, and distribute this project for any purpose, including commercial use, as long as you include the original copyright notice and license text.


πŸ™ Acknowledgments

  • Firebase for authentication
  • Supabase for database
  • Cloudinary for image storage
  • Vercel & Render for hosting
  • MIT License for open-source freedom

Built with ❀️ by Sniper Ravan and team
GitHub Β· Live Demo Β· Contribute

Releases

No releases published

Packages

 
 
 

Contributors