Ghost is an interactive campus map tool for GMU students. It helps find empty classrooms across campus during specific times, providing a quiet space to study or focus without distractions.
- Visualizes GMU campus buildings using Mapbox.
- Find empty rooms in specific buildings based on current class schedules.
- Filter room availability by building, day, and time.
- View building details and available rooms
- Framework: Next.js (React)
- Language: TypeScript
- Map Library: React Map GL (Mapbox)
- Styling: Tailwind CSS
- Language: Go
- Framework: Gin
- Database: Google Cloud Firestore
- Scraper: A custom Go scraper that fetches course schedule data from the GMU Student Registration system.
frontend/
app/ # pages and layouts
components/ # UI components
lib/ # Utility functions
types/ # TypeScript definitions
go/
cmd/
main.go # API server entry point
scraper/ # Scraper
internal/
api/ # API route handlers
firestore/ # Database initialization and client
types/ # Go struct definitions
go.mod
- Node.js (v18+)
- Go (v1.20+)
- Mapbox Access Token (free @ mapbox.com)
- Google Cloud Project with Firestore enabled
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install # or yarn install - Create a
.env.localfile in thefrontenddirectory:NEXT_PUBLIC_MAPBOX_TOKEN=pk.eyJ1... (your Mapbox public token) NEXT_PUBLIC_BACKEND_URL=http://localhost:8080 (optional, defaults to this)
- Run the development server:
npm run dev
-
Navigate to the go directory:
cd go -
Install Go dependencies:
go mod download
-
Create a
.envfile in thegodirectory:GOOGLE_PROJECT_ID=your-project-id FRONTEND_URL=http://localhost:3000 DEV=true PORT=5000
NOTE: Ensure you have your Google Cloud credentials set up (e.g.,
GOOGLE_APPLICATION_CREDENTIALSenv variable pointing to your service account key). -
Run the API server:
go run cmd/main.go
The server will run on port
5000(whatever you set it to in .env).
To populate the Firestore database with Mason course data:
- Navigate to the go directory:
cd go - Run the scraper:
IMPORTANT: The scraper is configured for specific terms (e.g., "202610") in the code. You may need to update the
go run cmd/scraper/scraper.go
Termconstant incmd/scraper/scraper.go.
GET /health: Health check endpoint.GET /api/buildings: Returns a list of supported buildings with their coordinates.GET /api/rooms: Fetch room schedules.- Query Params:
building: Building code (e.g.,HORIZN)day: (Optional) Day of the weektime: (Optional) Time of day
- Query Params:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/amazing-feature). - Commit your changes (
git commit -m 'Add some amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request.
