Service architecture
What each PoliNetwork service owns and how the services work together.
Auth is the identity and permission source. Backend owns shared application data and exposes the typed API used by Admin, Web, and the Telegram bot. The shortener uses Auth for operator sign-in and manages its links through its own API and database.
Repository responsibilities
| Repository | What belongs there | Where to start |
|---|---|---|
| backend | Shared tRPC procedures, input validation, authorization at the API boundary, and PostgreSQL migrations. Owns the data for groups, website content, People and Soci, regulations, e-signing, and application audit records. | API and authentication |
| telegram | The bot inside Telegram. Owns commands, callback menus, moderation actions and jobs, group synchronization, and delivery of moderation audit records to Backend. | Bot authorization and integration |
| admin | The staff and volunteer dashboard. Owns screens, forms, navigation, server functions, and the server-side dashboard session. Operators use it to manage records held by Backend. | Dashboard architecture |
| web | The public site at polinetwork.org. Owns pages, layout, fixed Italian and English copy, and public forms. It renders managed content fetched from Backend. | Website README |
| auth | The OpenID Connect (OIDC) identity provider. Owns user accounts, linked identities such as Telegram, passkeys, roles and permissions, application registration, and token issuance. | Auth README |
| polinet.cc | The URL shortener. Owns public redirects, aliases, click statistics, the link-management dashboard, and access to its REST API. It stores shortener data in its own PostgreSQL database. | Shortener architecture |
How requests flow
Admin signs people in through Auth. Its server keeps tokens in a dedicated Redis session store and forwards a
user access token to Backend. Admin uses me.access to decide what to show. Backend checks each procedure’s
required scope and permission independently. Dashboard authentication
Web and Telegram call Backend as services. Web visitors can browse without an account. The website server uses its own service token to read public content and sends the problem-report form through a website-specific Backend endpoint. The bot uses its own Auth-issued service access token for Backend calls and Socket.IO. For user-initiated operations it identifies the Telegram actor on its authenticated tRPC request. Backend resolves the linked user’s permissions. The bot applies chat-local administrator rules where its commands allow them. Website server client · Bot authorization
Backend obtains identity and permissions from Auth. Backend verifies tokens against Auth’s public signing keys and authorizes calls using a local copy of the access snapshot. It polls Auth for that snapshot and receives signed events when configured. For workflows such as People role assignments, Backend persists the domain record and requests the corresponding role change from Auth. Backend authentication · People roles
The shortener has two access paths. People open public short links directly. Operators sign in through Auth,
and the shortener maps polinetcc:read and polinetcc:write to its local viewer and admin roles. API clients in an
authenticated deployment send shortener-issued API tokens to the REST API. The shortener publishes its API
documentation at /api and its OpenAPI schema at /openapi.json. Shortener deployment notes ·
REST contract source
Example: a Freshman Telegram Hub link
- The Telegram bot synchronizes group records and invite links into Backend.
- An authorized Admin user selects a group for a Freshman Telegram Hub slot. Backend stores the group reference.
- Web reads
web.freshman.getContentto render/matricole. Backend resolves the current invite link from the stored group reference. When the bot synchronizes a new invite link, the next page load reflects it.
Freshman API and data model · Dashboard editor
For development setup, checks, and examples of changes that span repositories, see Contributing across repositories.
PoliNetwork Docs