a bit of cleaning

This commit is contained in:
counterweight 2025-02-14 23:45:58 +01:00
parent 1c95c2251d
commit b57237f72b
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
3 changed files with 22 additions and 16 deletions

View file

@ -2,18 +2,28 @@
A joke application.
## How to set up
## How to set up dev environment
Note: I'm assuming you're running Ubuntu 22.04.
* Pre-requisites
+ `docker` and `docker compose`
+ `node` and `npm`
* Run `npm install`
* You can now start the app in a container by running `npm run start:containers` (and shut it down with `npm run stop:containers`).
* Get nodejs and npm ready
- Run `sudo apt update` and `sudo apt install nodejs`. Check that worked with `node -v`.
- Run `sudo apt install npm`. Check that worked with `npm -v`.
* Init an npm project: `npm init -y`
* Modify `package.json`: you might want to add dependencies.
* Potentially add a `start script`.
## How to test
## How to run
* Run `npm run test`
* You can get the dev containers up and running with `npm run start:containers`. You can visit the app at `localhost`.
* If you would rather only run the express app locally, you can just do `npm run start` instead.
## How to deploy
The app has never been deployed in production, so there's a lot of things to polish.
The (hypothetical) approach is to:
* Spin up a linux box.
* Install node, caddy and postgres.
* Configure them all nice and stuff so they work together and have a reasonable production set up.
* Set up the node app with systemd so it runs proper.
## Other
* You can format with `npm run format` and lint with `npm run lint`.