Installation Guide
This comprehensive guide will walk you through setting up a complete Campus development environment.System Requirements
- Operating System: Linux, macOS, or Windows (with WSL recommended)
- RAM: Minimum 4GB (8GB recommended)
- Disk Space: At least 500MB for dependencies and database
Prerequisites
Install Bun Runtime
Bun is a fast JavaScript runtime used as an alternative to Node.js.Campus requires Bun for its superior performance in package management and JavaScript execution. Version 1.0+ is recommended.
Install PocketBase
PocketBase is an open-source Backend-as-a-Service that powers Campus’s backend.Download PocketBase
Visit pocketbase.io/docs and download the executable for your operating system:
- Linux (AMD64)
- macOS (ARM64/Intel)
- Windows (AMD64)
Extract and Move Executable
Extract the downloaded archive and move the
pocketbase executable to your project root:Install Git
Git is required for cloning the repository.Installation Steps
Clone the Repository
Clone the Campus repository from GitHub:This downloads the complete source code including:
- Frontend application code (
src/) - PocketBase migrations (
pb_migrations/) - PocketBase hooks (
pb_hooks/) - Static assets (
static/)
Install Project Dependencies
Use Bun to install all required npm packages:This installs:Core Dependencies:
svelte(v5.43.14) - Reactive framework@sveltejs/kit(v2.49.0) - Application frameworkpocketbase(v0.26.3) - Backend client SDKtailwindcss(v4.1.17) - CSS frameworkzod(v3.25.76) - Schema validationsveltekit-superforms(v2.28.1) - Form management
bits-ui- Headless UI componentslucide-svelte- Icon librarydate-fns- Date utilitiessanitize-html- HTML sanitizationsharp- Image processing
Configure Environment (Optional)
Campus works out of the box with default settings. For custom configuration, create a Edit
.env file:.env to customize:- API endpoints
- PocketBase URL
- Other environment-specific settings
Initialize Database
Place the PocketBase executable in the project root (if not already there), then run migrations:This creates the SQLite database and applies all migration files from
pb_migrations/ to set up:- User tables and authentication
- Posts, comments, and interactions
- Spaces and groups
- Events and calendar entries
- Materials repository
- Academic profiles
Migrations are automatically tracked. Re-running
migrate will only apply new migrations.Start the Backend Server
Launch PocketBase in development mode:PocketBase will start on
http://localhost:8090 with:- Admin dashboard:
http://localhost:8090/_/ - API endpoint:
http://localhost:8090/api/ - Realtime subscriptions enabled
Start the Frontend Server
Open a new terminal window (keep PocketBase running) and start the development server:The frontend will be available at
http://localhost:5173 with:- Hot module replacement (HMR)
- Fast refresh for Svelte components
- Development error overlay
Both servers must run simultaneously. The frontend (port 5173) communicates with the backend (port 8090).
Project Structure
Understanding the codebase organization:Available Scripts
Campus includes several npm scripts for development:Verification
Confirm your installation is successful:Troubleshooting
Bun command not found
Bun command not found
After installing Bun, you may need to:
- Restart your terminal
- Add Bun to your PATH manually
- Run:
source ~/.bashrcorsource ~/.zshrc(Linux/macOS)
PocketBase permission denied
PocketBase permission denied
On Linux/macOS, ensure the executable has proper permissions:
Port conflicts
Port conflicts
If ports 5173 or 8090 are in use:Frontend (Vite):
Edit Then update your frontend to connect to the new port.
vite.config.ts to change the dev server port.Backend (PocketBase):Database migration errors
Database migration errors
If migrations fail:
- Ensure
pb_migrations/folder exists and contains migration files - Delete
pb_data/folder and run migrations again (⚠️ deletes all data) - Check PocketBase console output for specific error messages
Module resolution errors
Module resolution errors
If you see import errors:
Next Steps
Quickstart Guide
Follow our quickstart for a streamlined setup experience
Project Structure
Learn about the codebase organization and architecture
Development Workflow
Best practices for developing with SvelteKit and PocketBase
Deployment
Deploy Campus to production with Docker or traditional hosting
For additional help, refer to the official documentation: