๐ ๏ธ Development
Working on the auth server itself.
๐ Repository layout
| Path | Purpose |
|---|---|
main.py |
FastAPI app factory, environment wiring, lifespan, OpenAPI customization |
jwt/ |
The auth routes package (router, get_current_user) |
generate_spec.py |
Regenerates the committed OpenAPI spec |
docs/api/ |
API reference (Swagger UI embed + openapi.json) |
docs/lib/ |
Generated library reference (docforge) |
docs/wiki/ |
This hand-written wiki |
tests/ |
Async route tests against an in-memory Mongo mock |
๐ง Setup
Dependencies are installed from the private pip index (see requirements.txt
and the Dockerfile). Core runtime packages:
py-jwt==0.0.4โ providesjwtlib(applications logic, models, security, introspection)mongo-ops==0.1.3โ MongoDB persistence layerfastapi,uvicorn,python-jose,passlib,bcrypt,pymongo
๐งช Tests
Run the suite (no network or Mongo required โ an in-memory mock is used):
Coverage spans the full HTTP flow: register โ login โ wrong-password 401 โ
/me with and without a token โ stateless logout.
๐ Regenerating the OpenAPI spec
The committed docs/api/openapi.json is produced offline:
MONGO_HOST only needs to be set for the import; no connection is opened.
๐ Building documentation (docforge)
The site is generated by docforge
and served per kind under site/{kind}:
--apirendersopenapi.jsonwith Swagger UI.--mkdocsrenders the library reference from thejwtpackage docstrings (nested underdocs/lib/jwt/, matchingdocforge.nav.yml).--wikibuilds this wiki.- Navigation layout is defined in
docforge.nav.yml.
The
jwtmodule is rendered without--module-is-sourceso the library output stays nested underdocs/lib/jwt/, matching the committeddocs/mkdocs.lib.ymlnav.
Preview locally:
๐ Read Next
- Deployment โ environment and CI/CD.
- How to Use โ exercising the service end to end.