Skip to content

This is the AMI (Application Mobile Interministérielle) notifications API, providing entry points to create and list notifications, and to store push URLs registered from clients (web or mobile).

License

Notifications You must be signed in to change notification settings

numerique-gouv/ami-notifications-api

Repository files navigation

AMI notifications API

This is the AMI (Application Mobile Interministérielle) notifications API, providing entry points to create and list notifications, and to store push URLs registered from clients (web or mobile).

Tech stack

Language: python

python using mypy.

Package and project manager: uv

uv is "An extremely fast Python package and project manager, written in Rust.", and is used to setup and manage the project.

Please follow the installation instructions to set it up on your machine.

Once it's installed, it should be used for everything project related:

  • adding more dependencies: uv add (--dev) <dependency, eg: requests>
  • running a script (or editor) in the project's python environment: uv run <command, eg: code>

Linter: ruff

ruff is "An extremely fast Python linter and code formatter, written in Rust."

Ruff is used both for:

  • linting: uv run ruff check --fix
  • formatting: uv run ruff format

API

litestar "is a powerful, flexible, highly performant, and opinionated ASGI framework."

First, you need a local .env file:

cp .env.template .env

Then start the server using:

uv run litestar run

or simply:

make dev # With live reloading

Then access http://127.0.0.1:8000, or open one of:

Database: postgresql

postgresql with asyncpg.

If developping locally, and no DATABASE_URL env variable is set, it'll default back to using sqlite.

The DATABASE_URL should look like the following:

postgresql+asyncpg://[user]:[password]@[url]:[port]/[dbname]

For example for a postgres database running locally:

postgresql+asyncpg://postgres:some_password@localhost:5432/postgres

About

This is the AMI (Application Mobile Interministérielle) notifications API, providing entry points to create and list notifications, and to store push URLs registered from clients (web or mobile).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published