Under active construction!! 🚧
- Linux or macOS
- Nix with flakes enabled — provides Python and all backend dependencies via
flake.nix - A running PostgreSQL server (any recent version) with a database you can write to
- A running Redis server
nix developThis drops you into a shell with Python and every backend dependency available. Run all subsequent commands from inside this shell.
Create a .env (or export the variables in your shell) with at minimum:
SERVER_NAME=dev.cha.fan
SERVER_HOST=http://dev.cha.fan:4582
BACKEND_CORS_ORIGINS=["http://dev.cha.fan:8080"]
PROJECT_NAME=Chafan Dev
SECRET_KEY=change-me
FIRST_SUPERUSER=admin@cha.fan
FIRST_SUPERUSER_PASSWORD=change-me
USERS_OPEN_REGISTRATION=False
DATABASE_URL=postgresql://<user>@localhost:5432/chafan_dev
REDIS_URL=redis://127.0.0.1:6379
ENV=dev
alembic upgrade head
python scripts/initial_data.pymake dev-runAPI docs: http://dev.cha.fan:4582/docs
- Edit models under
chafan_core/app/modelsand updatechafan_core/app/models/__init__.py. - Generate a revision:
See the Alembic autogenerate docs. Always inspect the generated file before applying.
alembic revision --autogenerate -m "Add column last_name to User model" - Apply:
alembic upgrade head
- To roll back to a specific revision:
alembic downgrade <revision-id>
Reset persistent state, then run:
bash scripts/reset_app_state.sh
pytestA single file:
pytest -vv chafan_core/tests/app/email/test_email.py- Core backend
- Add event definition:
chafan_core/app/schemas/event.py - If the event goes to the activity feed: update
chafan_core/app/feed.py:get_activity_receivers - If the event goes to notifications:
chafan_core/app/materialize.py:materialize_eventand_KEYS(if a new field type)chafan_core/app/common.py:EVENT_TEMPLATES
- Add event definition:
- PWA
- Add event definition:
src/interfaces/index.ts - If the event goes to the activity feed: update event card in
src/views/main/Home.vue - Update event field rendering:
src/components/Event.vue(if a new field type) - Update event translation rendering:
src/main.ts
- Add event definition:
For all files within this repo, see LICENSE for default copyright unless otherwise declared in file: