You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`workspaces-backend`|`workspaces-backend-v2:${ENV}`| This repo. The only host-exposed service (`8000:8000`). Validates the TDEI/Keycloak JWT, enforces workspace authorization, serves `/api/v1/*`, and proxies everything else to the OSM tier. Connects to **both** databases. |
104
+
|`osm-rails`|`workspaces-osm-rails-v2:${ENV}`| The OpenStreetMap website (Rails) — the **single OSM entry point** the backend proxies to (`WS_OSM_HOST`). Serves the OSM API/UI and fronts cgimap for the heavy `/api/0.6` calls. Connects to the OSM db. |
105
+
|`osm-cgimap`|`workspaces-osm-cgimap-v2:${ENV}`| C++ reimplementation of the performance-critical OSM `0.6` calls (map queries, changeset upload/download), sitting behind `osm-rails`. Tuned here for large imports (`CGIMAP_MAX_*`). Connects to the OSM db. |
106
+
|`osm-rails-worker`|`workspaces-osm-rails-v2:${ENV}`| Background job runner (`rake jobs:work`) for the Rails app. Connects to the OSM db. |
107
+
108
+
### Two databases
109
+
110
+
The backend holds two connections, and the two alembic trees target them independently (see
111
+
`CLAUDE.md` and `api/utils/migrations.py`):
112
+
113
+
***TASK db** (`TASK_DATABASE_URL` → `workspaces-tasks-${ENV}`) — the workspaces + tasking-manager
114
+
schema, built by the `alembic_task` tree. Only the backend connects here.
115
+
***OSM db** (`OSM_DATABASE_URL` → `workspaces-osm-${ENV}`) — OSM data plus `users` and the
116
+
`tasking_*` tables, built by the `alembic_osm` tree. The backend, cgimap, rails, and the worker
117
+
all connect here.
118
+
119
+
On startup (outside of pytest) the backend runs `alembic -n task upgrade head` and
120
+
`alembic -n osm upgrade head`, applying each tree to its database.
121
+
122
+
### Environment templating
123
+
124
+
Every image tag, database name/user, and server host is parameterized by `${ENV}`
125
+
(`dev` / `stage` / `prod`), and secrets are injected from the shell environment
126
+
(`${WS_TASKS_DB_PASS}`, `${WS_OSM_DB_PASS}`, `${WS_OSM_SECRET_KEY_BASE}`). Branches map to these
127
+
environments — see the Branch Index below.
56
128
57
129
## To start on your local machine for dev work
58
130
@@ -106,4 +178,4 @@ connecting to existing Databases.
0 commit comments