For each room that a homeserver is involved in, there is a supervised GenServer (named [RoomServer](lib/architex/room_server.ex)) that holds/manages the room's state.
These RoomServers are responsible for state resolution and authorization.
Database schemas are located at [lib/architex/schema/](lib/architex/schema/).
Requests from the federation API as well as the client API are validated using [Ecto](https://hex.pm/packages/ecto)'s `embedded_schema`s, located at [lib/architex_web/api_schemas/](lib/architex_web/api_schemas/).
* State resolution: functional, but very memory-intensive and with high database usage. For now it is sufficient, but snapshots should be used in the future. See: [State Resolution v2 for the Hopelessly Unmathematical](https://matrix.org/docs/guides/implementing-stateres), [State Resolution: Reloaded](https://matrix.uhoreg.ca/stateres/reloaded.html) and [Room Version 2](https://spec.matrix.org/unstable/rooms/v2).
* Resolving server names (but works for local development) ([3.1 Resolving server names](https://matrix.org/docs/spec/server_server/latest#resolving-server-names))
* Checks when receiving events via federation (i.e. valid format, signature check and hash check) ([6.1 Checks performed on receipt of a PDU](https://matrix.org/docs/spec/server_server/latest#checks-performed-on-receipt-of-a-pdu))