tags:

  • development
  • naming-conventions
  • database
  • postgres
  • docker
  • containers
  • users
  • csms
  • api related:
  • ../../api/README.md
  • ../../api/docker-compose.yml

Naming Conventions

Naming conventions for Autimit development resources, including databases, database users, schemas, Docker services, and containers.


General Rules

  • Use lowercase names.
  • Use snake_case for database names, database users, schemas, and environment values.
  • Use kebab-case for Docker container names.
  • Prefix project-owned infrastructure with autimit so it is easy to identify.
  • Keep names descriptive, stable, and boring.
  • Avoid names tied to one service when the resource is shared by multiple services.

Database

For now, the CSMS and API share the same PostgreSQL instance.

Database name: autimit
API schema name: api

The database is not named after the API because it is shared infrastructure.


Database User

For now, the project uses one PostgreSQL user for everything:

Database user: atmt_user
Database password: atmt_user

The atmt_user user is used for:

  • local CSMS and API application connections
  • Drizzle migrations
  • schema ownership
  • local manual database maintenance

Current local API connection string:

DATABASE_URL=postgresql://atmt_user:atmt_user@localhost:5432/autimit

Inside Docker Compose, the API connects to the postgres service:

DATABASE_URL=postgresql://atmt_user:atmt_user@postgres:5432/autimit

Docker

Current service names:

postgres
api

Current container names:

autimit-postgres
autimit-api

The Postgres container is intentionally not API-specific because it is shared by the CSMS and API for now.


Future Split

When the project needs stricter database permissions, split the single user into purpose-specific users:

autimit_app
autimit_migrations
autimit_readonly
atmt_admin

In that model:

  • autimit_app is used by the running API.
  • autimit_migrations owns and changes schema objects.
  • autimit_readonly is used for reports or read-only access.
  • atmt_admin is reserved for maintenance.

Until that split is needed, atmt_user remains the single database user.