- 🔋 batteries included: All in one system for a digital currency, attendance tracking, etc.
- 🎛️ open & configurable: Easy configuration and new ideas welcome
- 🚀 reliable: Successfully used by SaS 2024 @ MPG Karlsruhe
- 💳 id card: combine id and credit card via QR code
- 🛃 border control: charge customs & track attendance
- 🏦 bank: exchange currencies
- 🛒 point of sale: sell products digitally
- 💸 online banking: transfer money and pay employees
- ⚙ admin panel: reset passwords, backup database, etc.
Server: Finished. Unit-grade testing on node lts/hydrogen.
Client: Features above finished. Mockups for further features like voting, emplyoee tracking, financial statistics for companies and warehouse management exist. No automated testing, tested on Chrome.
Prerequisites: bun, node lts/hydrogen (e.g. via nvm)
$ git clone https://github.com/p-98/schule-als-staat
$ cd schule-als-staat
$ bun install
To start the preview:
- Initialize database with test-data:
$ bun scripts/create-test-db.ts
- Start development server:
$ bun run dev-server
- In another terminal, start development client:
$ bun run dev-client
- Open
127.0.0.1:3000
in your browser. (Openinglocalhost:3000
won't work!)
To start a production environment:
-
Remove the existing database (if present), create an empty database and import data:
$ rm -f database.sqlite3* && bun scripts/create-empty-db.ts $ bun scripts/import-users.ts ...
Run
bun scripts/import-users.ts --help
to get more information on imports. -
Start the production server:
$ bun run build-server $ bun run start-server
-
In another terminal, start production client:
$ bun run build-client $ bun run start-client
-
Open
127.0.0.1:3000
in your browser. (Openinglocalhost:3000
won't work!)
With the server running, you can still run sql queries against the database. You should know what you are doing and create a backup before though! The following pragma should be set:
PRAGMA journal_mode = WAL;
Caveats: You can start long-lasting read-transactions in WAL mode, but you cannot do long-lasting write transactions.
I.e., if you open sqlite3 via cli, start a transaction via BEGIN TRANSACTION
, do a write query and then want to see whether your query had the desired effect before commiting, requests to the server will start getting rejected with internal server errors after 5 seconds. They will recover when the transaction is commited.
Short transactions for example using scripts are fine though, in this case sqlite just retries until the database is free.