No description
- TypeScript 47%
- Pug 23.7%
- CSS 15.1%
- JavaScript 7.1%
- Nix 7.1%
| anciennes_editions | ||
| nix | ||
| public | ||
| src | ||
| views | ||
| .editorconfig | ||
| .gitignore | ||
| kahulm.sqlite | ||
| package-lock.json | ||
| package.json | ||
| questions.csv | ||
| README.md | ||
| shell.nix | ||
| tsconfig.json | ||
| yarn.lock | ||
Kahulm
Install / update dependencies
yarn install
To update packages to their latest versions within the ranges declared in package.json:
yarn upgrade
Run the server
For production:
export NODE_ENV=production
yarn install
yarn start
For dev:
yarn dev
Reset and initialize the database
To wipe the existing database and start fresh (re-creates tables and seeds
teams, users, and questions from questions.csv):
# 1. Delete the current SQLite file (filename must match DB_FILE in your .env)
rm -f kahulm.sqlite
# 2. Compile and run the database initialisation script
yarn init-db
Note:
yarn init-dbcompiles the TypeScript sources and then runsdist/createDatabase.js. It will generate two output files:
users.csv— login/password pairs for all created userslocations.csv— location names and their database IDs
If the server is started (yarn dev or yarn start) and no SQLite file is
found, it will also call initDatabase() automatically — but that only
creates the empty schema. Run yarn init-db to seed the data.
.env format
# port of the server
PORT=2000
# password for sessions
SESSION_SECRET=my secret
# base url of the website
BASE_URL=http://localhost:2000
# the SQLite db filename
DB_FILE=kahulm.sqlite
# If you want to create an initial admin account.
# Can be omitted.
# Only works at database init;
# if there is already a SQLite db file, it is ignored.
ADMIN_USERNAME=admin
ADMIN_PASSWORD=test
# Config for how to hash passwords.
PASSWORD_SALT_LENGTH=128
PASSWORD_HASH_LENGTH=64