Overview
Penn Clubs consists of two main components that need to be running for development:- Backend: Django REST API (Python 3.13)
- Frontend: Next.js application (Node 22 with Bun)
Questions during setup? Check out the extended development guide for FAQs and troubleshooting.
Prerequisites
Backend Requirements
- Python 3.13
- uv package manager
- PostgreSQL (for dependency compilation)
- Git
Frontend Requirements
- Node.js 22.11.0 (exact version)
- Bun package manager
- Git
Backend Setup
Install uv Package Manager
Install uv, a fast Python package manager:
- Mac/Linux
- With pip
- With Homebrew
Install PostgreSQL Dependencies (Mac)
On Mac, you need to install PostgreSQL and OpenSSL for the
psycopg2 dependency:If you’re not modifying dependencies right away, you can skip this step and return to it later if needed.
Clone Repository and Install Dependencies
The first
uv sync may take a few minutes. If you skipped installing PostgreSQL dependencies, you might see locking errors - this is expected and won’t affect basic development.Set Up Pre-commit Hooks
Install pre-commit hooks for code quality checks:These hooks will run automatically before each commit to ensure code formatting and linting standards.
Initialize Database
Run Django migrations and populate with test data:The
populate command creates test clubs and a test user:- Username:
bfranklin - Password:
test
Start Development Server
Frontend Setup
Install Node.js 22
Penn Clubs requires Node.js 22.11.0. Install it using your preferred method:Verify your Node version:
- nvm (Recommended)
- Homebrew (Mac)
- Direct Download
Start Development Server
The frontend automatically proxies API requests to
http://localhost:8000 as configured in package.json:Log In to Test Account
- Navigate to http://localhost:3000
- Click Login in the top right corner
- Use credentials:
- Username:
bfranklin - Password:
test
- Username:
Environment Variables
Production Environment Variables
- Backend (.env)
- Frontend (.env.local)
- Ticketing (Optional)
Create a
.env file in the backend directory for production:Ticketing Development
Setting Up Local Ticketing (Advanced)
Setting Up Local Ticketing (Advanced)
Penn Clubs uses CyberSource Secure Acceptance Hosted Checkout for payment processing. Local development requires ngrok to create a publicly accessible URL for payment callbacks.Payment Flow:
Start ngrok Tunnel
In a separate terminal:Copy the HTTPS forwarding URL (e.g.,
https://abc123.ngrok-free.app)- User initiates checkout → Backend generates signed payment parameters
- Frontend submits form POST to CyberSource with signed parameters
- User enters payment details on CyberSource’s hosted page
- CyberSource POSTs results to
/api/tickets/payment_complete/via ngrok - Backend validates signature and processes payment
Code Quality Tools
Backend Linting
Frontend Linting
Building for Production
- Backend
- Frontend
The backend doesn’t require a build step, but you can prepare for deployment:
Common Issues and Troubleshooting
Port Already in Use
Port Already in Use
If ports 8000 or 3000 are already in use:
Node Version Mismatch
Node Version Mismatch
Ensure you’re using Node 22:
Database Connection Errors
Database Connection Errors
The development setup uses SQLite by default. If you see database errors:
Module Import Errors
Module Import Errors
If you see import errors:
Next Steps
Read the Contributing Guide
Learn about our development workflow and contribution guidelines
Explore the API
Browse the REST API documentation
Join Penn Labs
Apply to join our team of student developers
Report Issues
Found a bug? Let us know on GitHub
Additional Resources
Django Docs
Django framework documentation
Next.js Docs
Next.js framework documentation
REST Framework
Django REST Framework docs
Bun Docs
Bun package manager documentation
uv Docs
uv package manager documentation
TypeScript Docs
TypeScript language documentation