Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52fe35dbe3
|
||
|
|
6611af68f3
|
@@ -1,12 +1,6 @@
|
|||||||
**/node_modules
|
**/node_modules
|
||||||
.git
|
.git
|
||||||
.github
|
|
||||||
.gitea
|
|
||||||
.env
|
.env
|
||||||
.env.*
|
|
||||||
*.log
|
*.log
|
||||||
logs
|
|
||||||
coverage
|
|
||||||
**/coverage
|
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
.dockerignore
|
.dockerignore
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
## Summary
|
|
||||||
|
|
||||||
<!-- Ano ang ginawa mo tell us walang fluff. -->
|
|
||||||
|
|
||||||
## Type of change
|
|
||||||
|
|
||||||
- [ ] Feature
|
|
||||||
- [ ] Bug fix
|
|
||||||
- [ ] Refactor / chore
|
|
||||||
- [ ] Docs
|
|
||||||
- [ ] Hotfix
|
|
||||||
|
|
||||||
## Related issue / ticket
|
|
||||||
|
|
||||||
Closes #
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
<!-- Bullet list ng mga actual changes. Kung malaki ang PR, group by area (backend, frontend, db, infra). -->
|
|
||||||
|
|
||||||
-
|
|
||||||
-
|
|
||||||
|
|
||||||
## How to test
|
|
||||||
|
|
||||||
<!-- Steps para ma-verify ng reviewer. Kung may env vars / migrations / seed data na kailangan, isulat dito. -->
|
|
||||||
|
|
||||||
1.
|
|
||||||
2.
|
|
||||||
|
|
||||||
## Screenshots / recordings
|
|
||||||
|
|
||||||
<!-- Kung may UI change. Delete section kung wala. -->
|
|
||||||
|
|
||||||
## Database changes
|
|
||||||
|
|
||||||
- [ ] No schema changes
|
|
||||||
- [ ] Migration included and tested on QAS
|
|
||||||
- [ ] Backward compatible (safe to rollback)
|
|
||||||
|
|
||||||
## Checklist before requesting review
|
|
||||||
|
|
||||||
- [ ] Branch is up to date with `main` / `develop`
|
|
||||||
- [ ] No leftover `console.log`, commented-out code, or debug flags
|
|
||||||
- [ ] Env vars / secrets documented (not committed)
|
|
||||||
- [ ] Tested locally (and on QAS if applicable)
|
|
||||||
- [ ] No unrelated files included in diff
|
|
||||||
|
|
||||||
## Notes for reviewer
|
|
||||||
|
|
||||||
<!-- Anything tricky, known limitations, or follow-up work na hindi kasama dito. -->
|
|
||||||
@@ -97,7 +97,4 @@ jobs:
|
|||||||
cp "$HOME/new_starr/.env" .env
|
cp "$HOME/new_starr/.env" .env
|
||||||
docker compose -p new_starr up -d --build --remove-orphans
|
docker compose -p new_starr up -d --build --remove-orphans
|
||||||
docker compose -p new_starr ps
|
docker compose -p new_starr ps
|
||||||
# Reclaim space: superseded image layers and build cache older than 3 days.
|
|
||||||
docker image prune -f
|
|
||||||
docker builder prune -f --filter until=72h
|
|
||||||
REMOTE
|
REMOTE
|
||||||
|
|||||||
@@ -2,20 +2,19 @@
|
|||||||
**Version:** 1.0.0
|
**Version:** 1.0.0
|
||||||
**Date:** October 6, 2025
|
**Date:** October 6, 2025
|
||||||
**Stack:** Node.js · Express · Sequelize (PostgreSQL) · Google OAuth 2.0 · Nodemailer
|
**Stack:** Node.js · Express · Sequelize (PostgreSQL) · Google OAuth 2.0 · Nodemailer
|
||||||
**Features:** Courses, Units, Lessons, Training, Subscriptionss)
|
**Features** Courses, Units, Lessons, Training, Subscriptions
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
Every contributors must take note that we have [Gitea](https://gitea.orij.space/kennethscoffee/starr-philproperties) owned by us independently so create your account here, We expect that you are in `dev/safe` branch so we recommend to have your own forked repository in Gitea here's summary:
|
We remind everyone to work with `dev/safe` branch and we recommend to have your own forked repository here's breakdown:
|
||||||
|
|
||||||
```
|
```
|
||||||
BRANCH_NAME | DESCRIPTION
|
BRANCH_NAME | DESCRIPTION
|
||||||
-------------------------
|
-------------------------
|
||||||
main - A protected branch maintain by creators (Any commits from other will be automatically rejected)
|
main - Protected branch supposedly maintain by creators
|
||||||
staging-qa - Everytime na may Pull Requests (PR) from your forked repository dito mismo
|
staging-qa - Everytime na may Pull Requests (PR) from your forked repository dito mismo sa branch na ito kami mag-check per feature, per modification and also bug.
|
||||||
sa branch na ito kami mag-check per feature, per modification and also bug.
|
staging-uat - Supposedly has working Github Action so I will tell about it.
|
||||||
staging-uat - Working in progress so I will tell more about it.
|
dev/safe - In your forked repository always use this branch
|
||||||
dev/safe - With your forked repository this is default branch
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Self-hosting
|
## Self-hosting
|
||||||
See [Wiki](https://gitea.orij.space/kennethscoffee/starr-philproperties/wiki/Self-hosting-%28Docker%29)
|
See [SELF_HOSTING.md](./SELF_HOSTING.md) for the full Docker Compose setup guide.
|
||||||
|
|||||||
+226
@@ -0,0 +1,226 @@
|
|||||||
|
# Self-Hosting `new_starr` (Docker Compose) — Step-by-Step
|
||||||
|
|
||||||
|
### ***Video tutorial soon***
|
||||||
|
|
||||||
|
This stack bundles everything: PostgreSQL, Valkey (Redis), Garage (S3), the API, and the
|
||||||
|
frontend. Battle-tested end-to-end on a completely fresh Debian machine on 2026-08-29
|
||||||
|
every gotcha below actually happened once and is now fixed or documented.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 0. What you need
|
||||||
|
|
||||||
|
- Docker Engine + Compose plugin
|
||||||
|
- Node.js 22 + pnpm (only needed once, to build the frontend bundle)
|
||||||
|
- Git access to this repo
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Install Docker
|
||||||
|
|
||||||
|
This block auto-detects `debian` vs `ubuntu` from `/etc/os-release` **and** probes
|
||||||
|
Docker's repo for your codename before adding it — if your codename is too new and 404s
|
||||||
|
(interim/dev releases lag Docker's repo by months), it automatically falls back to the
|
||||||
|
latest codename Docker actually publishes for your distro. No manual edits needed:
|
||||||
|
```bash
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y ca-certificates curl gnupg
|
||||||
|
sudo install -m 0755 -d /etc/apt/keyrings
|
||||||
|
|
||||||
|
. /etc/os-release
|
||||||
|
DOCKER_DISTRO="$ID" # debian or ubuntu
|
||||||
|
DOCKER_CODENAME="$VERSION_CODENAME"
|
||||||
|
|
||||||
|
# Fallback list, newest first, per distro — used only if the detected codename 404s
|
||||||
|
case "$DOCKER_DISTRO" in
|
||||||
|
ubuntu) FALLBACKS="noble jammy focal" ;;
|
||||||
|
debian) FALLBACKS="bookworm bullseye" ;;
|
||||||
|
*) echo "Unsupported distro '$DOCKER_DISTRO' — Docker only publishes debian/ubuntu repos." >&2; exit 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if ! curl -fsSL -o /dev/null "https://download.docker.com/linux/${DOCKER_DISTRO}/dists/${DOCKER_CODENAME}/Release"; then
|
||||||
|
echo "Docker has no repo for ${DOCKER_DISTRO} ${DOCKER_CODENAME} yet, falling back..." >&2
|
||||||
|
for fb in $FALLBACKS; do
|
||||||
|
if curl -fsSL -o /dev/null "https://download.docker.com/linux/${DOCKER_DISTRO}/dists/${fb}/Release"; then
|
||||||
|
DOCKER_CODENAME="$fb"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "Using ${DOCKER_DISTRO} ${DOCKER_CODENAME}" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl -fsSL "https://download.docker.com/linux/${DOCKER_DISTRO}/gpg" | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
|
sudo chmod a+r /etc/apt/keyrings/docker.gpg
|
||||||
|
|
||||||
|
echo \
|
||||||
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/${DOCKER_DISTRO} \
|
||||||
|
${DOCKER_CODENAME} stable" | \
|
||||||
|
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||||
|
```
|
||||||
|
(The `FALLBACKS` lists above are current as of 2026-08 — bump them if Docker ships a
|
||||||
|
newer stable codename by the time you read this.)
|
||||||
|
|
||||||
|
Let your user run Docker without `sudo`:
|
||||||
|
```bash
|
||||||
|
sudo usermod -aG docker $USER
|
||||||
|
newgrp docker
|
||||||
|
docker compose version # sanity check
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Clone & install
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone git@github.com:rgrgogu/new_starr.git
|
||||||
|
cd new_starr
|
||||||
|
corepack enable && corepack prepare pnpm@11.3.0 --activate
|
||||||
|
pnpm install
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Configure environment — **three** files, not two
|
||||||
|
|
||||||
|
### `apps/api/.env`
|
||||||
|
```bash
|
||||||
|
cp apps/api/.env-production apps/api/.env
|
||||||
|
```
|
||||||
|
Fill in every `CHANGE_ME`. For a **local bundled stack** (as opposed to CockroachDB
|
||||||
|
Cloud / managed S3), these specific values matter:
|
||||||
|
```env
|
||||||
|
DB_HOST=postgres
|
||||||
|
DB_PORT=5432
|
||||||
|
DB_SSL=false # bundled Postgres has no TLS
|
||||||
|
CACHE_DRIVER=redis
|
||||||
|
REDIS_URL=redis://valkey:6379
|
||||||
|
S3_ENDPOINT=http://garage:3900
|
||||||
|
GARAGE_RPC_SECRET=<openssl rand -hex 32>
|
||||||
|
```
|
||||||
|
Generate every secret independently:
|
||||||
|
```bash
|
||||||
|
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
|
||||||
|
```
|
||||||
|
|
||||||
|
### `apps/web/.env`
|
||||||
|
```bash
|
||||||
|
cd apps/web && cp .env.example .env
|
||||||
|
```
|
||||||
|
Fill in `VITE_API_URL`, `VITE_APP_URL`, etc., then `cd ../..`.
|
||||||
|
|
||||||
|
### Root `new_starr/.env` — easy to miss, causes silent failures
|
||||||
|
`docker-compose.yml`'s bundled `postgres` service reads `${DB_NAME}`, `${DB_USER}`,
|
||||||
|
`${DB_PASSWORD}` from a **root-level** `.env` — NOT from `apps/api/.env`. Create it
|
||||||
|
separately, with **exactly the same values** as the DB block you just put in
|
||||||
|
`apps/api/.env`:
|
||||||
|
```env
|
||||||
|
DB_NAME=starr
|
||||||
|
DB_USER=starr
|
||||||
|
DB_PASSWORD=<same password as apps/api/.env>
|
||||||
|
```
|
||||||
|
⚠️ Postgres only reads these once, at first-ever container start, and bakes them into
|
||||||
|
its data volume. If the two files ever drift apart afterward, you'll get
|
||||||
|
`password authentication failed` even though everything "looks" configured — fix by
|
||||||
|
making `apps/api/.env` match what's actually in the volume (the root `.env` value at
|
||||||
|
the time Postgres first started), not the other way around.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Build the frontend bundle *before* building images
|
||||||
|
|
||||||
|
`apps/web/Dockerfile` only copies a pre-built `dist/` — it does not run the build itself:
|
||||||
|
```bash
|
||||||
|
pnpm --filter web build
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Bring the stack up
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose up -d --build
|
||||||
|
docker compose ps # all 5 services should show Up/healthy
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. One-time Garage (S3) cluster init
|
||||||
|
|
||||||
|
Garage's image ships only a static binary — no shell — so this can't be scripted as a
|
||||||
|
container entrypoint; it's a manual one-time step:
|
||||||
|
```bash
|
||||||
|
docker compose exec garage /garage node id
|
||||||
|
```
|
||||||
|
Copy the ID (the part **before** the `@host:port`), then:
|
||||||
|
```bash
|
||||||
|
docker compose exec garage /garage layout assign <NODE_ID> -z dc1 -c 100G
|
||||||
|
docker compose exec garage /garage layout apply --version 1
|
||||||
|
docker compose exec garage /garage bucket create <S3_BUCKET>
|
||||||
|
docker compose exec garage /garage key import <S3_ACCESS_KEY> <S3_SECRET_KEY> -n starr-app --yes
|
||||||
|
docker compose exec garage /garage bucket allow <S3_BUCKET> --read --write --owner --key <S3_ACCESS_KEY>
|
||||||
|
```
|
||||||
|
(`S3_BUCKET`/`S3_ACCESS_KEY`/`S3_SECRET_KEY` are whatever you set in `apps/api/.env`.)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Run database migrations
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose exec backend sequelize-cli db:migrate
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. Verify
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose ps
|
||||||
|
```
|
||||||
|
- Frontend: **http://localhost:4650**
|
||||||
|
- Backend: http://localhost:3024/api
|
||||||
|
|
||||||
|
If both respond, you're done with local testing.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 9. (Optional) Put a real domain + HTTPS in front
|
||||||
|
|
||||||
|
For actually deploying this somewhere reachable, use the `Caddyfile` at the repo root
|
||||||
|
as a template. It's a standalone Caddy install on the host (not part of
|
||||||
|
`docker-compose.yml`) that reverse-proxies 3 domains to the 3 ports already published
|
||||||
|
above (`:4650`, `:3024`, `:3900`) and handles Let's Encrypt certificates automatically.
|
||||||
|
See the comments at the top of `Caddyfile` for exact steps. Not needed for local
|
||||||
|
`localhost:4650` testing — skip this until you're pointing a real domain at the
|
||||||
|
machine.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Troubleshooting — real errors hit while writing this guide
|
||||||
|
|
||||||
|
| Symptom | Cause | Fix |
|
||||||
|
|---|---|---|
|
||||||
|
| `apt` 404: `.../linux/<distro> <codename> Release` not found | Step 1's install block already auto-detects and falls back — this only happens if you ran the old manual commands, or your codename is newer than every entry in `FALLBACKS` | Re-run Step 1's block as-is, or add your distro's actual latest stable codename to `FALLBACKS` |
|
||||||
|
| `permission denied ... docker.sock` | User not in the `docker` group | `sudo usermod -aG docker $USER && newgrp docker` |
|
||||||
|
| `WARN: "DB_NAME" variable is not set` (and similar) | Root `new_starr/.env` missing | Create it (see step 3) |
|
||||||
|
| `postgres` container stuck `Restarting` | `POSTGRES_PASSWORD` blank (same root `.env` issue) | Same fix as above |
|
||||||
|
| `exec: "/bin/sh": stat /bin/sh: no such file or directory` | Some images (like Garage's) ship no shell at all — never wrap their entrypoint in `/bin/sh` | Use the image's default command; do cluster setup via `docker exec <container> <binary>` directly (no shell needed) |
|
||||||
|
| Garage crash-loops: `rpc_secret value is missing` | `GARAGE_RPC_SECRET` not set in `apps/api/.env` | Set it, then `docker compose up -d --force-recreate garage` |
|
||||||
|
| `password authentication failed for user ...` | `apps/api/.env` and root `.env` DB passwords don't match exactly | Make them match; Postgres only honors whatever was set at first boot |
|
||||||
|
| Fixed a file but the same error keeps happening | Images bake in code at **build** time — there's no live volume mount | `docker compose up -d --build <service>` after any source change |
|
||||||
|
| `ERROR: Unknown constraint error` during migrate | Sequelize hides the real Postgres error behind this generic message | Run the raw SQL directly via `docker compose exec postgres psql -U <user> -d <db>` to see the actual cause |
|
||||||
|
| Migration uses `STRING` as a raw SQL type | CockroachDB alias, not valid in real Postgres | Already fixed in this repo (swapped to `TEXT`, which works on both) |
|
||||||
|
| A service vanishes from `docker compose ps` | A previous `up` was scoped to one service (e.g. `up -d --build backend`), which doesn't touch others | Run a plain `docker compose up -d` (no service name) to restore everything |
|
||||||
|
| Browser: "Unable to connect" | Either the container isn't actually running, or you're browsing from a different machine than the one running Docker | Check `docker compose ps` first; `localhost` only resolves to the machine Docker is on |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- Frontend is served on **`:4650`**, not `:80` — change `frontend.ports` in
|
||||||
|
`docker-compose.yml` if you want a different port.
|
||||||
|
- Cluster init for Garage is intentionally manual (step 6) — the old automated
|
||||||
|
`garage-init.sh` approach was removed because it depended on a shell that doesn't
|
||||||
|
exist in the Garage image.
|
||||||
+12
-53
@@ -1,70 +1,29 @@
|
|||||||
# syntax=docker/dockerfile:1
|
FROM pandoc/typst:latest-alpine AS typst
|
||||||
|
|
||||||
# ─────────────────────────────────────────────────────────────────────────────
|
FROM node:22-alpine
|
||||||
# api — production image
|
|
||||||
#
|
# Enable corepack and activate pnpm
|
||||||
# Two stages. `deps` installs production dependencies only, then the final
|
RUN corepack enable && corepack prepare pnpm@11.3.0 --activate
|
||||||
# stage receives just the runtime artifacts. Everything pnpm keeps for
|
|
||||||
# itself (content-addressable store, metadata cache, npm cache) stays behind
|
# pm2 manages the process; sequelize-cli runs migrations on startup
|
||||||
# in the build stage, so it never inflates the shipped image.
|
RUN npm install -g pm2 sequelize-cli
|
||||||
# ─────────────────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
# Typst — compiles certificate.typ into the downloadable PDF certificate.
|
# Typst — compiles certificate.typ into the downloadable PDF certificate.
|
||||||
# Not available as an apk package, so lift the binary out of pandoc/typst.
|
# Not available as an apk package, so lift the binary out of pandoc/typst.
|
||||||
FROM pandoc/typst:latest-alpine AS typst
|
COPY --from=typst /usr/local/bin/typst /usr/local/bin/typst
|
||||||
|
|
||||||
# ── Stage 1: dependencies (production only) ──────────────────────────────────
|
|
||||||
FROM node:22-alpine AS deps
|
|
||||||
|
|
||||||
RUN corepack enable && corepack prepare pnpm@11.3.0 --activate
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Workspace manifests first (cache-friendly), then a filtered install —
|
# Workspace manifests first (cache-friendly), then a filtered install —
|
||||||
# pnpm needs every workspace package's manifest present to resolve the
|
# pnpm needs every workspace package's manifest present to resolve the
|
||||||
# graph even though only apps/api's deps get installed here. pnpm-lock.yaml
|
# graph even though only apps/api's deps get installed here. pnpm-lock.yaml
|
||||||
# is gitignored (not committed), so this resolves fresh rather than
|
# is gitignored (not committed), so this resolves fresh on every build
|
||||||
# installing from a frozen lockfile.
|
# rather than installing from a frozen lockfile.
|
||||||
COPY package.json pnpm-workspace.yaml ./
|
COPY package.json pnpm-workspace.yaml ./
|
||||||
COPY apps/api/package.json ./apps/api/package.json
|
COPY apps/api/package.json ./apps/api/package.json
|
||||||
COPY apps/web/package.json ./apps/web/package.json
|
COPY apps/web/package.json ./apps/web/package.json
|
||||||
|
RUN pnpm install --filter api...
|
||||||
|
|
||||||
# --prod skips jest / nodemon / concurrently. The pnpm store is deleted in
|
|
||||||
# the same layer: node_modules entries are hardlinks, so they survive the
|
|
||||||
# delete while ~500 MB of duplicate store files do not.
|
|
||||||
#
|
|
||||||
# ffprobe-static ships ffprobe for darwin/linux/win32 + ia32/x64 (~335 MB).
|
|
||||||
# The runtime image installs the distro ffmpeg instead (see below), which both
|
|
||||||
# services prefer via `which ffprobe`, so only the package stub is kept.
|
|
||||||
RUN pnpm install --filter api... --prod --no-frozen-lockfile \
|
|
||||||
&& rm -rf /root/.local/share/pnpm /root/.cache/pnpm /root/.cache/node /root/.npm \
|
|
||||||
&& rm -rf /app/node_modules/.pnpm/ffprobe-static@*/node_modules/ffprobe-static/bin
|
|
||||||
|
|
||||||
# ── Stage 2: runtime ─────────────────────────────────────────────────────────
|
|
||||||
FROM node:22-alpine
|
|
||||||
|
|
||||||
# sequelize-cli stays available for manual `db:migrate` runs on the droplet;
|
|
||||||
# the npm cache is cleared in the same layer so it never ships.
|
|
||||||
#
|
|
||||||
# ffmpeg brings ffprobe with it and is what the mov/mkv fast-start remux
|
|
||||||
# (services/ffmpeg.service.js) actually needs — ffprobe-static never shipped an
|
|
||||||
# ffmpeg binary. Costs ~100 MB unpacked (libavcodec/x265/aom), still far less
|
|
||||||
# than the 335 MB of removed ffprobe-static binaries.
|
|
||||||
RUN apk add --no-cache ffmpeg \
|
|
||||||
&& npm install -g --no-audit --no-fund sequelize-cli@^6.6.5 \
|
|
||||||
&& npm cache clean --force \
|
|
||||||
&& rm -rf /root/.npm
|
|
||||||
|
|
||||||
COPY --from=typst /usr/local/bin/typst /usr/local/bin/typst
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Symlinks inside pnpm's node_modules are relative, so copying the same
|
|
||||||
# directory layout keeps them resolving correctly.
|
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
|
||||||
COPY --from=deps /app/apps/api/node_modules ./apps/api/node_modules
|
|
||||||
|
|
||||||
COPY package.json pnpm-workspace.yaml ./
|
|
||||||
COPY apps/api ./apps/api
|
COPY apps/api ./apps/api
|
||||||
|
|
||||||
WORKDIR /app/apps/api
|
WORKDIR /app/apps/api
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Docker's `restart: unless-stopped` policy handles crash recovery, so the
|
exec pm2-runtime start server.js --name "${APP_NAME:-app}"
|
||||||
# process supervisor (pm2) is not shipped — it costs image size and ~40 MB RSS
|
|
||||||
# on a 2 GB droplet. node runs as PID 1 and receives SIGTERM directly.
|
|
||||||
exec node server.js
|
|
||||||
|
|||||||
+26
-26
@@ -15,43 +15,43 @@
|
|||||||
"db:seed:undo": "sequelize-cli db:seed:undo:all"
|
"db:seed:undo": "sequelize-cli db:seed:undo:all"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.1157.0",
|
"@aws-sdk/client-s3": "^3.1068.0",
|
||||||
"@aws-sdk/lib-storage": "^3.1157.0",
|
"@aws-sdk/lib-storage": "^3.1085.0",
|
||||||
"@aws-sdk/s3-request-presigner": "^3.1157.0",
|
"@aws-sdk/s3-request-presigner": "^3.1068.0",
|
||||||
"axios": "^1.21.0",
|
"axios": "^1.16.0",
|
||||||
"bcryptjs": "^2.4.3",
|
"bcryptjs": "^2.4.3",
|
||||||
"connect-pg-simple": "^10.0.0",
|
"connect-pg-simple": "^10.0.0",
|
||||||
"cookie-parser": "^1.4.7",
|
"cookie-parser": "^1.4.6",
|
||||||
"cors": "^2.8.6",
|
"cors": "^2.8.5",
|
||||||
"csurf": "^1.11.0",
|
"csurf": "^1.11.0",
|
||||||
"currency-codes": "^2.2.0",
|
"currency-codes": "^2.2.0",
|
||||||
"dotenv": "^16.6.1",
|
"dotenv": "^16.0.3",
|
||||||
"express": "^4.22.3",
|
"express": "^4.18.2",
|
||||||
"express-rate-limit": "^6.11.2",
|
"express-rate-limit": "^6.10.0",
|
||||||
"express-session": "^1.19.0",
|
"express-session": "^1.17.3",
|
||||||
"express-validator": "^7.3.2",
|
"express-validator": "^7.0.1",
|
||||||
"ffprobe-static": "^3.1.0",
|
"ffprobe-static": "^3.1.0",
|
||||||
"fluent-ffmpeg": "^2.1.3",
|
"fluent-ffmpeg": "^2.1.3",
|
||||||
"form-data": "^4.0.6",
|
"form-data": "^4.0.5",
|
||||||
"google-auth-library": "^9.15.1",
|
"google-auth-library": "^9.0.0",
|
||||||
"http-proxy-middleware": "^4.2.1",
|
"http-proxy-middleware": "^4.0.0",
|
||||||
"jsonwebtoken": "^9.0.3",
|
"jsonwebtoken": "^9.0.1",
|
||||||
"multer": "^2.5.0",
|
"multer": "^2.1.1",
|
||||||
"node-cron": "^4.6.0",
|
"node-cron": "^4.2.1",
|
||||||
"nodemailer": "^6.10.1",
|
"nodemailer": "^6.9.5",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"pg": "^8.23.1",
|
"pg": "^8.11.3",
|
||||||
"pg-hstore": "^2.3.4",
|
"pg-hstore": "^2.3.4",
|
||||||
"rate-limit-redis": "^4.3.1",
|
"rate-limit-redis": "^4.0.0",
|
||||||
"redis": "^4.7.1",
|
"redis": "^4.6.7",
|
||||||
"sequelize": "^6.37.8",
|
"sequelize": "^6.32.1",
|
||||||
"sharp": "^0.35.5",
|
"sharp": "^0.35.3",
|
||||||
"ua-parser-js": "^2.0.10",
|
"ua-parser-js": "^2.0.10",
|
||||||
"uuid": "^9.0.1"
|
"uuid": "^9.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jest": "^30.5.2",
|
"jest": "^30.4.2",
|
||||||
"nodemon": "^3.1.14",
|
"nodemon": "^3.0.1",
|
||||||
"sequelize-cli": "^6.6.5"
|
"sequelize-cli": "^6.6.5"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
|
|||||||
+36
-36
@@ -10,61 +10,61 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@base-ui/react": "^1.9.0",
|
"@base-ui/react": "^1.4.1",
|
||||||
"@fontsource-variable/geist": "^5.3.0",
|
"@fontsource-variable/geist": "^5.2.8",
|
||||||
"@hookform/resolvers": "^5.9.2",
|
"@hookform/resolvers": "^5.2.2",
|
||||||
"@radix-ui/react-tabs": "^1.2.1",
|
"@radix-ui/react-tabs": "^1.1.13",
|
||||||
"@tailwindcss/vite": "^4.3.3",
|
"@tailwindcss/vite": "^4.2.4",
|
||||||
"@tanstack/react-table": "^8.21.3",
|
"@tanstack/react-table": "^8.21.3",
|
||||||
"@tauri-apps/api": "^2.12.4",
|
"@tauri-apps/api": "^2.11.0",
|
||||||
"axios": "^1.21.0",
|
"axios": "^1.16.0",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"cmdk": "^1.1.1",
|
"cmdk": "^1.1.1",
|
||||||
"date-fns": "^4.4.0",
|
"date-fns": "^4.1.0",
|
||||||
"embla-carousel-react": "^8.6.0",
|
"embla-carousel-react": "^8.6.0",
|
||||||
"framer-motion": "^12.43.0",
|
"framer-motion": "^12.38.0",
|
||||||
"input-otp": "^1.5.0",
|
"input-otp": "^1.4.2",
|
||||||
"lucide-react": "^1.62.0",
|
"lucide-react": "^1.14.0",
|
||||||
"nanoid": "^5.1.16",
|
"nanoid": "^5.1.11",
|
||||||
"next-themes": "^0.4.6",
|
"next-themes": "^0.4.6",
|
||||||
"pdfjs-dist": "^6.4.299",
|
"pdfjs-dist": "^6.0.227",
|
||||||
"qrcode.react": "^4.2.0",
|
"qrcode.react": "^4.2.0",
|
||||||
"radix-ui": "^1.8.1",
|
"radix-ui": "^1.4.3",
|
||||||
"react": "^19.3.1",
|
"react": "^19.2.5",
|
||||||
"react-day-picker": "^9.14.0",
|
"react-day-picker": "^9.14.0",
|
||||||
"react-dom": "^19.3.1",
|
"react-dom": "^19.2.5",
|
||||||
"react-easy-crop": "^6.2.4",
|
"react-easy-crop": "^6.0.2",
|
||||||
"react-helmet-async": "^3.0.0",
|
"react-helmet-async": "^3.0.0",
|
||||||
"react-hook-form": "^7.91.0",
|
"react-hook-form": "^7.75.0",
|
||||||
"react-icons": "^5.7.0",
|
"react-icons": "^5.6.0",
|
||||||
"react-markdown": "^10.1.0",
|
"react-markdown": "^10.1.0",
|
||||||
"react-phone-number-input": "^3.4.18",
|
"react-phone-number-input": "^3.4.17",
|
||||||
"react-photo-view": "^1.2.7",
|
"react-photo-view": "^1.2.7",
|
||||||
"react-resizable-panels": "^4.15.0",
|
"react-resizable-panels": "^4.11.0",
|
||||||
"react-router-dom": "^7.18.4",
|
"react-router-dom": "^7.14.2",
|
||||||
"recharts": "3.8.0",
|
"recharts": "3.8.0",
|
||||||
"remark-gfm": "^4.0.1",
|
"remark-gfm": "^4.0.1",
|
||||||
"shadcn": "^4.23.0",
|
"shadcn": "^4.6.0",
|
||||||
"sonner": "^2.0.8",
|
"sonner": "^2.0.7",
|
||||||
"tailwind-merge": "^3.7.0",
|
"tailwind-merge": "^3.5.0",
|
||||||
"tw-animate-css": "^1.4.0",
|
"tw-animate-css": "^1.4.0",
|
||||||
"vaul": "^1.1.2",
|
"vaul": "^1.1.2",
|
||||||
"xlsx-js-style": "^1.2.0",
|
"xlsx-js-style": "^1.2.0",
|
||||||
"zod": "^4.6.7"
|
"zod": "^4.4.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@types/react": "^19.3.0",
|
"@types/react": "^19.2.14",
|
||||||
"@types/react-dom": "^19.3.0",
|
"@types/react-dom": "^19.2.3",
|
||||||
"@vitejs/plugin-react": "^6.1.2",
|
"@vitejs/plugin-react": "^6.0.1",
|
||||||
"autoprefixer": "^10.6.2",
|
"autoprefixer": "^10.5.0",
|
||||||
"eslint": "^10.13.0",
|
"eslint": "^10.2.1",
|
||||||
"eslint-plugin-react-hooks": "^7.1.1",
|
"eslint-plugin-react-hooks": "^7.1.1",
|
||||||
"eslint-plugin-react-refresh": "^0.5.7",
|
"eslint-plugin-react-refresh": "^0.5.2",
|
||||||
"globals": "^17.13.0",
|
"globals": "^17.5.0",
|
||||||
"postcss": "^8.5.32",
|
"postcss": "^8.5.13",
|
||||||
"tailwindcss": "^4.3.3",
|
"tailwindcss": "^4.2.4",
|
||||||
"vite": "^8.3.5"
|
"vite": "^8.0.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@ export const LessonCard = ({ lesson, tierMap = {}, onViewDetails }) => {
|
|||||||
const unitCount = Number(lesson.unit_count ?? 0);
|
const unitCount = Number(lesson.unit_count ?? 0);
|
||||||
const courses = lesson.courses ?? [];
|
const courses = lesson.courses ?? [];
|
||||||
const slug = cheapestTierSlug(courses.map((c) => c.subscription), tierMap);
|
const slug = cheapestTierSlug(courses.map((c) => c.subscription), tierMap);
|
||||||
const { label, cls, panel } = resolveTierBadge(slug, tierMap);
|
const { label, cls } = resolveTierBadge(slug, tierMap);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -32,7 +32,7 @@ export const LessonCard = ({ lesson, tierMap = {}, onViewDetails }) => {
|
|||||||
"bg-card rounded-2xl border p-4 flex flex-col gap-2.5 transition-all cursor-pointer group",
|
"bg-card rounded-2xl border p-4 flex flex-col gap-2.5 transition-all cursor-pointer group",
|
||||||
"hover:shadow-sm",
|
"hover:shadow-sm",
|
||||||
locked
|
locked
|
||||||
? cn("opacity-80 hover:opacity-100", panel.bg, panel.border)
|
? "opacity-80 hover:opacity-100 hover:border-muted-foreground/40"
|
||||||
: "hover:bg-muted/60 dark:hover:border-blue-500"
|
: "hover:bg-muted/60 dark:hover:border-blue-500"
|
||||||
)}
|
)}
|
||||||
onClick={() => onViewDetails(lesson)}
|
onClick={() => onViewDetails(lesson)}
|
||||||
@@ -43,7 +43,7 @@ export const LessonCard = ({ lesson, tierMap = {}, onViewDetails }) => {
|
|||||||
{label}
|
{label}
|
||||||
</Badge>
|
</Badge>
|
||||||
{locked && (
|
{locked && (
|
||||||
<Badge variant="secondary" className="bg-white dark:bg-white/15 dark:text-white dark:border-white/15">
|
<Badge variant="secondary">
|
||||||
<LockIcon className="size-3" /> Locked
|
<LockIcon className="size-3" /> Locked
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
@@ -53,9 +53,11 @@ export const LessonCard = ({ lesson, tierMap = {}, onViewDetails }) => {
|
|||||||
<h1 className="text-lg font-medium leading-snug line-clamp-3 transition-colors group-hover:text-blue-700 dark:group-hover:text-blue-400">
|
<h1 className="text-lg font-medium leading-snug line-clamp-3 transition-colors group-hover:text-blue-700 dark:group-hover:text-blue-400">
|
||||||
{lesson.title}
|
{lesson.title}
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-sm leading-relaxed line-clamp-2 text-muted-foreground">
|
{lesson.description && (
|
||||||
{lesson.description || "No information yet provided"}
|
<p className="text-sm leading-relaxed line-clamp-2 group-hover:text-blue-700 dark:group-hover:text-blue-400">
|
||||||
|
{lesson.description}
|
||||||
</p>
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between pt-2 mt-auto border-t">
|
<div className="flex items-center justify-between pt-2 mt-auto border-t">
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export const UnitCard = ({ unit, tierMap = {}, onViewDetails }) => {
|
|||||||
const lessonCount = Number(unit.lesson_count ?? 0);
|
const lessonCount = Number(unit.lesson_count ?? 0);
|
||||||
const courses = unit.courses ?? [];
|
const courses = unit.courses ?? [];
|
||||||
const slug = cheapestTierSlug([unit.subscription, ...courses.map((c) => c.subscription)], tierMap);
|
const slug = cheapestTierSlug([unit.subscription, ...courses.map((c) => c.subscription)], tierMap);
|
||||||
const { label, cls, panel } = resolveTierBadge(slug, tierMap);
|
const { label, cls } = resolveTierBadge(slug, tierMap);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -30,7 +30,7 @@ export const UnitCard = ({ unit, tierMap = {}, onViewDetails }) => {
|
|||||||
"bg-card rounded-2xl border p-4 flex flex-col gap-2.5 transition-all cursor-pointer group",
|
"bg-card rounded-2xl border p-4 flex flex-col gap-2.5 transition-all cursor-pointer group",
|
||||||
"hover:shadow-sm",
|
"hover:shadow-sm",
|
||||||
locked
|
locked
|
||||||
? cn("opacity-80 hover:opacity-100", panel.bg, panel.border)
|
? "opacity-80 hover:opacity-100 hover:border-muted-foreground/40"
|
||||||
: "hover:bg-muted/60 dark:hover:border-blue-500"
|
: "hover:bg-muted/60 dark:hover:border-blue-500"
|
||||||
)}
|
)}
|
||||||
onClick={() => onViewDetails(unit)}
|
onClick={() => onViewDetails(unit)}
|
||||||
@@ -41,7 +41,7 @@ export const UnitCard = ({ unit, tierMap = {}, onViewDetails }) => {
|
|||||||
{label}
|
{label}
|
||||||
</Badge>
|
</Badge>
|
||||||
{locked && (
|
{locked && (
|
||||||
<Badge variant="secondary" className="bg-white dark:bg-white/15 dark:text-white dark:border-white/15">
|
<Badge variant="secondary">
|
||||||
<LockIcon className="size-3" /> Locked
|
<LockIcon className="size-3" /> Locked
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
@@ -51,9 +51,11 @@ export const UnitCard = ({ unit, tierMap = {}, onViewDetails }) => {
|
|||||||
<h1 className="text-lg font-medium leading-snug line-clamp-3 transition-colors group-hover:text-blue-700 dark:group-hover:text-blue-400">
|
<h1 className="text-lg font-medium leading-snug line-clamp-3 transition-colors group-hover:text-blue-700 dark:group-hover:text-blue-400">
|
||||||
{unit.title}
|
{unit.title}
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-sm leading-relaxed line-clamp-2 text-muted-foreground">
|
{unit.description && (
|
||||||
{unit.description || "No information yet provided"}
|
<p className="text-sm leading-relaxed line-clamp-2 group-hover:text-blue-700 dark:group-hover:text-blue-400">
|
||||||
|
{unit.description}
|
||||||
</p>
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between pt-2 mt-auto border-t">
|
<div className="flex items-center justify-between pt-2 mt-auto border-t">
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const CourseCard = ({ course, tierMap, onViewDetails }) => {
|
|||||||
const slug = course.subscription ?? "free";
|
const slug = course.subscription ?? "free";
|
||||||
const locked = course.is_locked;
|
const locked = course.is_locked;
|
||||||
const duration = formatDuration(course.duration_seconds);
|
const duration = formatDuration(course.duration_seconds);
|
||||||
const { rank, label, cls, panel } = resolveTierBadge(slug, tierMap);
|
const { rank, label, cls } = resolveTierBadge(slug, tierMap);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -45,7 +45,7 @@ const CourseCard = ({ course, tierMap, onViewDetails }) => {
|
|||||||
"bg-card rounded-2xl border p-4 flex flex-col gap-2.5 transition-all cursor-pointer group",
|
"bg-card rounded-2xl border p-4 flex flex-col gap-2.5 transition-all cursor-pointer group",
|
||||||
"hover:shadow-sm",
|
"hover:shadow-sm",
|
||||||
locked
|
locked
|
||||||
? cn("opacity-80 hover:opacity-100", panel.bg, panel.border)
|
? "opacity-80 hover:opacity-100 hover:border-muted-foreground/40"
|
||||||
: "hover:bg-muted/60 dark:hover:border-blue-500"
|
: "hover:bg-muted/60 dark:hover:border-blue-500"
|
||||||
)}
|
)}
|
||||||
onClick={() => onViewDetails(course)}
|
onClick={() => onViewDetails(course)}
|
||||||
@@ -62,7 +62,7 @@ const CourseCard = ({ course, tierMap, onViewDetails }) => {
|
|||||||
<Badge key={cat.id} variant="outline"><Tags /> {cat.name}</Badge>
|
<Badge key={cat.id} variant="outline"><Tags /> {cat.name}</Badge>
|
||||||
))}
|
))}
|
||||||
{locked && (
|
{locked && (
|
||||||
<Badge variant="secondary" className="bg-white dark:bg-white/15 dark:text-white dark:border-white/15">
|
<Badge variant="secondary">
|
||||||
<LockIcon className="size-3" /> Locked
|
<LockIcon className="size-3" /> Locked
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
@@ -72,9 +72,11 @@ const CourseCard = ({ course, tierMap, onViewDetails }) => {
|
|||||||
<h1 className="text-lg font-medium leading-snug line-clamp-3 transition-colors group-hover:text-blue-700 dark:group-hover:text-blue-400">
|
<h1 className="text-lg font-medium leading-snug line-clamp-3 transition-colors group-hover:text-blue-700 dark:group-hover:text-blue-400">
|
||||||
{course.title}
|
{course.title}
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-sm leading-relaxed line-clamp-2 text-muted-foreground">
|
{course.description && (
|
||||||
{course.description || "No information yet provided"}
|
<p className="text-sm leading-relaxed line-clamp-2 group-hover:text-blue-700 dark:group-hover:text-blue-400">
|
||||||
|
{course.description}
|
||||||
</p>
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between pt-2 mt-auto border-t">
|
<div className="flex items-center justify-between pt-2 mt-auto border-t">
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const CourseCard = ({ course, onViewDetails }) => {
|
|||||||
const slug = course.subscription ?? "free";
|
const slug = course.subscription ?? "free";
|
||||||
const locked = course.is_locked;
|
const locked = course.is_locked;
|
||||||
const duration = formatDuration(course.duration_seconds);
|
const duration = formatDuration(course.duration_seconds);
|
||||||
const { rank, label, cls, panel } = resolveTierBadge(slug, tierMap);
|
const { rank, label, cls } = resolveTierBadge(slug, tierMap);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -52,7 +52,7 @@ const CourseCard = ({ course, onViewDetails }) => {
|
|||||||
"bg-card rounded-2xl border p-4 flex flex-col gap-2.5 transition-all cursor-pointer group",
|
"bg-card rounded-2xl border p-4 flex flex-col gap-2.5 transition-all cursor-pointer group",
|
||||||
"hover:shadow-sm",
|
"hover:shadow-sm",
|
||||||
locked
|
locked
|
||||||
? cn("opacity-80 hover:opacity-100", panel.bg, panel.border)
|
? "opacity-80 hover:opacity-100 hover:border-muted-foreground/40"
|
||||||
: "hover:bg-muted/60 dark:hover:border-blue-500"
|
: "hover:bg-muted/60 dark:hover:border-blue-500"
|
||||||
)}
|
)}
|
||||||
onClick={() => onViewDetails(course)}
|
onClick={() => onViewDetails(course)}
|
||||||
@@ -68,7 +68,7 @@ const CourseCard = ({ course, onViewDetails }) => {
|
|||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
{locked && (
|
{locked && (
|
||||||
<Badge variant="secondary" className="ml-auto bg-white dark:bg-white/15 dark:text-white dark:border-white/15">
|
<Badge variant="secondary" className="ml-auto">
|
||||||
<LockIcon className="size-3" /> Locked
|
<LockIcon className="size-3" /> Locked
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
@@ -78,9 +78,11 @@ const CourseCard = ({ course, onViewDetails }) => {
|
|||||||
<h1 className="text-lg font-medium leading-snug line-clamp-3 transition-colors group-hover:text-blue-700 dark:group-hover:text-blue-400">
|
<h1 className="text-lg font-medium leading-snug line-clamp-3 transition-colors group-hover:text-blue-700 dark:group-hover:text-blue-400">
|
||||||
{course.title}
|
{course.title}
|
||||||
</h1>
|
</h1>
|
||||||
|
{course.description && (
|
||||||
<p className="text-sm leading-relaxed line-clamp-2 text-muted-foreground">
|
<p className="text-sm leading-relaxed line-clamp-2 text-muted-foreground">
|
||||||
{course.description || "No information yet provided"}
|
{course.description}
|
||||||
</p>
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between pt-2 mt-auto border-t">
|
<div className="flex items-center justify-between pt-2 mt-auto border-t">
|
||||||
|
|||||||
@@ -11,73 +11,73 @@ export const TIER_COLOR_MAP = {
|
|||||||
label: "Green",
|
label: "Green",
|
||||||
swatch: "#22c55e",
|
swatch: "#22c55e",
|
||||||
badge: "bg-green-500 text-white border-0",
|
badge: "bg-green-500 text-white border-0",
|
||||||
panel: { bg: "bg-green-50 dark:bg-green-500/15", border: "border-green-200 dark:border-green-500/40" },
|
panel: { bg: "bg-green-50 dark:bg-green-950/30", border: "border-green-200 dark:border-green-800" },
|
||||||
},
|
},
|
||||||
purple: {
|
purple: {
|
||||||
label: "Purple",
|
label: "Purple",
|
||||||
swatch: "#a855f7",
|
swatch: "#a855f7",
|
||||||
badge: "bg-gradient-to-r from-fuchsia-600 to-purple-600 text-white border-0",
|
badge: "bg-gradient-to-r from-fuchsia-600 to-purple-600 text-white border-0",
|
||||||
panel: { bg: "bg-fuchsia-50 dark:bg-fuchsia-500/15", border: "border-fuchsia-200 dark:border-fuchsia-500/40" },
|
panel: { bg: "bg-fuchsia-50 dark:bg-fuchsia-950/30", border: "border-fuchsia-200 dark:border-fuchsia-800" },
|
||||||
},
|
},
|
||||||
rose: {
|
rose: {
|
||||||
label: "Rose",
|
label: "Rose",
|
||||||
swatch: "#f43f5e",
|
swatch: "#f43f5e",
|
||||||
badge: "bg-gradient-to-r from-rose-500 to-red-600 text-white border-0",
|
badge: "bg-gradient-to-r from-rose-500 to-red-600 text-white border-0",
|
||||||
panel: { bg: "bg-rose-50 dark:bg-rose-500/15", border: "border-rose-200 dark:border-rose-500/40" },
|
panel: { bg: "bg-rose-50 dark:bg-rose-950/30", border: "border-rose-200 dark:border-rose-800" },
|
||||||
},
|
},
|
||||||
amber: {
|
amber: {
|
||||||
label: "Amber",
|
label: "Amber",
|
||||||
swatch: "#f59e0b",
|
swatch: "#f59e0b",
|
||||||
badge: "bg-gradient-to-r from-amber-400 to-orange-500 text-white border-0",
|
badge: "bg-gradient-to-r from-amber-400 to-orange-500 text-white border-0",
|
||||||
panel: { bg: "bg-amber-50 dark:bg-amber-500/15", border: "border-amber-200 dark:border-amber-500/40" },
|
panel: { bg: "bg-amber-50 dark:bg-amber-950/30", border: "border-amber-200 dark:border-amber-800" },
|
||||||
},
|
},
|
||||||
sky: {
|
sky: {
|
||||||
label: "Sky",
|
label: "Sky",
|
||||||
swatch: "#0ea5e9",
|
swatch: "#0ea5e9",
|
||||||
badge: "bg-gradient-to-r from-sky-500 to-blue-600 text-white border-0",
|
badge: "bg-gradient-to-r from-sky-500 to-blue-600 text-white border-0",
|
||||||
panel: { bg: "bg-sky-50 dark:bg-sky-500/15", border: "border-sky-200 dark:border-sky-500/40" },
|
panel: { bg: "bg-sky-50 dark:bg-sky-950/30", border: "border-sky-200 dark:border-sky-800" },
|
||||||
},
|
},
|
||||||
indigo: {
|
indigo: {
|
||||||
label: "Indigo",
|
label: "Indigo",
|
||||||
swatch: "#6366f1",
|
swatch: "#6366f1",
|
||||||
badge: "bg-gradient-to-r from-indigo-500 to-violet-600 text-white border-0",
|
badge: "bg-gradient-to-r from-indigo-500 to-violet-600 text-white border-0",
|
||||||
panel: { bg: "bg-indigo-50 dark:bg-indigo-500/15", border: "border-indigo-200 dark:border-indigo-500/40" },
|
panel: { bg: "bg-indigo-50 dark:bg-indigo-950/30", border: "border-indigo-200 dark:border-indigo-800" },
|
||||||
},
|
},
|
||||||
teal: {
|
teal: {
|
||||||
label: "Teal",
|
label: "Teal",
|
||||||
swatch: "#14b8a6",
|
swatch: "#14b8a6",
|
||||||
badge: "bg-gradient-to-r from-teal-500 to-emerald-600 text-white border-0",
|
badge: "bg-gradient-to-r from-teal-500 to-emerald-600 text-white border-0",
|
||||||
panel: { bg: "bg-teal-50 dark:bg-teal-500/15", border: "border-teal-200 dark:border-teal-500/40" },
|
panel: { bg: "bg-teal-50 dark:bg-teal-950/30", border: "border-teal-200 dark:border-teal-800" },
|
||||||
},
|
},
|
||||||
orange: {
|
orange: {
|
||||||
label: "Orange",
|
label: "Orange",
|
||||||
swatch: "#f97316",
|
swatch: "#f97316",
|
||||||
badge: "bg-gradient-to-r from-orange-500 to-red-500 text-white border-0",
|
badge: "bg-gradient-to-r from-orange-500 to-red-500 text-white border-0",
|
||||||
panel: { bg: "bg-orange-50 dark:bg-orange-500/15", border: "border-orange-200 dark:border-orange-500/40" },
|
panel: { bg: "bg-orange-50 dark:bg-orange-950/30", border: "border-orange-200 dark:border-orange-800" },
|
||||||
},
|
},
|
||||||
pink: {
|
pink: {
|
||||||
label: "Pink",
|
label: "Pink",
|
||||||
swatch: "#ec4899",
|
swatch: "#ec4899",
|
||||||
badge: "bg-gradient-to-r from-pink-500 to-rose-500 text-white border-0",
|
badge: "bg-gradient-to-r from-pink-500 to-rose-500 text-white border-0",
|
||||||
panel: { bg: "bg-pink-50 dark:bg-pink-500/15", border: "border-pink-200 dark:border-pink-500/40" },
|
panel: { bg: "bg-pink-50 dark:bg-pink-950/30", border: "border-pink-200 dark:border-pink-800" },
|
||||||
},
|
},
|
||||||
cyan: {
|
cyan: {
|
||||||
label: "Cyan",
|
label: "Cyan",
|
||||||
swatch: "#06b6d4",
|
swatch: "#06b6d4",
|
||||||
badge: "bg-gradient-to-r from-cyan-500 to-sky-500 text-white border-0",
|
badge: "bg-gradient-to-r from-cyan-500 to-sky-500 text-white border-0",
|
||||||
panel: { bg: "bg-cyan-50 dark:bg-cyan-500/15", border: "border-cyan-200 dark:border-cyan-500/40" },
|
panel: { bg: "bg-cyan-50 dark:bg-cyan-950/30", border: "border-cyan-200 dark:border-cyan-800" },
|
||||||
},
|
},
|
||||||
lime: {
|
lime: {
|
||||||
label: "Lime",
|
label: "Lime",
|
||||||
swatch: "#84cc16",
|
swatch: "#84cc16",
|
||||||
badge: "bg-gradient-to-r from-lime-500 to-green-600 text-white border-0",
|
badge: "bg-gradient-to-r from-lime-500 to-green-600 text-white border-0",
|
||||||
panel: { bg: "bg-lime-50 dark:bg-lime-500/15", border: "border-lime-200 dark:border-lime-500/40" },
|
panel: { bg: "bg-lime-50 dark:bg-lime-950/30", border: "border-lime-200 dark:border-lime-800" },
|
||||||
},
|
},
|
||||||
slate: {
|
slate: {
|
||||||
label: "Slate",
|
label: "Slate",
|
||||||
swatch: "#64748b",
|
swatch: "#64748b",
|
||||||
badge: "bg-gradient-to-r from-slate-600 to-slate-800 text-white border-0",
|
badge: "bg-gradient-to-r from-slate-600 to-slate-800 text-white border-0",
|
||||||
panel: { bg: "bg-slate-50 dark:bg-slate-500/15", border: "border-slate-200 dark:border-slate-500/40" },
|
panel: { bg: "bg-slate-50 dark:bg-slate-950/30", border: "border-slate-200 dark:border-slate-700" },
|
||||||
},
|
},
|
||||||
|
|
||||||
// ── Extended palette (18 more → 30 total) ───────────────────────────────────
|
// ── Extended palette (18 more → 30 total) ───────────────────────────────────
|
||||||
@@ -85,109 +85,109 @@ export const TIER_COLOR_MAP = {
|
|||||||
label: "Red",
|
label: "Red",
|
||||||
swatch: "#ef4444",
|
swatch: "#ef4444",
|
||||||
badge: "bg-gradient-to-r from-red-500 to-red-700 text-white border-0",
|
badge: "bg-gradient-to-r from-red-500 to-red-700 text-white border-0",
|
||||||
panel: { bg: "bg-red-50 dark:bg-red-500/15", border: "border-red-200 dark:border-red-500/40" },
|
panel: { bg: "bg-red-50 dark:bg-red-950/30", border: "border-red-200 dark:border-red-800" },
|
||||||
},
|
},
|
||||||
yellow: {
|
yellow: {
|
||||||
label: "Yellow",
|
label: "Yellow",
|
||||||
swatch: "#eab308",
|
swatch: "#eab308",
|
||||||
badge: "bg-gradient-to-r from-yellow-400 to-yellow-600 text-white border-0",
|
badge: "bg-gradient-to-r from-yellow-400 to-yellow-600 text-white border-0",
|
||||||
panel: { bg: "bg-yellow-50 dark:bg-yellow-500/15", border: "border-yellow-200 dark:border-yellow-500/40" },
|
panel: { bg: "bg-yellow-50 dark:bg-yellow-950/30", border: "border-yellow-200 dark:border-yellow-800" },
|
||||||
},
|
},
|
||||||
violet: {
|
violet: {
|
||||||
label: "Violet",
|
label: "Violet",
|
||||||
swatch: "#7c3aed",
|
swatch: "#7c3aed",
|
||||||
badge: "bg-gradient-to-r from-violet-500 to-purple-700 text-white border-0",
|
badge: "bg-gradient-to-r from-violet-500 to-purple-700 text-white border-0",
|
||||||
panel: { bg: "bg-violet-50 dark:bg-violet-500/15", border: "border-violet-200 dark:border-violet-500/40" },
|
panel: { bg: "bg-violet-50 dark:bg-violet-950/30", border: "border-violet-200 dark:border-violet-800" },
|
||||||
},
|
},
|
||||||
fuchsia: {
|
fuchsia: {
|
||||||
label: "Fuchsia",
|
label: "Fuchsia",
|
||||||
swatch: "#d946ef",
|
swatch: "#d946ef",
|
||||||
badge: "bg-gradient-to-r from-fuchsia-500 to-pink-700 text-white border-0",
|
badge: "bg-gradient-to-r from-fuchsia-500 to-pink-700 text-white border-0",
|
||||||
panel: { bg: "bg-fuchsia-50 dark:bg-fuchsia-500/15", border: "border-fuchsia-200 dark:border-fuchsia-500/40" },
|
panel: { bg: "bg-fuchsia-50 dark:bg-fuchsia-950/30", border: "border-fuchsia-200 dark:border-fuchsia-800" },
|
||||||
},
|
},
|
||||||
emerald: {
|
emerald: {
|
||||||
label: "Emerald",
|
label: "Emerald",
|
||||||
swatch: "#10b981",
|
swatch: "#10b981",
|
||||||
badge: "bg-gradient-to-r from-emerald-400 to-emerald-700 text-white border-0",
|
badge: "bg-gradient-to-r from-emerald-400 to-emerald-700 text-white border-0",
|
||||||
panel: { bg: "bg-emerald-50 dark:bg-emerald-500/15", border: "border-emerald-200 dark:border-emerald-500/40" },
|
panel: { bg: "bg-emerald-50 dark:bg-emerald-950/30", border: "border-emerald-200 dark:border-emerald-800" },
|
||||||
},
|
},
|
||||||
blue: {
|
blue: {
|
||||||
label: "Blue",
|
label: "Blue",
|
||||||
swatch: "#3b82f6",
|
swatch: "#3b82f6",
|
||||||
badge: "bg-gradient-to-r from-blue-500 to-blue-700 text-white border-0",
|
badge: "bg-gradient-to-r from-blue-500 to-blue-700 text-white border-0",
|
||||||
panel: { bg: "bg-blue-50 dark:bg-blue-500/15", border: "border-blue-200 dark:border-blue-500/40" },
|
panel: { bg: "bg-blue-50 dark:bg-blue-950/30", border: "border-blue-200 dark:border-blue-800" },
|
||||||
},
|
},
|
||||||
zinc: {
|
zinc: {
|
||||||
label: "Zinc",
|
label: "Zinc",
|
||||||
swatch: "#71717a",
|
swatch: "#71717a",
|
||||||
badge: "bg-gradient-to-r from-zinc-500 to-zinc-700 text-white border-0",
|
badge: "bg-gradient-to-r from-zinc-500 to-zinc-700 text-white border-0",
|
||||||
panel: { bg: "bg-zinc-50 dark:bg-zinc-500/15", border: "border-zinc-200 dark:border-zinc-500/40" },
|
panel: { bg: "bg-zinc-50 dark:bg-zinc-950/30", border: "border-zinc-200 dark:border-zinc-800" },
|
||||||
},
|
},
|
||||||
stone: {
|
stone: {
|
||||||
label: "Stone",
|
label: "Stone",
|
||||||
swatch: "#78716c",
|
swatch: "#78716c",
|
||||||
badge: "bg-gradient-to-r from-stone-500 to-stone-700 text-white border-0",
|
badge: "bg-gradient-to-r from-stone-500 to-stone-700 text-white border-0",
|
||||||
panel: { bg: "bg-stone-50 dark:bg-stone-500/15", border: "border-stone-200 dark:border-stone-500/40" },
|
panel: { bg: "bg-stone-50 dark:bg-stone-950/30", border: "border-stone-200 dark:border-stone-800" },
|
||||||
},
|
},
|
||||||
brown: {
|
brown: {
|
||||||
label: "Brown",
|
label: "Brown",
|
||||||
swatch: "#a16207",
|
swatch: "#a16207",
|
||||||
badge: "bg-gradient-to-r from-yellow-700 to-amber-900 text-white border-0",
|
badge: "bg-gradient-to-r from-yellow-700 to-amber-900 text-white border-0",
|
||||||
panel: { bg: "bg-amber-50 dark:bg-amber-500/15", border: "border-amber-300 dark:border-amber-500/40" },
|
panel: { bg: "bg-amber-50 dark:bg-amber-950/30", border: "border-amber-300 dark:border-amber-900" },
|
||||||
},
|
},
|
||||||
gold: {
|
gold: {
|
||||||
label: "Gold",
|
label: "Gold",
|
||||||
swatch: "#ca8a04",
|
swatch: "#ca8a04",
|
||||||
badge: "bg-gradient-to-r from-yellow-500 to-amber-700 text-white border-0",
|
badge: "bg-gradient-to-r from-yellow-500 to-amber-700 text-white border-0",
|
||||||
panel: { bg: "bg-yellow-50 dark:bg-yellow-500/15", border: "border-yellow-300 dark:border-yellow-500/40" },
|
panel: { bg: "bg-yellow-50 dark:bg-yellow-950/30", border: "border-yellow-300 dark:border-yellow-800" },
|
||||||
},
|
},
|
||||||
navy: {
|
navy: {
|
||||||
label: "Navy",
|
label: "Navy",
|
||||||
swatch: "#1e40af",
|
swatch: "#1e40af",
|
||||||
badge: "bg-gradient-to-r from-blue-700 to-blue-900 text-white border-0",
|
badge: "bg-gradient-to-r from-blue-700 to-blue-900 text-white border-0",
|
||||||
panel: { bg: "bg-blue-50 dark:bg-blue-500/15", border: "border-blue-300 dark:border-blue-500/40" },
|
panel: { bg: "bg-blue-50 dark:bg-blue-950/30", border: "border-blue-300 dark:border-blue-900" },
|
||||||
},
|
},
|
||||||
forest: {
|
forest: {
|
||||||
label: "Forest",
|
label: "Forest",
|
||||||
swatch: "#166534",
|
swatch: "#166534",
|
||||||
badge: "bg-gradient-to-r from-green-700 to-green-900 text-white border-0",
|
badge: "bg-gradient-to-r from-green-700 to-green-900 text-white border-0",
|
||||||
panel: { bg: "bg-green-50 dark:bg-green-500/15", border: "border-green-300 dark:border-green-500/40" },
|
panel: { bg: "bg-green-50 dark:bg-green-950/30", border: "border-green-300 dark:border-green-900" },
|
||||||
},
|
},
|
||||||
wine: {
|
wine: {
|
||||||
label: "Wine",
|
label: "Wine",
|
||||||
swatch: "#9f1239",
|
swatch: "#9f1239",
|
||||||
badge: "bg-gradient-to-r from-rose-800 to-rose-950 text-white border-0",
|
badge: "bg-gradient-to-r from-rose-800 to-rose-950 text-white border-0",
|
||||||
panel: { bg: "bg-rose-50 dark:bg-rose-500/15", border: "border-rose-300 dark:border-rose-500/40" },
|
panel: { bg: "bg-rose-50 dark:bg-rose-950/30", border: "border-rose-300 dark:border-rose-900" },
|
||||||
},
|
},
|
||||||
charcoal: {
|
charcoal: {
|
||||||
label: "Charcoal",
|
label: "Charcoal",
|
||||||
swatch: "#374151",
|
swatch: "#374151",
|
||||||
badge: "bg-gradient-to-r from-gray-600 to-gray-900 text-white border-0",
|
badge: "bg-gradient-to-r from-gray-600 to-gray-900 text-white border-0",
|
||||||
panel: { bg: "bg-gray-50 dark:bg-gray-500/15", border: "border-gray-300 dark:border-gray-500/40" },
|
panel: { bg: "bg-gray-50 dark:bg-gray-950/30", border: "border-gray-300 dark:border-gray-800" },
|
||||||
},
|
},
|
||||||
midnight: {
|
midnight: {
|
||||||
label: "Midnight",
|
label: "Midnight",
|
||||||
swatch: "#312e81",
|
swatch: "#312e81",
|
||||||
badge: "bg-gradient-to-r from-indigo-800 to-indigo-950 text-white border-0",
|
badge: "bg-gradient-to-r from-indigo-800 to-indigo-950 text-white border-0",
|
||||||
panel: { bg: "bg-indigo-50 dark:bg-indigo-500/15", border: "border-indigo-300 dark:border-indigo-500/40" },
|
panel: { bg: "bg-indigo-50 dark:bg-indigo-950/30", border: "border-indigo-300 dark:border-indigo-900" },
|
||||||
},
|
},
|
||||||
lavender: {
|
lavender: {
|
||||||
label: "Lavender",
|
label: "Lavender",
|
||||||
swatch: "#a78bfa",
|
swatch: "#a78bfa",
|
||||||
badge: "bg-gradient-to-r from-violet-400 to-violet-600 text-white border-0",
|
badge: "bg-gradient-to-r from-violet-400 to-violet-600 text-white border-0",
|
||||||
panel: { bg: "bg-violet-50 dark:bg-violet-500/15", border: "border-violet-200 dark:border-violet-500/40" },
|
panel: { bg: "bg-violet-50 dark:bg-violet-950/30", border: "border-violet-200 dark:border-violet-700" },
|
||||||
},
|
},
|
||||||
salmon: {
|
salmon: {
|
||||||
label: "Salmon",
|
label: "Salmon",
|
||||||
swatch: "#fca5a5",
|
swatch: "#fca5a5",
|
||||||
badge: "bg-gradient-to-r from-red-300 to-rose-600 text-white border-0",
|
badge: "bg-gradient-to-r from-red-300 to-rose-600 text-white border-0",
|
||||||
panel: { bg: "bg-red-50 dark:bg-red-500/15", border: "border-red-200 dark:border-red-500/40" },
|
panel: { bg: "bg-red-50 dark:bg-red-950/30", border: "border-red-200 dark:border-red-700" },
|
||||||
},
|
},
|
||||||
mint: {
|
mint: {
|
||||||
label: "Mint",
|
label: "Mint",
|
||||||
swatch: "#6ee7b7",
|
swatch: "#6ee7b7",
|
||||||
badge: "bg-gradient-to-r from-emerald-300 to-teal-600 text-white border-0",
|
badge: "bg-gradient-to-r from-emerald-300 to-teal-600 text-white border-0",
|
||||||
panel: { bg: "bg-emerald-50 dark:bg-emerald-500/15", border: "border-emerald-200 dark:border-emerald-500/40" },
|
panel: { bg: "bg-emerald-50 dark:bg-emerald-950/30", border: "border-emerald-200 dark:border-emerald-700" },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -9,6 +9,6 @@
|
|||||||
"test": "pnpm --filter api test"
|
"test": "pnpm --filter api test"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"concurrently": "^9.2.5"
|
"concurrently": "^9.2.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user