T | R | A | P | S |
Typescript | Rust | Actix | Postgres | Svelte(kit) |
Tailwind | Sqlx | |||
Ts-rs | Shadcn |
TRAPS focuses on runtime safety, DX, UX, performance and scalability. It leverages the strength of Rust and Typescript to provide a robust and secure backend and frontend.
- Secure HTTP-Only-Cookie-based JWT authentication built-in
- Typesafe and secure SQL queries with sqlx
- Secure back-end with Actix-web
- Pretty and swiftly built frontends thanks to Svelte, Tailwind and Shadcn
- Automatically generated API bindings in Typescript using a in-house macro in combination with
ts-rs
Make sure you have a postgres DB running, copy env.example
to .env
and set the properties accordingly.
Also make sure to set a env.production
file.
The compose.example.yaml
file is a template for the docker-compose
file. Make sure to use the same passwords as defined in the .env
file.
- Run
cargo sqlx database create
to create the database. - Run
cargo sqlx migrate run
to run the migrations. - Run
cargo run
to start the backend server.
- Run
npm install
to install the dependencies. - Run
npm run dev
to start the development server.
- Run
cargo test
to test, this also runs migrations and generates/updates the API bindings. - Run
npm run test
to test the frontend. - Check out
package.json
for more scripts. Most of the listed commands have been aliased here.
.
- Contains the frontend and the cargo workspaceapi
- The backendapi-lib
- The backend libraryapi-proc
- Some procedural macrossrc
- Sveltekit frontend/api
- The generated API bindings, accessible by$api
in TS or Svelte files
static
- Static filestests
- Integration tests
Make sure you have a postgres DB running, and have a valid .env.production
according to
the .env.example
file. Also make sure to have a valid compose.yaml
file.
For docker, unfortunately postgres needs to be running already when the backend starts. This is due to the fact that the backend is started before the database is created and SQLX tries to connect to the database. This is a known issue and will be fixed in the future.
- Add more tests
- Add more documentation
- Email authentication
- Built-in admin panel
- Resend email verification & Add a way to change email / password
- Error handling in the frontend
- Github actions for CI/CD and fixing the docker-compose issue