Documentation for all projects under the B.A.H.M.S. organization. Published on https://docs.bahms.org.
To run a local development server, either run it locally with Node.js, or through Docker compose.
How to develop locally using Node.js on your host system.
Be sure to run Node version 22.
Ensure the dependencies are installed, at least once.
npm ciBe sure to run this command again if changes to package-lock.json are pulled in.
To start the local development server, run:
npm run devThis will expose the Astro server on http://localhost:4321/
The following command will create a production build in the dist/ folder.
npm run buildWhen you have created a local dist/ output, you can preview the result with
the following command:
npm run previewThis will expose the production preview on http://localhost:4321/
One should always do this before opening a pull request.
How to develop locally using Docker Compose.
In order to use the local development server through Docker Compose, one needs to run the following command:
docker compose up -dThe -d flag runs in detached mode. Without -d it will attach to the current
console, binding both input and output and making the process terminate if you
close your terminal. The difference is a matter of preference.
This will do the following, in order:
- Install
node_modules - Run
npm run dev:host - Expose the Astro server on
http://localhost:4321/
In order to test against a build as it would be deployed on production, use the
preview profile when bringing up the Docker Compose project:
docker compose --profile preview up -dThis will do the following, on top of the dev environment, in order:
- Remove the
dist/directory. - Create a production build in
dist/. - Run
npm run preview:host - Expose a production preview on
http://localhost:4322/
N.B.: This will run side-by-side with the
devenvironment on port4321.
Be sure to pull down the project using the preview profile too, so it won't
leave up the preview server:
docker compose --profile preview downTo run the equivalent of npm ci, use the following.
docker compose run --rm npm ciAny arguments after npm are given to the npm executable. E.g.:
docker compose run --rm npm run buildWill perform the equivalent of npm run build.
Use the following to get the 30 latest log entries for the app service.
docker compose logs app -n 30Or use -f to follow the logs:
docker compose logs -f -n 30 appTo get a list of available redeems and their configuration, run the following snippet in the console on a page with Twitch chat open.
const redeems = [];
for (const reward of document.querySelectorAll('.rewards-list>div')) {
const icon = reward.querySelector('.reward-icon');
if (!icon) {
continue;
}
const iconBackgroundColor = icon.style.backgroundColor;
const iconUrl = icon.querySelector('img').src;
const title = reward.querySelector('p[title]').innerText;
const channelPoints = reward.querySelector('.reward-icon__cost p').innerText;
redeems.push({title, channelPoints, iconBackgroundColor, iconUrl});
}
console.log({redeems});This list can be used to update src/content/redeems.ts.