mirror of
https://github.com/decompme/decomp.me.git
synced 2026-01-17 02:30:28 -06:00
* Add script to download libraries, and download directx * Add libraries endpoint * Allow compiling with a library * Add new libraries tab in frontend * Add libraries support in CI * Better look for the libraries * Give pretty names to libraries * Move Libraries to live under CompilerOpts * typechecking hackery * Make libraries trigger autorecomp and set the unsaved flag * Fix libraryVersions * Add new libraries download script to CI, docker and docs --------- Co-authored-by: Ethan Roseman <ethteck@gmail.com>
2.6 KiB
2.6 KiB
Contributing
Directory structure
frontend/
public/ ; Static files
src/ ; React/Typescript sourcecode
backend/
compilers/ ; Compiler binaries and configuration
coreapp/ ; API Django app
migrations/ ; Database migrations (generated by Django)
decompme/ ; Main Django app
libraries/ ; Library headers
.env ; Default configuration
.env.local ; Local configuration overrides (not checked-in)
Setup
See DOCKER.md for instructions on how to run the project in a Docker container. Otherwise, continue reading this guide.
Dependencies:
Create a file to hold environment variables:
touch .env.local
Backend
cd backend
- Install Python dependencies with poetry
poetry install
- Install compilers
poetry run python compilers/download.py
- Install libraries
poetry run python libraries/download.py
- Set up the database
poetry run python manage.py migrate
- Start the API server
poetry run python manage.py runserver
Frontend
cd frontend
- Install dependencies
yarn
- Start the development webserver
yarn dev
- Access the site via http://localhost:8080
Optional steps
- Configure vscode for development
- Configure wine for Windows compiler on Linux
- Set up GitHub authentication
- Install nsjail to run the compiler sandbox
- Configure an nginx reverse proxy
- Download wibo and add it to your system path (for running Windows compilers from Linux)
Notes
Updating the database
If you modify any database models (models.py), you'll need to run the following to update the database:
poetry run python manage.py makemigrations
poetry run python manage.py migrate
### Frontend styling
We use Tailwind CSS with Radix UI colors. Each color is on a scale from 1 to 12 (inclusive), each with a well-defined meaning.
Linting
- Check frontend
cd frontend
yarn lint
- Autofix frontend
cd frontend
yarn lint --fix
- Check backend
cd backend
poetry run mypy
poetry run black .