Repository navigation
Local Development Setup (Recommended)
This project uses Docker and VS Code Dev Containers to standardize the development environment. This eliminates manual setup and ensures the project runs identically for every developer, on any OS.
Ensure you have the following installed and configured:
-
Docker, installed and running before you begin:
- Docker Desktop (Windows, macOS, Linux), or
- on macOS without Docker Desktop:
brew install colima docker docker-composeand thencolima start --cpu 4 --memory 6
- Visual Studio Code
- Dev Containers Extension extension installed in VS Code
-
Clone the repository: You can use GitHub Desktop or this command:
git clone https://github.com/CosmosTUe/Cosmos.git
- Open the folder in VS Code.
- Click "Reopen in Container" in the bottom-right pop-up.
- If the pop-up is missing, press
F1->Dev Containers: Reopen in Container.
- If the pop-up is missing, press
Do NOT clone this repository manually. It will result in an unusably slow environment. Instead, use the following VS Code feature:
- Open a new, empty VS Code window
- Press
F1(orCtrl+Shift+P) - Select:
Dev Containers: Clone Repository in Container Volume - Paste the repository URL:
https://github.com/CosmosTUe/Cosmos.git
This process will set up an isolated, high-performance environment automatically.
The first container build takes several minutes. A setup script runs automatically and handles:
- Copying
dev.secrets.jsonto/etc/secrets.json - Installing the exact Python (Pipenv) and Node.js dependency versions from the lock files
- Running database migrations
- Creating a default superuser
Wait for the terminal to display: SETUP FINISHED!
Next to the website, the container starts PostgreSQL 17 and Redis 7 (the versions production uses) and Mailpit.
- Press
F5(or click the Green Play button in the "Run and Debug" tab) - Open
http://localhost:8000in your browser
You can access the Django admin interface to manage the database, create users, and perform administrative tasks.
-
URL:
http://localhost:8000/admin/ -
Username:
admin -
Password:
admin
The site never sends real email in development. Everything it sends (registration, password reset, ...) is caught by Mailpit at http://localhost:8025.
GitHub checks every pull request with black, isort, flake8 and the test suite. Run the same checks in the container's terminal:
pipenv run black .
pipenv run isort .
pipenv run flake8 .
pipenv run python manage.py testTo have black, isort and flake8 run automatically on every commit, install the hooks once with pipenv run pre-commit install.
Pull requests go to the staging branch. After merging they are live on the staging site; see STAGING.md.
-
Starting over:
F1->Dev Containers: Rebuild Container. The database lives in a Docker volume and survives a rebuild. To wipe it too, remove thecosmos_devcontainer_postgres_datavolume (docker volume rm cosmos_devcontainer_postgres_data) and rebuild. -
Port 8000 or 8025 already in use: something on your computer already uses that port (for example a local PostgreSQL). Stop it, or change the port on the left side in
.devcontainer/docker-compose.yml.