SmartCampus is a lightweight marketplace and campus community web app with real-time chat, listings, and profile features. It uses a modern React + Vite + TypeScript stack with Firebase for auth/firestore, optional MongoDB Data API for server-side data, and a small Socket.IO chat server for peer messaging.
Features
- Marketplace listings and product pages
- User profiles and public profile sync
- Real-time chat (Socket.IO) and AI-assisted chat routes
- Authentication with Firebase (Google + email)
Documentation
- Development guide: DEVELOPMENT.md
- Architecture summary: ARCHITECTURE.md
- Contribution guidelines: CONTRIBUTING.md
Quick start
Prerequisites
- Node.js 18+ and a package manager (
npm,yarn, orpnpm).
Install
# install dependencies
npm installEnvironment
- Copy
.env.exampleto.envand fill required keys before running in production. The project reads client-side variables prefixed withVITE_and server-side keys likeMONGODB_DATA_API_*andFIREBASE_WEB_API_KEYwhere applicable. See DEVELOPMENT.md for details.
Development
# Start the Vite dev server
npm run dev
# (Optional) Start the independent chat socket server (used for some chat features)
npm run chat:serverBuild & preview
npm run build
npm run previewUseful scripts
npm run dev— Run Vite development servernpm run build— Build production assets (output:docs/by default)npm run build:dev— Build using development modenpm run preview— Preview the built site locallynpm run chat:server— Run the standalone Socket.IO chat server (chat-socket-server.mjs)npm run test— Run unit tests (vitest)npm run lint— Runeslintnpm run typecheck— Run TypeScripttsctype checksnpm run format— Runprettierto format files
Testing
Unit and component tests are powered by vitest and @testing-library/react. Run npm run test to execute the test suite.
Where to look in the codebase
- Frontend entry:
src/(routes, components, hooks, lib) - Server entry for SSR/API:
server.ts - Independent chat server:
chat-socket-server.mjs - Cloud / build config:
vite.config.ts,wrangler.jsonc(if deploying to Cloudflare)
Contributing Please read CONTRIBUTING.md for contribution guidelines, branch strategy, and testing expectations.
License
This repository does not include a license file. If you plan to publish this project, add a LICENSE file to indicate how it may be used.