Inspiration
Every semester on a college campus, students buy expensive textbooks, lab coats, mini-drafters, Arduino kits, and scientific calculators—only for those items to gather dust in hostel rooms once exams end. Meanwhile, incoming juniors spend full retail price on the exact same resources because there is no dedicated, campus-trusted way to pass them on. Existing general marketplaces aren't built around engineering branches, semesters, or safe on-campus handovers, which inspired us to build CampusCycle.
What it does
CampusCycle is a college peer-to-peer academic resource exchange platform where students can buy, sell, lend, or donate textbooks, lab gear, engineering tools, and stationery within their campus community.
- Academic Catalog & Filtering: Students search and filter resources by branch (
CSE,IT,ECE,EEE,ME,CE,Other), semester (1–8), category, condition, exchange type (Sell,Lend,Donate), and price. - Request & Atomic Reservation Workflow: Borrowers submit requests, and when an owner accepts, the item is atomically reserved while competing pending requests are automatically declined.
- Campus Pickup Coordination: Both parties schedule a meetup at familiar campus locations (
College Library,Canteen,Department Office,Main Gate,Hostel Courtyard) with date, time, and notes. - Dual-Confirmed Handover Tracker: Tracks each exchange from
Requested→Accepted→Reserved→Pickup Scheduled→Handed Over→Completed, requiring confirmation from both owner and borrower before completing. - Role-Protected Admin Console: Moderators can review branch-level activity, suspend/activate accounts, moderate listings, and resolve student reports.
How we built it
- Frontend: Built with React 19, TypeScript, and Tailwind CSS using a custom Skyblue glassmorphic UI, accessible keyboard navigation, and client-side routing.
- Backend API: A full-stack Express.js (
server.ts) server exposing REST endpoints for catalog queries, profile management, requests, pickup scheduling, dual-confirmed handovers, image uploads, and admin moderation. - Database & Transactions: Google Cloud SQL (PostgreSQL) managed with Drizzle ORM (
src/db/schema.ts,src/db/repository.ts), using database transactions with row-level locks (FOR UPDATE) to prevent race conditions during reservations and handover confirmations. - Authentication & Security: Firebase Authentication supporting both Google Sign-In and Email/Password (with password reset and optional
ALLOWED_COLLEGE_DOMAINrestriction), paired with server-side token verification, magic-byte file-type checks on uploaded images (JPEG,PNG,WebPup to2 MB), and automated tests usingnode:test.
Challenges we ran into
- Preventing Double-Booking & Race Conditions: Ensuring two students couldn't simultaneously reserve the same textbook required wrapping request acceptance and handover confirmation inside PostgreSQL transactions with row locks.
- Supporting Dual Auth Smoothly: Combining one-click Google Sign-In with Email/Password registration while keeping profile onboarding (
branch,semester,college) and Firebase Admin token verification consistent across both flows. - Image Upload Safety & Validation: Instead of trusting client file extensions or MIME headers, we implemented server-side magic-byte inspection and strict URL sanitization to prevent unsafe uploads or path traversal.
- Migrating to Managed Cloud Infrastructure: Moving cleanly from prototype persistence to a unified Cloud SQL PostgreSQL + Firebase Auth architecture without leaving stale configuration dependencies.
Accomplishments that we're proud of
- Designed and shipped a complete end-to-end exchange lifecycle—not just listings, but request validation, atomic reservation, pickup scheduling, and dual-confirmed handover tracking.
- Built a clean, responsive, keyboard-accessible interface with clear status timelines and campus savings tracking (
Retail MRP - Exchange Price). - Hardened the API with strict input validation, scoped payload limits, server-side role checks (
requireAuth/requireAdmin), and an automated test suite covering unit validators, auth middleware, and live HTTP security checks.
What we learned
- Transactional Integrity Matters: Real marketplaces fail without atomic state transitions—PostgreSQL row locks and server-side state validation eliminated entire classes of edge-case bugs.
- Security Starts at Boundaries: Validating magic bytes on uploads, escaping
ILIKEsearch wildcards, enforcing college domain/role checks on the server, and keeping sensitive credentials out of version control are essential from day one. - Accessibility Improves Usability for Everyone: Adding proper labels, focus management in dialogs, skip links, and keyboard-friendly cards made the entire platform feel noticeably more polished.
What's next for CampusCycle
- In-App Notifications & Reminders: Email or push alerts when a request is accepted, a pickup time approaches, or a handover awaits confirmation.
- Campus-Wide Multi-College Support: Isolated college spaces keyed automatically by verified
.edu/.ac.indomains. - Lending Return Deadlines: Automated semester-end return reminders and deposit tracking for borrowed lab coats and engineering tools.
- Wishlist & Instant Alerts: Let students subscribe to upcoming semester textbooks and get notified the moment a senior lists them.