No description
Find a file
JMARyA 40d69b61e1
All checks were successful
ci/woodpecker/push/test Pipeline was successful
fix
2024-12-18 20:18:59 +01:00
.woodpecker nightly 2024-12-18 19:58:33 +01:00
src fix 2024-12-18 20:18:59 +01:00
.gitignore init 2024-12-17 23:28:43 +01:00
Cargo.lock update 2024-12-18 14:33:53 +01:00
Cargo.toml update 2024-12-18 14:33:53 +01:00
README.md init 2024-12-17 23:28:43 +01:00

Based

Based is a micro framework providing web dev primitives.

Features

  • User Auth
  • PostgresDB Connection
  • Logging
  • Request Contexts
  • Templates (Shell)

User Auth

To use the user auth feature, make sure a migration has added the following to your PostgresDB:

CREATE TYPE user_role AS ENUM ('regular', 'admin');

CREATE TABLE IF NOT EXISTS users (
    username VARCHAR(255) NOT NULL PRIMARY KEY,
    "password" text NOT NULL,
    user_role user_role NOT NULL DEFAULT 'regular'
);

CREATE TABLE IF NOT EXISTS user_session (
    id UUID NOT NULL PRIMARY KEY DEFAULT gen_random_uuid(),
    token text NOT NULL,
    "user" varchar(255) NOT NULL,
    FOREIGN KEY("user") REFERENCES users(username)
);