Official platform for club discovery, recruitment, and events at Penn. React/Next.js frontend and Django-based REST API.
You will need to start both the backend and the frontend to do Penn Clubs development.
You will need to start both the backend and the frontend to develop on Penn Clubs. Clubs supports Mac and Linux/WSL development.
Questions? Check out our extended guide for FAQs.
Running the backend requires Python 3.11 and Pipenv.
In production, you will need to set the following environment variables:
NEXT_PUBLIC_SITE_NAME(optional, defaults toclubs)SECRET_KEYSENTRY_URLAWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_STORAGE_BUCKET_NAMELABS_REDIRECT_URILABS_CLIENT_ID(from Platform)LABS_CLIENT_SECRET(from Platform)
To run the server, cd to the folder where you cloned penn-clubs. Then run:
cd backend
Setting up psycopg2 (this is necessary if you want to be able to modify
dependencies, you can revisit later if not)
- Mac
$ brew install postgresql$ brew install openssl$ brew unlink openssl && brew link openssl --force$ echo 'export PATH="/usr/local/opt/openssl@3/bin:$PATH"' >> ~/.zshrc$ export LDFLAGS="-L/usr/local/opt/openssl@3/lib"$ export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
- Linux/WSL
$ apt-get install gcc python3-dev libpq-dev
Now, you can run
$ pipenv installto install Python dependencies. This may take a few minutes. Include the--devargument if you are installing locally for development. If you skipped installingpsycopg2earlier, you might see an error with locking -- this is expected!$ pipenv shell$ pre-commit install$ ./manage.py migrateOR$ python3 manage.py migrate$ ./manage.py populateOR$ python3 manage.py populate(in development, to populate the database with dummy data)$ ./manage.py runserverOR$ python3 manage.py runserver
Use $ ./manage.py test to run unit tests.
Running the frontend requires Node.js and Yarn.
Please ensure you are using Node 20. Our codebase does not support other versions of Node (v20.11.1 is stable).
You will need to set the following environment variables on the frontend:
NEXT_PUBLIC_GOOGLE_API_KEYNEXT_PUBLIC_SITE_NAME(Optional)- Specify
clubsto show Penn Clubs andfyhto show Hub@Penn.
- Specify
- Enter the
frontenddirectory with a new terminal window. Don't kill your backend server! - Install dependencies using
yarn installin the project directory. - Run application using
yarn dev. - Access application at http://localhost:3000.
Use $ yarn test to run Cypress tests.
Click Login to log in as a test user. The ./manage.py populate command creates a test user for you with username bfranklin and password test. Go to /api/admin to login to this account.
To test ticketing locally, you will need to install mkcert, enter the frontend directory, and run the following commands:
$ mkcert -install$ mkcert localhost 127.0.0.1 ::1$ export DOMAIN=https://localhost:3001 NODE_TLS_REJECT_UNAUTHORIZED=0
Then, after the frontend is running, run yarn ssl-proxy in a new terminal window and access the application at https://localhost:3001.