ClientZore BackEnd
ClientZero helps startups find their first clients: co-founders, businesses, other startups and beta testers. This is the backend: Django, DRF, Celery, PostgreSQL 16 + pgvector, with RabbitMQ, Valkey and an S3 bucket from CodePinion. See docs/PRODUCT.md for the product design.
Status: early. The data models for people, companies, links, contact points and locations exist, are tested and have migrations, and Swagger is wired up. The login, profile, company, member and invitation APIs exist, and emails run as Celery tasks. Matching, embeddings and the rest do not yet.
| Area | What we use |
|---|---|
| Language and framework | Python 3.12 or newer, Django 6.1, Django REST framework |
| API contract | drf-spectacular (OpenAPI, committed as docs/openapi.json) |
| Auth | djangorestframework-simplejwt: short-lived access token, refresh token in an httpOnly cookie |
| Database | PostgreSQL 16 with pgvector (psycopg 3) |
| Background work | Celery 5.6 on RabbitMQ; chains, groups and chords for workflows; no Airflow |
| Cache and results | Valkey (Redis protocol) |
| Files | S3-compatible bucket via django-storages and boto3; WhiteNoise as the local fallback |
| Matching (planned) | sentence-transformers all-MiniLM-L6-v2, 384-d vectors in pgvector |
| Outside services (planned) | an email provider, an SMS provider (Africa's Talking), and Claude and GPT for document reading, only from Celery tasks |
| Tests and quality | pytest, pytest-django, pytest-env, moto; black, isort, flake8; gitleaks in CI |
| Hosting and CI | CodePinion (Hosted Apps, its own workflow files in .codepinion/workflows/) |
The frontend is a separate repository, clientzero-fe.
| App | Holds |
|---|---|
accounts | User (email login, optional phone, verification times), UserProfile |
companies | Company, CompanyMembership (owner, co-founder, member), CompanyInvitation |
contacts | WebLink (websites and social profiles), ContactPoint (extra emails, phones) |
locations | Place (GeoNames lookup), Location |
social_accounts | LinkedProvider: Google, GitHub and CodePinion sign-in (docs/OAUTH.md) |
workflows | WorkflowRun: the durable record of each Celery workflow run |
See docs/DATA_MODEL.md for the rules each model enforces.
python3 -m venv .venv && . .venv/bin/activate
pip install -r requirements-dev.txt
cp .env.example .env # then edit: secret key, DATABASE_URL, BROKER_URL, VALKEY_URL
docker run -d --name clientzero-test-db -e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=clientzero -p 5433:5432 pgvector/pgvector:pg16
make check # black, isort, flake8, pytest
Tests use DATABASE_URL, or fall back to the container above (port 5433). They run
Celery tasks inline and need no broker, cache or bucket.
python manage.py migrate
python manage.py runserver # the API
celery -A config worker -Q default,emails,embeddings -l info # background work
Emails (sign-up verification, password reset, invitations) are sent by the worker and
print in its terminal until an email provider is chosen. Logging and error handling are in docs/LOGGING.md. Setting up RabbitMQ and Valkey,
the everyday Celery commands, writing tasks and workflows, and troubleshooting are in
docs/CELERY.md. Every setting is listed in .env.example.
All tests live in tests/, mirroring the source tree. See docs/ for architecture and
decisions.
With the server running: Swagger UI at /api/docs/, ReDoc at /api/redoc/, and the
OpenAPI schema at /api/schema/. The committed contract is docs/openapi.json; a test
fails if it is out of date (see docs/ARCHITECTURE.md).
Place search (the location question in the company setup) needs the places loaded. One command downloads the GeoNames list of cities and loads it, locally and on the deployed app alike:
python manage.py import_cities # cities with 15,000+ people
python manage.py import_cities --dataset cities1000 # more towns (cities5000, cities1000)
It is safe to run again; existing places are updated and nothing is deleted. To load a
file you already have, or a whole country, use
python manage.py import_geonames path/to/file.txt [--min-population N]
(files are at https://download.geonames.org/export/dump/).
Licensed under the GNU AGPL-3.0. Contributions are welcome from anyone; see CONTRIBUTING.md (commits are signed off under the DCO). The ClientZero name and logo are not licensed for reuse; see TRADEMARK.md.
Work is tracked on CodePinion. Install the CodePinion skill to manage sprints, tasks and goals; see CONTRIBUTING.md.
ClientZore BackEnd