An Advent of Code spinoff created as a personal project applying WPI's CS 1102 course introducing functional programming with Racket.
Players solve 25 days of functional programming challenges in Racket using an in-browser code editor with syntax highlighting. Each problem is timed with a 30-second reading period letting you read the problem before the stopwatch starts. Solutions are validated against both public and hidden test cases, so you'll need to write good solutions that address the applicable edge cases. A competitive leaderboard ranks the fastest solvers across all days.
Play now at AdventOfRacket.com!
Advent of Racket is built with Django and MongoDB, with a separate Problem Manager API that stores all problem content.
- Frontend — Django templates with the Monaco Editor (the engine behind VS Code) with custom Racket syntax highlighting providing an in-browser programming interface.
- Backend — Django views handle authentication, leaderboard logic, problem loading from the API, submission processing, and test case validation.
- Code Execution — A bundled Racket runtime executes user submissions in a sandboxed environment, blocking filesystem and network access with a 15-second timeout.
- Database — MongoDB Atlas stores user accounts, problem sessions, submission history, and leaderboard data via MongoEngine.
- Problem Manager API — A separate API serving test cases, starter code, and Markdown problem descriptions exclusively to requests using a valid authentication token — designed only to be accessed by this program's backend.
- Hosting — Deployed on Railway with Gunicorn as the WSGI server and WhiteNoise for static file serving.
- Login — Players log in with their GitHub account and are redirected back to the site.
- Select a Problem — Users choose one of the available days on the advent calendar, opening a page displaying the problem description, starter code, and test cases fetched from the Problem Manager API.
- Reading Period — Each problem starts with a 30-second reading window where the editor is locked, giving the user time to read before the timer starts.
- Code & Submit — Users write their Racket solution and click Run. The backend wraps the code in Racket's built-in sandbox, connects test cases, and executes it with a 15-second timeout.
- Validation — Outputs are compared against expected values for both public and hidden test cases. The tests window displays the result of each test as pass/fail (and any errors that might have occurred) without page reloads.
- Completion — When all tests pass, their solve time is recorded, they earn a star, and they advance to Part 2. After completing the Part 2 problem (earning a second star), they are returned back to the main page to see their progress on the advent calendar.
The AoR leaderboard system is modeled after AoC's:
Problems award one star per part solved. The daily leaderboard ranks players by solve time. For each problem and part, players earn 10 points for ranking 1st place, 9 points for 2nd, and so on down to 1 point for 10th. Players score 0 points for ranking below 10th on any part. The overall leaderboard sums each user's total points across all days and displays the top 20 sorted in descending order.
Have questions or feedback? Reach out through any of these channels:
Warning
Advent of Racket requires the AoR Problem Manager service to run properly. Set that up first.
- Python 3.12+
- MongoDB cluster (setup guide)
- GitHub OAuth app (setup guide)
pip install -r requirements.txtChoose your platform below, or see the Manual Installation dropdown for other systems.
macOS (Apple Silicon)
curl -L https://mirror.racket-lang.org/installers/8.13/racket-8.13-aarch64-macosx-cs.dmg -o racket.dmg && \
hdiutil attach racket.dmg && \
rm -rf ./RacketInstalls && mkdir RacketInstalls && \
mv "/Volumes/Racket v8.13/Racket v8.13" ./RacketInstalls/racket && \
hdiutil detach "/Volumes/Racket v8.13" && \
rm racket.dmg && \
python manage.py collectstatic --noinputLinux (x86_64)
curl -L https://mirror.racket-lang.org/installers/8.13/racket-8.13-x86_64-linux.sh -o racket.sh && \
bash racket.sh --in-place --dest RacketInstalls/racket --create-dir && \
rm racket.sh && \
python manage.py collectstatic --noinputWindows
curl -L https://mirror.racket-lang.org/installers/8.13/racket-8.13-x86_64-win32-cs.exe -o racket.exe && \
racket.exe /S /D=%CD%\RacketInstalls\racket && \
del racket.exe && \
python manage.py collectstatic --noinputManual Installation
- Download the appropriate installer from mirror.racket-lang.org/installers/8.13
- Install Racket into
./RacketInstallsso that the following paths exist from the project root:├─ AdventOfRacket/ ├─ application/ ├─ images/ ├─ RacketInstalls/racket/ │ ├─ bin │ ├─ collects │ │ ... - Run:
python manage.py collectstatic --noinput
Fill this env template with your GitHub OAuth app and MongoDB Cluster information. AOR_MANAGER_ACCESS_TOKEN can be any random string matching the token in your setup of the Problem Manager API.
AOR_MANAGER_ACCESS_TOKEN="YOUR-TOKEN-1"
DJANGO_SECRET_KEY="django_secure_YOUR_SECRET_KEY"
GITHUB_OAUTH_CLIENT_ID="YOUR_CLIENT_ID"
GITHUB_OAUTH_CLIENT_SECRET="YOUR_CLIENT_SECRET"
MONGODB_NAME="db_local"
MONGODB_URI="mongodb+srv://YOUR_USER:YOUR_PASSWORD@cluster0.example.mongodb.net/"
Clone and setup AoR Problem Manager using the README found in that repository.
Modify views.py on line 20 to use:
API_URL = "http://127.0.0.1:5000"First, run the Problem Manager API using this command wherever you downloaded that repository:
python app.pyThen, run the Advent of Racket server using this command:
python manage.py runserverEnjoy!
All files are licensed under MIT, except as clarified below.
This repository is an independent, unofficial project. No Advent of Code problem descriptions, solutions, inputs, or other proprietary materials have been intentionally copied or included.
Any content that may constitute the intellectual property of Advent of Code remains the property of Advent of Code and is not covered by the MIT License.



