https://github.com/webkom/brus
https://github.com/webkom/brus
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/webkom/brus
- Owner: webkom
- Created: 2019-08-20T12:49:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2026-04-28T17:07:55.000Z (about 2 months ago)
- Last Synced: 2026-04-28T19:09:17.378Z (about 2 months ago)
- Language: TypeScript
- Homepage: https://brus-frontend.webkom.now.sh
- Size: 5.31 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# brus
brus fridge tracker for Webkom. Members buy and refill drinks, balances are tracked, and a weekly shame run every Tuesday at 16:20 applies a debt penalty (`ceil(|saldo| / 100) × 30kr`) to anyone who has been negative for more than 7 days.
## Local development
### Option A — local MongoDB (safe)
```bash
docker compose up -d # starts MongoDB on localhost:27017
```
Set `.env.local`:
```
MONGODB_URI=mongodb://root:12345678@localhost:27017/brus?authSource=admin
NEXT_PUBLIC_BASE_URL=http://localhost:3000
```
### Option B — production DB via SSH tunnel
> ⚠️ **This connects to the live database.** Any buy, refill, or reset affects real data.
```bash
# 1. Get the container's internal IP on the Coolify server
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
# 2. Open the tunnel (keep this terminal open)
ssh -L 27017::27017 webkom@192.168.1.128
```
Set `.env.local`:
```
MONGODB_URI=mongodb://:@localhost:27017/brus?authSource=admin
NEXT_PUBLIC_BASE_URL=http://localhost:3000
```
### Start the dev server
```bash
yarn dev
```
## Environment variables
| Variable | Description |
| ---------------------- | ------------------------------------------------------- |
| `MONGODB_URI` | MongoDB connection string |
| `NEXT_PUBLIC_BASE_URL` | Base URL used by the cron job to call `/api/applyshame` |
| `MEMBERS_URL` | Endpoint for fetching active Webkom members |
| `MEMBERS_USERNAME` | Basic auth username for members API |
| `MEMBERS_PASSWORD` | Basic auth password for members API |
## Deploy (Coolify)
The app builds as a standalone Next.js Docker image (`output: "standalone"`). Coolify handles builds and deployments from this repo automatically on push to `master`.
Set the environment variables above in the Coolify service settings. `NEXT_PUBLIC_BASE_URL` should be the public URL of the deployed app (e.g. `https://brus.webkom.dev`).