Skip to content

chrisemke/jacobson

Repository files navigation

jacobson

self-hosted zipcode API

The initial structure I imagined would be:

*api query/get* -> search in database -> if there is any result return;
else async call to all plugins that are configured, return and insert on database
*api mutation/post* -> manually update or insert zipcodes
call to tell the api to update some register from plugins that are configured

ROADMAP:

DONE (v0.1)

  • git hooks (pre-commit)
  • ORM (SqlModel)
  • Api's support services (cepaberto, viacep...)
  • Unit tests (pytest)
  • Migrations and data seed (Alembic)

DONE (v0.2)

  • Fix database session with get_db or get_session
  • Start Integration tests
  • Docs (mkdocs + mkdocs-material[to beautify] + mkdocstrings[to transform docstrings into docs])
  • mkdocs on gh pages and/or readthedocs
  • Taskipy
  • Re-enable Coordinates on database and api's (only cep_aberto available)

TODO (Needed for v0.3)

  • Add log support (loguru? or OpenTelemetry?)
  • Custom exceptions
  • Auth (pyjwt+pwdlib)
  • More test (unit and integration)

TODO (Needed until v1.0)

  • Populate the database with zip codes and cities
  • Automate migrations tests?
  • separate tests into groups to be run selectively
  • git hooks to run fast and slow tests
  • Resolve all code issues (TODO's on docstrings)
  • CI and CI tests
  • freeze versions on docker and pyproject
  • Better structure for services (plugin-like)
  • Send 'total' information on api requests for pagination

TODO (nice to have)

  • add option to seed all cities (or chosen list)
  • add option to seed all zip codes (or chosen list)
  • add graphql schema generator on git hooks
  • move from docker-compose to a podman pod
  • study mypyc viability
  • jacobson logo

DEV

The idea is to just run this command and podman will run the entire dev environment

obs: before this command you need to create the .env (see sample.env for example)

to run podman as expected, you will need the packages "podman", "podman-compose" and "aardvark-dns"

podman compose up -d --build

You can access the api at localhost port 8000 /graphql

http://127.0.0.1:8000/graphql