2023 · built at 17
securitas / baseguard
identity, permissions and client infrastructure
i wrote securitas when i was 17 as the backend for a piece of client software. it's a next.js and mysql app that handles accounts, organizations, permissions and the client api.
- typescript
- next.js
- node.js
- mysql
- bcrypt
- rest api
admin interface
users & tenant settings
client api
keys & configuration
mysql
users, sessions, guilds & activity
one platform, multiple organizations
each organization is a guild in the database. guilds have a key, a status and a client availability flag, and the client identifies its guild by sending the key with every request.
five permission levels
access is split into five levels, from no access through user, superuser and guild admin up to admin. i wrote each permission as a named function that states the level it requires, such as managing announcements or issuing invite keys.
sessions
passwords are hashed with bcrypt. signing in creates an auth session that expires after an hour and a renewal session that lasts fourteen days, and sessions are checked against their type, expiry and ip address.
connecting the dashboard to the client
there's also invite key issuance, client authorization, per-guild settings and activity records, which connect the dashboard to the client running outside the browser.
the thread through my work
it was the first system i built where i was responsible for all of it.
development history, from 2019