Skip to content

Backend

Matthias Monschein edited this page May 25, 2024 · 7 revisions

Note

The backend was composed with Express as its web framework. Everything's written in TypeScript.

Database

I've decided to use an SQL database for everything (at least for now), even though noSQL options like Neo4j might be nice for the network of connections of people and organizations.

Terminology

Some important terms here, because I didn't only use them in the DB but actually all throughout the application, so...

  • Organ ... this is sort of the basis for both people and organizations.
  • Person ... a natural person.
  • Organization ... an organization (any sort of organized group really).
  • Relation ... a connection between two people (no organizations here).
  • Membership ... a membership of an Organ (Person, Organization, etc.) in some Organization.

And here is how these objects and many more are currently connected in the database - I'm also not quite satisfied with the ER model, so I'll probably change some things here in the future as well. (You can find the entire definition script define.sql in the repo as well).

ERD

Tech

I already mentioned I'm using an SQL db - currently it's Postgres to be precise. Plus, I'm using Supabase for hosting rn, since it's just really easy and was a way for me to quickly launch stuff.

API

I started work on an OpenAPI definition of the API (openapi.yaml) but haven't gotten to far there yet, tbh. I do, however, have a Postman Collection for the API endpoints in the base directory of the repo (glass-pane.postman_collection.json), so you can check that out - it's rather complete.

AAA

Rn, AAA is also a bit messed up - I have at least some basic authentication - i.e. JWT and HTTP-only cookies for the API - but authorization and accounting haven't really been implemented yet. The only factor for authorization (i.e. for being able to edit content) rn is literally just having a user account.

Clone this wiki locally