Web: strona-wizytowka FitOS (koncepcja OS treningu, port 9003, deploy 13003)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
Jesteś seniorskim inżynierem oprogramowania. Nigdy nie zgaduj. Jeśli nie jesteś w 100% pewien jak działa dany fragment kodu lub logika biznesowa, ZANIM wygenerujesz kod, użyj `semantic_search` lub zadaj mi pytanie. Zawsze uruchamiaj testy po wprowadzeniu zmian.
|
||||
|
||||
## Struktura
|
||||
- `app` (React+Vite, 5173), `admin` (React+Vite, 5174), `api` (Express+Prisma+PostgreSQL, 9002).
|
||||
- `app` (React+Vite, 5173), `admin` (React+Vite, 5174), `api` (Express+Prisma+PostgreSQL, 9002), `web` (React+Vite, 5175 — strona-wizytówka, kontener 9003, zero API).
|
||||
|
||||
## Frontend (app + admin — ten sam stack)
|
||||
- React 18 + Vite + TypeScript; routing: React Router v6; stylowanie: Tailwind v4 + cva (`cn`/twMerge), ikony lucide-react, dialogi Radix.
|
||||
@@ -59,7 +59,7 @@ Zakres edycji admina (panel `admin`): admin zmienia wyłącznie **tożsamość i
|
||||
5. `npm test` (api) + `npm test`/`test:e2e` (dotknięte fronty)
|
||||
|
||||
## Kontenery — rebuilduj tylko dotknięte
|
||||
- `api/`: `fitos-api` (9002) + `fitos-db` (pg16, wolumen `fitos_pgdata`). `admin/`: 9000 (nginx+dist). `app/`: 9001 (nginx+dist).
|
||||
- `api/`: `fitos-api` (9002) + `fitos-db` (pg16, wolumen `fitos_pgdata`). `admin/`: 9000 (nginx+dist). `app/`: 9001 (nginx+dist). `web/`: 9003 (nginx+dist, bez sieci i zależności od API).
|
||||
- Zmiana `<pkg>/src/**` (albo `api/prisma/**`, `index.html`) → w katalogu `<pkg>/`: `docker compose build <pkg> && docker compose up -d`.
|
||||
- `.env` api → `up -d --force-recreate api`. Nigdy nie ruszaj wolumenu `fitos_pgdata`.
|
||||
- Weryfikacja po zmianie api: `docker compose ps` + `curl localhost:9002/health`.
|
||||
@@ -84,6 +84,7 @@ Zakres edycji admina (panel `admin`): admin zmienia wyłącznie **tożsamość i
|
||||
- Opisy testów (unit + e2e) i wiadomości commitów: PL (commity bez polskich znaków).
|
||||
|
||||
## i18n (app + admin)
|
||||
- Zakres: wyłącznie `app` i `admin`. Paczka `web` (strona-wizytówka) jest **poza i18n** — literały PL w `web/src` są celowe i dozwolone.
|
||||
- Stack: react-i18next; języki `pl`/`en`, wykrywanie `localStorage['fitos-lang']` → `navigator.language` → `pl`; `<html lang>` i `document.title` aktualizowane przy zmianie języka (`i18n/index.ts`).
|
||||
- Zasoby: `app|admin/src/i18n/locales/{pl,en}/<ns>.json` — nowe klucze zawsze w obu plikach; nazwy namespace'ów i kluczy EN, wartości PL/EN.
|
||||
- ZAKAZ literałów PL w `src/**` (poza `src/i18n/locales/`): każdy tekst UI przez `t()`. Strażnik: grep `[ąćęłńóśźż]` w `app/src`/`admin/src` bez trafień w stringach.
|
||||
|
||||
20
README.md
20
README.md
@@ -1,12 +1,13 @@
|
||||
# FitOS
|
||||
|
||||
Silnik planów treningowych. Trzy niezależne aplikacje (osobne kontenery Docker):
|
||||
Silnik planów treningowych. Cztery niezależne aplikacje (osobne kontenery Docker):
|
||||
|
||||
| Aplikacja | Folder | Stack | Port (dev) |
|
||||
|---|---|---|---|
|
||||
| FitOS App | `app/` | React + Vite (PWA) + nginx | 9001 |
|
||||
| FitOS Api | `api/` | Node.js + Express + Prisma + PostgreSQL | 9002 |
|
||||
| FitOS Admin | `admin/` | React + Vite + nginx | 9000 |
|
||||
| FitOS Web | `web/` | React + Vite + nginx | 9003 |
|
||||
|
||||
Koncepcja: `1787402270027-fit-os-koncepcja.md`.
|
||||
|
||||
@@ -43,6 +44,18 @@ cd admin && docker compose up -d --build # http://localhost:9000
|
||||
Adres API w SPA: `public/config.js` → `apiUrl: ''` (= ten sam origin). Zewnętrzny adres
|
||||
tylko awaryjnie — `VITE_API_URL` build-time.
|
||||
|
||||
### 3. Web (strona-wizytówka, bez API)
|
||||
|
||||
`web/` to reklamowa wizytówka FitOS (motyw „OS treningu”). Nie woła API i nie potrzebuje
|
||||
`fitos-net` — wystarczy:
|
||||
|
||||
```bash
|
||||
cd web && docker compose up -d --build # http://localhost:9003
|
||||
```
|
||||
|
||||
Porty przycisków CTA (app/admin) są generowane w `config.js` przy budowie obrazu
|
||||
(build-argi `APP_PORT`/`ADMIN_PORT`; staging: `13001`/`13000` → web na `13003`).
|
||||
|
||||
## Staging i prod (deploy)
|
||||
|
||||
Staging (alt-host `192.168.50.127`, porty 13xxx) i przyszły prod odpalają **kod z gita**:
|
||||
@@ -73,6 +86,11 @@ npm run dev # http://localhost:5173 (vite proxy /api → 9002, API musi stać)
|
||||
cd admin
|
||||
npm install
|
||||
npm run dev # http://localhost:5174 (jw.)
|
||||
|
||||
# Web (strona-wizytówka, bez API)
|
||||
cd web
|
||||
npm install
|
||||
npm run dev # http://localhost:5175 (bez proxy — zero wywołań /api)
|
||||
```
|
||||
|
||||
## Testy
|
||||
|
||||
@@ -24,6 +24,7 @@ ADMIN_HOST_PORT=9000
|
||||
APP_HOST_PORT=9001
|
||||
API_HOST_PORT=9002
|
||||
DB_HOST_PORT=9543
|
||||
WEB_HOST_PORT=9003
|
||||
|
||||
# --- wolumeny danych (EXTERNAL — na prod NIGDY nie dzielic ze stagingiem;
|
||||
# przy pierwszym deployu utworz recznie: docker volume create <nazwa>) ---
|
||||
|
||||
@@ -20,11 +20,12 @@ JWT_REFRESH_SECRET=
|
||||
FITOS_FIRST_ADMIN_EMAIL=admin@fitos.local
|
||||
FITOS_FIRST_ADMIN_PASSWORD=
|
||||
|
||||
# --- porty hosta (odpowiedniki 9xxx: admin 13000, app 13001, api 13002) ---
|
||||
# --- porty hosta (odpowiedniki 9xxx: admin 13000, app 13001, api 13002, web 13003) ---
|
||||
ADMIN_HOST_PORT=13000
|
||||
APP_HOST_PORT=13001
|
||||
API_HOST_PORT=13002
|
||||
DB_HOST_PORT=13543
|
||||
WEB_HOST_PORT=13003
|
||||
|
||||
# --- wolumeny danych (EXTERNAL — przetrwaja rebuildy; migracja ze starego
|
||||
# projektu "fitos-alt" = te same wolumeny, zero utraty danych).
|
||||
|
||||
@@ -82,6 +82,19 @@ services:
|
||||
API_UPSTREAM: api:9002
|
||||
restart: unless-stopped
|
||||
|
||||
# Strona-wizytówka (nginx, zero API) — porty CTA w config.js generowane
|
||||
# build-argami: wskazują na porty hosta app/admin dla danego środowiska.
|
||||
web:
|
||||
build:
|
||||
context: ../web
|
||||
args:
|
||||
APP_PORT: ${APP_HOST_PORT:?set APP_HOST_PORT in .env}
|
||||
ADMIN_PORT: ${ADMIN_HOST_PORT:?set ADMIN_HOST_PORT in .env}
|
||||
container_name: fitos-web-${DEPLOY_ENV}
|
||||
ports:
|
||||
- "${WEB_HOST_PORT:?set WEB_HOST_PORT in .env}:9003"
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
name: ${PGDATA_VOLUME:?set PGDATA_VOLUME in .env}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
Stdlib + systemowe `git`, `ssh`, `scp` (opcjonalnie `sshpass` dla hasla SSH).
|
||||
Konfiguracja srodowiska: deploy/.deploy.<env>.env (wzorce: .deploy.<env>.env.example).
|
||||
|
||||
Kroki: git fetch -> git archive <ref> (api admin app deploy) -> scp -> na hoście
|
||||
Kroki: git fetch -> git archive <ref> (api admin app web deploy) -> scp -> na hoście
|
||||
.swap drzewa ~/fitos-<env> (.old) -> plik RELEASE -> .env (chmod 600, sekrety
|
||||
generowane i zapisywane z powrotem lokalnie) -> docker compose up -d --build ->
|
||||
health-check /health -> smoke sesji (login+refresh przez port fronta) -> ps + RELEASE.
|
||||
@@ -132,7 +132,7 @@ def prepare_archive(ref: str) -> tuple[Path, str]:
|
||||
os.close(fd)
|
||||
tar_path = Path(tmp_name)
|
||||
step(f"git archive {sha[:12]} -> {tar_path.name}")
|
||||
run_git(["archive", "--format=tar.gz", "-o", str(tar_path), sha, "--", "api", "admin", "app", "deploy"])
|
||||
run_git(["archive", "--format=tar.gz", "-o", str(tar_path), sha, "--", "api", "admin", "app", "web", "deploy"])
|
||||
size_mb = tar_path.stat().st_size / (1024 * 1024)
|
||||
ok(f"paczka {size_mb:.1f} MB")
|
||||
return tar_path, sha
|
||||
@@ -282,6 +282,7 @@ def write_stack_env(remote: Remote, remote_dir: str, cfg: dict[str, str], env_na
|
||||
f"APP_HOST_PORT={cfg['APP_HOST_PORT']}",
|
||||
f"API_HOST_PORT={cfg['API_HOST_PORT']}",
|
||||
f"DB_HOST_PORT={cfg['DB_HOST_PORT']}",
|
||||
f"WEB_HOST_PORT={cfg['WEB_HOST_PORT']}",
|
||||
f"PGDATA_VOLUME={cfg['PGDATA_VOLUME']}",
|
||||
f"UPLOADS_VOLUME={cfg['UPLOADS_VOLUME']}",
|
||||
]
|
||||
@@ -353,6 +354,18 @@ curl -s -o /tmp/fitos-smoke-refresh.json -w '%{{http_code}}' -b /tmp/fitos-smoke
|
||||
ok("login+refresh 200 + nowy accessToken — ten sam origin, ciastko leci")
|
||||
|
||||
|
||||
def smoke_web(remote: Remote, web_port: str) -> None:
|
||||
step(f"Smoke Web: GET / przez port {web_port} (strona-wizytowka, zero API)")
|
||||
code = remote.exec(
|
||||
f"curl -s -o /tmp/fitos-smoke-web.html -w '%{{http_code}}' http://127.0.0.1:{web_port}/"
|
||||
).strip()
|
||||
fitos_ok = remote.check("grep -qi fitos /tmp/fitos-smoke-web.html").returncode == 0
|
||||
remote.exec("rm -f /tmp/fitos-smoke-web.html")
|
||||
if code != "200" or not fitos_ok:
|
||||
die(f"smoke web wrocil {code}, 'FitOS' w HTML={fitos_ok} — strona-wizytowka niedostepna.")
|
||||
ok("GET / = 200 + 'FitOS' w HTML")
|
||||
|
||||
|
||||
def summarize(remote: Remote, remote_dir: str, cfg: dict[str, str]) -> None:
|
||||
step("docker compose ps + RELEASE")
|
||||
print(remote.exec(f"{compose(remote_dir)} ps 2>&1", timeout=60))
|
||||
@@ -363,6 +376,7 @@ def summarize(remote: Remote, remote_dir: str, cfg: dict[str, str]) -> None:
|
||||
print(f" App: http://{host}:{cfg['APP_HOST_PORT']}")
|
||||
print(f" Admin: http://{host}:{cfg['ADMIN_HOST_PORT']}")
|
||||
print(f" API: http://{host}:{cfg['API_HOST_PORT']} (docs: /api/docs poza prod)")
|
||||
print(f" Web: http://{host}:{cfg['WEB_HOST_PORT']} (strona-wizytowka)")
|
||||
|
||||
|
||||
# --- main ------------------------------------------------------------------------
|
||||
@@ -386,7 +400,7 @@ def main() -> None:
|
||||
cfg = load_env_file(env_path)
|
||||
fill_secrets(cfg, env_path)
|
||||
|
||||
for key in ("ADMIN_HOST_PORT", "APP_HOST_PORT", "API_HOST_PORT", "DB_HOST_PORT", "PGDATA_VOLUME", "UPLOADS_VOLUME"):
|
||||
for key in ("ADMIN_HOST_PORT", "APP_HOST_PORT", "API_HOST_PORT", "DB_HOST_PORT", "WEB_HOST_PORT", "PGDATA_VOLUME", "UPLOADS_VOLUME"):
|
||||
if not cfg.get(key):
|
||||
die(f"Brak {key} w {env_path.name}")
|
||||
volumes = [cfg["PGDATA_VOLUME"], cfg["UPLOADS_VOLUME"]]
|
||||
@@ -414,6 +428,7 @@ def main() -> None:
|
||||
reset_db(remote, remote_dir, volumes)
|
||||
stack_up(remote, remote_dir)
|
||||
wait_health(remote, remote_dir, cfg["API_HOST_PORT"])
|
||||
smoke_web(remote, cfg["WEB_HOST_PORT"])
|
||||
if not args.no_smoke:
|
||||
smoke_session(remote, cfg["ADMIN_HOST_PORT"], cfg.get("FITOS_FIRST_ADMIN_EMAIL") or "admin@fitos.local", cfg["FITOS_FIRST_ADMIN_PASSWORD"])
|
||||
if args.logs:
|
||||
|
||||
@@ -26,10 +26,11 @@ klawisze — w normalnej konfiguracji nieużywane.
|
||||
| Admin | `http://localhost:9000` | `http://192.168.50.127:13000` | 9000 (plan) |
|
||||
| App | `http://localhost:9001` | `http://192.168.50.127:13001` | 9001 (plan) |
|
||||
| API / Swagger | `http://localhost:9002` / `/api/docs`* | `http://192.168.50.127:13002` | 9002 (plan) |
|
||||
| Vite dev | 5173 (app), 5174 (admin) — proxy na 9002 | — | — |
|
||||
| Web (wizytówka) | `http://localhost:9003` | `http://192.168.50.127:13003` | 9003 (plan) |
|
||||
| Vite dev | 5173 (app), 5174 (admin), 5175 (web, bez proxy) — app/admin proxy na 9002 | — | — |
|
||||
| PostgreSQL | `127.0.0.1:5432` | `127.0.0.1:13543` (tylko host) | `127.0.0.1:9543` (plan) |
|
||||
| Projekt compose | 3 projekty: `api/`, `app/`, `admin/` + sieć `fitos-net` | `fitos-staging` (`deploy/compose.yml`) | `fitos-prod` (ten sam plik) |
|
||||
| Kontenery | `fitos-api`, `fitos-app`, `fitos-admin`, `fitos-db` | `fitos-{api,db,app,admin}-staging` | `fitos-*-prod` |
|
||||
| Projekt compose | 4 projekty: `api/`, `app/`, `admin/`, `web/` + sieć `fitos-net` (web bez sieci — nie woła API) | `fitos-staging` (`deploy/compose.yml`) | `fitos-prod` (ten sam plik) |
|
||||
| Kontenery | `fitos-api`, `fitos-app`, `fitos-admin`, `fitos-web`, `fitos-db` | `fitos-{api,db,app,admin,web}-staging` | `fitos-*-prod` |
|
||||
| Wolumeny | `fitos_pgdata`, `fitos_uploads` | `fitos-alt_fitos_alt_pgdata`, `fitos-alt_fitos_alt_uploads` (external, przejęte po starym stosie) | `fitos_prod_pgdata`, `fitos_prod_uploads` (external) |
|
||||
| Deploy | `docker compose up` w `<pkg>/` | `deploy/deploy.sh -e staging` | `deploy/deploy.sh -e prod` |
|
||||
|
||||
@@ -74,7 +75,7 @@ rm $JAR
|
||||
## Staging (alt-host `192.168.50.127`)
|
||||
|
||||
Druga instancja FitOS w LAN-ie — **zawsze kod z gita**, nigdy z drzewa roboczego.
|
||||
Porty 13xxx to odpowiedniki 9xxx; przez DDNS: `http://tisachi.ddns.net:13000..13002`
|
||||
Porty 13xxx to odpowiedniki 9xxx; przez DDNS: `http://tisachi.ddns.net:13000..13003`
|
||||
(przekierowanie portów na 192.168.50.127 w routerze).
|
||||
|
||||
- projekt: `fitos-staging` (`deploy/compose.yml`), katalog na hoście: `~/fitos-staging`
|
||||
|
||||
4
web/.dockerignore
Normal file
4
web/.dockerignore
Normal file
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
dist
|
||||
.env
|
||||
*.log
|
||||
6
web/.prettierrc.json
Normal file
6
web/.prettierrc.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"printWidth": 100,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
20
web/Dockerfile
Normal file
20
web/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
FROM node:22-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:alpine
|
||||
# template -> /etc/nginx/templates/: entrypoint obrazu robi envsubst i zapisuje
|
||||
# wynik do /etc/nginx/conf.d/default.conf; strona web NIE proxyje /api (zero API)
|
||||
COPY nginx.conf.template /etc/nginx/templates/default.conf.template
|
||||
# config.js z portami CTA generowany przy budowie obrazu
|
||||
# (staging: --build-arg APP_PORT=13001 ADMIN_PORT=13000)
|
||||
ARG APP_PORT=9001
|
||||
ARG ADMIN_PORT=9000
|
||||
COPY config.js.template /tmp/config.js.template
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
RUN envsubst '${APP_PORT} ${ADMIN_PORT}' < /tmp/config.js.template \
|
||||
> /usr/share/nginx/html/config.js && rm /tmp/config.js.template
|
||||
EXPOSE 9003
|
||||
6
web/config.js.template
Normal file
6
web/config.js.template
Normal file
@@ -0,0 +1,6 @@
|
||||
// Konfiguracja runtime — generowana w Dockerfile (envsubst APP_PORT/ADMIN_PORT).
|
||||
// Staging: APP_PORT=13001 ADMIN_PORT=13000 (app/admin na portach 13xxx).
|
||||
window.FITOS_WEB = {
|
||||
appPort: ${APP_PORT},
|
||||
adminPort: ${ADMIN_PORT},
|
||||
};
|
||||
8
web/docker-compose.yml
Normal file
8
web/docker-compose.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
# Strona-wizytówka bez zaplecza: brak sieci fitos-net i zależności od API.
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
container_name: fitos-web
|
||||
ports:
|
||||
- "9003:9003"
|
||||
restart: unless-stopped
|
||||
43
web/eslint.config.js
Normal file
43
web/eslint.config.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import js from '@eslint/js';
|
||||
import prettier from 'eslint-config-prettier';
|
||||
import ts from '@typescript-eslint/eslint-plugin';
|
||||
import tsParser from '@typescript-eslint/parser';
|
||||
|
||||
const files = ['**/*.{js,ts,mjs,cjs}'];
|
||||
|
||||
export default [
|
||||
{ ignores: ['dist/', 'node_modules/'] },
|
||||
{
|
||||
...js.configs.recommended,
|
||||
files,
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
globals: {
|
||||
console: 'readonly',
|
||||
window: 'readonly',
|
||||
document: 'readonly',
|
||||
localStorage: 'readonly',
|
||||
fetch: 'readonly',
|
||||
setTimeout: 'readonly',
|
||||
clearTimeout: 'readonly',
|
||||
setInterval: 'readonly',
|
||||
clearInterval: 'readonly',
|
||||
IntersectionObserver: 'readonly',
|
||||
matchMedia: 'readonly',
|
||||
URL: 'readonly',
|
||||
Event: 'readonly',
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
'@typescript-eslint': ts,
|
||||
},
|
||||
rules: {
|
||||
'no-unused-vars': 'off',
|
||||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
||||
},
|
||||
},
|
||||
{
|
||||
...prettier,
|
||||
files,
|
||||
},
|
||||
];
|
||||
18
web/index.html
Normal file
18
web/index.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<!doctype html>
|
||||
<html lang="pl">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="theme-color" content="#141210" />
|
||||
<meta
|
||||
name="description"
|
||||
content="FitOS — system operacyjny treningu. Od planowania po ostatnią serię: plany, sesje na żywo, killstreak, trenerzy i siłownie w jednym miejscu."
|
||||
/>
|
||||
<title>FitOS — Trening, który się dowozi.</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script src="/config.js"></script>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
17
web/nginx.conf.template
Normal file
17
web/nginx.conf.template
Normal file
@@ -0,0 +1,17 @@
|
||||
# Strona-wizytówka: statyczny SPA + fallback, BEZ proxy /api i /health (web nie woła API).
|
||||
# Brak zmiennych ${...} — envsubst entrypointa nic tu nie podmienia (np. $uri to składnia nginx).
|
||||
server {
|
||||
listen 9003;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# dev: zero cache'owania — aktualizacje widoczne od razu po rebuildzie
|
||||
add_header Cache-Control "no-store, max-age=0" always;
|
||||
add_header Pragma "no-cache" always;
|
||||
add_header Expires "0" always;
|
||||
|
||||
location / {
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
}
|
||||
5471
web/package-lock.json
generated
Normal file
5471
web/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
47
web/package.json
Normal file
47
web/package.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "fitos-web",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"preview": "vite preview",
|
||||
"lint": "eslint src",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test:e2e": "playwright test",
|
||||
"test:e2e:ui": "playwright test --ui",
|
||||
"test:e2e:install": "playwright install chromium",
|
||||
"format": "prettier --write src"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fontsource/manrope": "^5.3.0",
|
||||
"@fontsource/space-grotesk": "^5.3.0",
|
||||
"@tailwindcss/vite": "^4.3.3",
|
||||
"lucide-react": "^1.33.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"tailwindcss": "^4.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.15.0",
|
||||
"@playwright/test": "^1.62.1",
|
||||
"@testing-library/dom": "^10.4.1",
|
||||
"@testing-library/jest-dom": "^6.9.1",
|
||||
"@testing-library/react": "^16.3.2",
|
||||
"@types/node": "^26.2.0",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
||||
"@typescript-eslint/parser": "^8.15.0",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"eslint": "^9.15.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"jsdom": "^25.0.1",
|
||||
"prettier": "^3.3.3",
|
||||
"typescript": "^5.6.0",
|
||||
"vite": "^6.0.0",
|
||||
"vitest": "^3.2.7"
|
||||
}
|
||||
}
|
||||
24
web/playwright.config.ts
Normal file
24
web/playwright.config.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { defineConfig, devices } from '@playwright/test';
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './test/e2e',
|
||||
outputDir: './test/results',
|
||||
timeout: 30_000,
|
||||
expect: { timeout: 5_000 },
|
||||
fullyParallel: true,
|
||||
retries: process.env.CI ? 1 : 0,
|
||||
reporter: [['list'], ['html', { outputFolder: 'test/report', open: 'never' }]],
|
||||
use: {
|
||||
baseURL: 'http://localhost:5175',
|
||||
locale: 'pl-PL',
|
||||
trace: 'on-first-retry',
|
||||
screenshot: 'only-on-failure',
|
||||
},
|
||||
projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
|
||||
webServer: {
|
||||
command: 'npm run dev',
|
||||
url: 'http://localhost:5175',
|
||||
reuseExistingServer: !process.env.CI,
|
||||
timeout: 60_000,
|
||||
},
|
||||
});
|
||||
7
web/public/config.js
Normal file
7
web/public/config.js
Normal file
@@ -0,0 +1,7 @@
|
||||
// Konfiguracja runtime (bez przebudowy). W kontenerze Docker plik jest
|
||||
// GENEROWANY z config.js.template przez envsubst (ARG-i APP_PORT/ADMIN_PORT);
|
||||
// ta wersja = wartości dev (app 9001, admin 9000).
|
||||
window.FITOS_WEB = {
|
||||
appPort: 9001,
|
||||
adminPort: 9000,
|
||||
};
|
||||
33
web/src/App.tsx
Normal file
33
web/src/App.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Hero } from './sections/Hero';
|
||||
import { ModulesTrainee } from './sections/ModulesTrainee';
|
||||
import { ModulesTrainer } from './sections/ModulesTrainer';
|
||||
import { Ecosystem } from './sections/Ecosystem';
|
||||
import { AdminSys } from './sections/AdminSys';
|
||||
import { Roles } from './sections/Roles';
|
||||
import { Properties } from './sections/Properties';
|
||||
import { Cta } from './sections/Cta';
|
||||
import { Footer } from './sections/Footer';
|
||||
import { SiteHeader } from './sections/SiteHeader';
|
||||
|
||||
/**
|
||||
* Strona-wizytówka FitOS: koncept „system operacyjny treningu”.
|
||||
* Zero API, zero routera — jedna strona z kotwicami.
|
||||
*/
|
||||
export default function App() {
|
||||
return (
|
||||
<div id="gora" className="min-h-dvh">
|
||||
<SiteHeader />
|
||||
<main>
|
||||
<Hero />
|
||||
<ModulesTrainee />
|
||||
<ModulesTrainer />
|
||||
<Ecosystem />
|
||||
<AdminSys />
|
||||
<Roles />
|
||||
<Properties />
|
||||
<Cta />
|
||||
</main>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
77
web/src/components/BootLog.tsx
Normal file
77
web/src/components/BootLog.tsx
Normal file
@@ -0,0 +1,77 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
interface BootLine {
|
||||
text: string;
|
||||
ok?: boolean;
|
||||
}
|
||||
|
||||
// Log startowy „systemu” — ≤6 linii, po wpisaniu zostają widoczne.
|
||||
const LINES: BootLine[] = [
|
||||
{ text: '$ fitos --init' },
|
||||
{ text: 'moduł Trening ......... ', ok: true },
|
||||
{ text: 'moduł Coaching ........ ', ok: true },
|
||||
{ text: 'moduł Siłownie ........ ', ok: true },
|
||||
{ text: '$ system gotowy — 0 błędów' },
|
||||
];
|
||||
|
||||
const CHAR_MS = 24;
|
||||
const LINE_MS = 240;
|
||||
|
||||
function prefersReducedMotion() {
|
||||
return (
|
||||
typeof window.matchMedia === 'function' &&
|
||||
window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
||||
);
|
||||
}
|
||||
|
||||
/** Boot log z efektem typewritera; w prefers-reduced-motion renderuje się od razu. */
|
||||
export function BootLog() {
|
||||
const done = prefersReducedMotion();
|
||||
const [visible, setVisible] = useState<{ line: number; char: number }>(
|
||||
done ? { line: LINES.length, char: 0 } : { line: 0, char: 0 },
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (done) return;
|
||||
let cancelled = false;
|
||||
let timer: ReturnType<typeof setTimeout>;
|
||||
|
||||
const tick = (line: number, char: number) => {
|
||||
if (cancelled) return;
|
||||
setVisible({ line, char });
|
||||
if (line >= LINES.length) return;
|
||||
const text = LINES[line].text;
|
||||
if (char < text.length) {
|
||||
timer = setTimeout(() => tick(line, char + 1), CHAR_MS);
|
||||
} else {
|
||||
timer = setTimeout(() => tick(line + 1, 0), LINE_MS);
|
||||
}
|
||||
};
|
||||
|
||||
timer = setTimeout(() => tick(0, 0), 350);
|
||||
return () => {
|
||||
cancelled = true;
|
||||
clearTimeout(timer);
|
||||
};
|
||||
}, [done]);
|
||||
|
||||
return (
|
||||
<pre
|
||||
aria-label="Log startowy FitOS"
|
||||
className="m-0 font-mono text-[12.5px] leading-6 text-dim sm:text-[13px]"
|
||||
>
|
||||
{LINES.map((l, i) => {
|
||||
if (i > visible.line) return null;
|
||||
const shown = i < visible.line ? l.text : l.text.slice(0, visible.char);
|
||||
const finished = i < visible.line || visible.char >= l.text.length;
|
||||
return (
|
||||
<span key={i} className="block whitespace-pre-wrap">
|
||||
<span>{shown}</span>
|
||||
{l.ok && finished && <span className="font-semibold text-accent">OK</span>}
|
||||
{i === visible.line && !done && <span className="boot-caret" />}
|
||||
</span>
|
||||
);
|
||||
})}
|
||||
</pre>
|
||||
);
|
||||
}
|
||||
26
web/src/components/Brandmark.tsx
Normal file
26
web/src/components/Brandmark.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { cn } from '../lib/utils';
|
||||
|
||||
/** Geometryczny znak marki (sztanga-monogram) w koralowym gradiencie. */
|
||||
export function Brandmark({ size = 30, className = '' }: { size?: number; className?: string }) {
|
||||
return (
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className={cn(
|
||||
'grid flex-none place-items-center rounded-[10px] bg-(image:--mark-grad) text-accent-ink shadow-(--mark-shadow)',
|
||||
className,
|
||||
)}
|
||||
style={{ width: size, height: size }}
|
||||
>
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth={2.4}
|
||||
strokeLinecap="round"
|
||||
style={{ width: size * 0.57, height: size * 0.57 }}
|
||||
>
|
||||
<path d="M6.5 6.5v11M17.5 6.5v11M3 9.5v5M21 9.5v5M6.5 12h11" />
|
||||
</svg>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
63
web/src/components/PhoneMock.tsx
Normal file
63
web/src/components/PhoneMock.tsx
Normal file
@@ -0,0 +1,63 @@
|
||||
import { StreakDots } from './StreakDots';
|
||||
|
||||
/** Mock telefonu w estetyce Ember: karta „Trwa trening” z seriali, przerwą i killstreakiem. */
|
||||
export function PhoneMock() {
|
||||
return (
|
||||
<div
|
||||
className="mx-auto w-[290px] rounded-[2.4rem] border border-line bg-input p-2.5 shadow-[0_30px_80px_-30px_rgb(0_0_0/0.8)]"
|
||||
role="img"
|
||||
aria-label="Podgląd aplikacji: trwa trening, seria 3 na 4, killstreak 23 dni"
|
||||
>
|
||||
<div className="flex flex-col gap-3 overflow-hidden rounded-[1.9rem] border border-line bg-bg">
|
||||
{/* pasek statusu */}
|
||||
<div className="flex items-center justify-between px-5 pt-3 font-mono text-[10px] text-dim">
|
||||
<span>18:42</span>
|
||||
<span className="flex items-center gap-1">
|
||||
<span className="live-dot" />
|
||||
<span>trening</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* karta aktywnej sesji */}
|
||||
<div className="mx-3 rounded-lg border border-line bg-(image:--card-grad) p-3.5 shadow-card">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="flex items-center gap-2 text-sm font-semibold text-ink">
|
||||
<span className="live-dot" />
|
||||
Trwa trening
|
||||
</span>
|
||||
<span className="font-mono text-[10px] text-dim">sesja · dzień 3</span>
|
||||
</div>
|
||||
<p className="mt-2 font-display text-[15px] font-semibold text-ink">Wyciskanie sztangi</p>
|
||||
<p className="font-mono text-[11px] text-dim">4 x 8 @ 80 kg · RIR 2</p>
|
||||
|
||||
<div className="mt-3 flex items-center justify-between text-[11px] text-dim">
|
||||
<span>Seria 3/4</span>
|
||||
<span className="font-mono text-accent">powt. 8</span>
|
||||
</div>
|
||||
<div className="mt-1.5 h-1.5 overflow-hidden rounded-full bg-input">
|
||||
<div className="h-full w-3/4 rounded-full bg-(image:--btn-grad)" />
|
||||
</div>
|
||||
|
||||
<div className="mt-3 flex items-center justify-between rounded-md border border-line bg-input px-2.5 py-2">
|
||||
<span className="text-[11px] text-dim">Przerwa</span>
|
||||
<span className="font-mono text-sm font-semibold text-accent">0:45</span>
|
||||
</div>
|
||||
|
||||
<div className="mt-3 h-8 rounded-md bg-(image:--btn-grad) shadow-(--btn-shadow) text-center font-sans text-[12.5px] font-bold leading-8 text-accent-ink">
|
||||
Norma spełniona
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* killstreak */}
|
||||
<div className="mx-3 mb-3 rounded-lg border border-line bg-card p-3">
|
||||
<div className="flex items-center justify-between text-[11px]">
|
||||
<span className="font-semibold text-ink">Killstreak</span>
|
||||
<span className="font-mono text-accent">23 · rekord 41</span>
|
||||
</div>
|
||||
<StreakDots className="mt-2" />
|
||||
<p className="mt-1.5 font-mono text-[10px] text-dim">ostatnie 30 dni</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
45
web/src/components/Reveal.tsx
Normal file
45
web/src/components/Reveal.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
import { useEffect, useRef, useState, type CSSProperties, type ReactNode } from 'react';
|
||||
import { cn } from '../lib/utils';
|
||||
|
||||
interface RevealProps {
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
delayMs?: number;
|
||||
}
|
||||
|
||||
/** Wejście sekcji na scroll — IntersectionObserver; reduced-motion ogarnia CSS (.reveal). */
|
||||
export function Reveal({ children, className, delayMs = 0 }: RevealProps) {
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const el = ref.current;
|
||||
if (!el || typeof IntersectionObserver === 'undefined') {
|
||||
setVisible(true);
|
||||
return;
|
||||
}
|
||||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
for (const entry of entries) {
|
||||
if (entry.isIntersecting) {
|
||||
setVisible(true);
|
||||
observer.disconnect();
|
||||
}
|
||||
}
|
||||
},
|
||||
{ threshold: 0.12, rootMargin: '0px 0px -40px 0px' },
|
||||
);
|
||||
observer.observe(el);
|
||||
return () => observer.disconnect();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={ref}
|
||||
className={cn('reveal', visible && 'revealed', className)}
|
||||
style={delayMs ? ({ '--reveal-delay': `${delayMs}ms` } as CSSProperties) : undefined}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
22
web/src/components/StreakDots.tsx
Normal file
22
web/src/components/StreakDots.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { cn } from '../lib/utils';
|
||||
|
||||
interface StreakDotsProps {
|
||||
total?: number;
|
||||
filled?: number;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
/** Rząd kropek killstreaka — zapalane kolejno (stagger), w reduced-motion statyczne. */
|
||||
export function StreakDots({ total = 30, filled = 23, className }: StreakDotsProps) {
|
||||
return (
|
||||
<span aria-hidden="true" className={cn('flex flex-wrap items-center gap-1', className)}>
|
||||
{Array.from({ length: total }, (_, i) => (
|
||||
<span
|
||||
key={i}
|
||||
className={cn('size-1.5 rounded-full', i < filled ? 'streak-dot bg-accent' : 'bg-line')}
|
||||
style={i < filled ? { animationDelay: `${600 + i * 55}ms` } : undefined}
|
||||
/>
|
||||
))}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
37
web/src/components/WindowCard.tsx
Normal file
37
web/src/components/WindowCard.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { ReactNode } from 'react';
|
||||
import type { LucideIcon } from 'lucide-react';
|
||||
import { cn } from '../lib/utils';
|
||||
|
||||
interface WindowCardProps {
|
||||
icon: LucideIcon;
|
||||
title: string;
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
/** Kafelek w stylistyce okienka OS-a: pasek tytułu z kropkami + ikoną, glow na hover. */
|
||||
export function WindowCard({ icon: Icon, title, children, className }: WindowCardProps) {
|
||||
return (
|
||||
<article
|
||||
className={cn(
|
||||
'window-glow flex flex-col overflow-hidden rounded-lg border border-line bg-(image:--card-grad) shadow-card',
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<header className="flex items-center gap-2 border-b border-line bg-input/60 px-3.5 py-2.5">
|
||||
<span aria-hidden="true" className="flex items-center gap-1.5">
|
||||
<span className="size-2.5 rounded-full bg-accent" />
|
||||
<span className="size-2.5 rounded-full bg-line" />
|
||||
<span className="size-2.5 rounded-full bg-line" />
|
||||
</span>
|
||||
<span className="ml-1 flex items-center gap-1.5 text-accent">
|
||||
<Icon size={14} aria-hidden="true" />
|
||||
<span className="font-mono text-xs tracking-wide text-dim">{title}</span>
|
||||
</span>
|
||||
</header>
|
||||
<div className="flex flex-1 flex-col gap-2 px-4 py-3.5 text-[13.5px] leading-relaxed text-dim">
|
||||
{children}
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
23
web/src/lib/links.ts
Normal file
23
web/src/lib/links.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
declare global {
|
||||
interface Window {
|
||||
/** Generowane w kontenerze z config.js.template (envsubst APP_PORT/ADMIN_PORT). */
|
||||
FITOS_WEB?: { appPort?: number; adminPort?: number };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adresy CTA: ten sam host co strona-wizytówka, porty z config.js
|
||||
* (dev: app 9001 / admin 9000; staging: 13001 / 13000).
|
||||
*/
|
||||
function originFor(port: number) {
|
||||
const host = window.location.hostname || 'localhost';
|
||||
return `${window.location.protocol}//${host}:${port}`;
|
||||
}
|
||||
|
||||
export function appUrl() {
|
||||
return originFor(window.FITOS_WEB?.appPort ?? 9001);
|
||||
}
|
||||
|
||||
export function adminUrl() {
|
||||
return originFor(window.FITOS_WEB?.adminPort ?? 9000);
|
||||
}
|
||||
5
web/src/lib/utils.ts
Normal file
5
web/src/lib/utils.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export type ClassValue = string | number | null | false | undefined;
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return inputs.filter(Boolean).join(' ');
|
||||
}
|
||||
18
web/src/main.tsx
Normal file
18
web/src/main.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import '@fontsource/manrope/400.css';
|
||||
import '@fontsource/manrope/500.css';
|
||||
import '@fontsource/manrope/600.css';
|
||||
import '@fontsource/manrope/700.css';
|
||||
import '@fontsource/manrope/800.css';
|
||||
import '@fontsource/space-grotesk/500.css';
|
||||
import '@fontsource/space-grotesk/600.css';
|
||||
import '@fontsource/space-grotesk/700.css';
|
||||
import App from './App';
|
||||
import './styles.css';
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
);
|
||||
80
web/src/sections/AdminSys.tsx
Normal file
80
web/src/sections/AdminSys.tsx
Normal file
@@ -0,0 +1,80 @@
|
||||
import {
|
||||
BadgeCheck,
|
||||
BookOpenText,
|
||||
ClipboardList,
|
||||
Megaphone,
|
||||
ScrollText,
|
||||
Users,
|
||||
} from 'lucide-react';
|
||||
import { WindowCard } from '../components/WindowCard';
|
||||
import { Reveal } from '../components/Reveal';
|
||||
import { Section, SectionHeading } from './shared';
|
||||
|
||||
/** Sekcja „Admin.sys” — panel administratora. */
|
||||
export function AdminSys() {
|
||||
return (
|
||||
<Section id="admin">
|
||||
<SectionHeading
|
||||
kicker="/admin.sys"
|
||||
title="Panel administratora"
|
||||
lead="Z zaplecza ktoś musi ten system trzymać. Panel admina to sześć modułów i pełna kontrola nad treścią katalogów."
|
||||
/>
|
||||
<div className="mt-12 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Reveal>
|
||||
<WindowCard icon={Users} title="Uzytkownicy">
|
||||
<p>
|
||||
<span className="text-ink">Tożsamość i dostęp</span> (imię, e-mail, hasło, rola),
|
||||
członkostwa i role w siłowniach oraz <span className="text-ink">kary</span>:
|
||||
zawieszenie z terminem albo ban z powodem.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal delayMs={50}>
|
||||
<WindowCard icon={ClipboardList} title="Silownie">
|
||||
<p>
|
||||
Wyznaczanie <span className="text-ink">właściciela</span>, prowadzenie galerii,
|
||||
publikowanie <span className="text-ink">ogłoszeń w imieniu siłowni</span>.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal delayMs={100}>
|
||||
<WindowCard icon={BadgeCheck} title="Weryfikacje">
|
||||
<p>
|
||||
Zgłoszenia dwóch typów: <span className="text-ink">nowa siłownia</span> i{' '}
|
||||
<span className="text-ink">weryfikacja wirtualnej</span>. Dokumenty{' '}
|
||||
<span className="font-mono text-accent">JPG/PNG/PDF</span> do{' '}
|
||||
<span className="font-mono text-accent">5 MB</span>. Zatwierdzenie ={' '}
|
||||
<span className="font-mono text-accent">REAL</span>, a wnioskodawca dostaje rolę
|
||||
właściciela.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal>
|
||||
<WindowCard icon={BookOpenText} title="Slowniki">
|
||||
<p>
|
||||
Katalogi treści: <span className="text-ink">rodzaje ćwiczeń</span> z opisami
|
||||
„jak się robi” i <span className="text-ink">częstymi błędami</span>,
|
||||
urządzenia i obszary treningowe.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal delayMs={50}>
|
||||
<WindowCard icon={ScrollText} title="Logi">
|
||||
<p>
|
||||
<span className="text-ink">Pełny audyt czynności</span> — ActivityLog notuje, kto, co
|
||||
i kiedy. W razie sporu nie ma dyskusji, jest wpis.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal delayMs={100}>
|
||||
<WindowCard icon={Megaphone} title="Ogloszenia">
|
||||
<p>
|
||||
Komunikaty systemowe, które trafiają do <span className="text-ink">członków</span> —
|
||||
ten sam mechanizm co ogłoszenia siłowni, inne źródło wpisu.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
</div>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
34
web/src/sections/Cta.tsx
Normal file
34
web/src/sections/Cta.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { ArrowRight, ShieldCheck } from 'lucide-react';
|
||||
import { Reveal } from '../components/Reveal';
|
||||
import { adminUrl, appUrl } from '../lib/links';
|
||||
import { Section } from './shared';
|
||||
|
||||
/** CTA końcowa: „uruchom system”. */
|
||||
export function Cta() {
|
||||
return (
|
||||
<Section id="start">
|
||||
<Reveal className="mx-auto max-w-3xl text-center">
|
||||
<p className="font-mono text-xs tracking-widest text-accent">$ fitos --run</p>
|
||||
<h2 className="mt-3 text-3xl font-bold text-ink sm:text-4xl">System gotowy.</h2>
|
||||
<p className="mt-3 text-[15px] leading-relaxed text-dim">
|
||||
Włącz moduł, którego potrzebujesz: trening swój albo trening podopiecznych.
|
||||
</p>
|
||||
<div className="mt-7 flex flex-wrap items-center justify-center gap-3">
|
||||
<a
|
||||
href={appUrl()}
|
||||
className="inline-flex items-center gap-2 rounded-lg border-0 bg-(image:--btn-grad) px-5 py-2.5 text-sm font-bold text-accent-ink shadow-(--btn-shadow) transition-transform hover:-translate-y-px"
|
||||
>
|
||||
Otwórz aplikację <ArrowRight size={16} aria-hidden="true" />
|
||||
</a>
|
||||
<a
|
||||
href={adminUrl()}
|
||||
className="inline-flex items-center gap-2 rounded-lg border border-line bg-card px-5 py-2.5 text-sm font-semibold text-ink transition-colors hover:border-accent/50"
|
||||
>
|
||||
<ShieldCheck size={16} aria-hidden="true" className="text-accent" />
|
||||
Panel admina
|
||||
</a>
|
||||
</div>
|
||||
</Reveal>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
60
web/src/sections/Ecosystem.tsx
Normal file
60
web/src/sections/Ecosystem.tsx
Normal file
@@ -0,0 +1,60 @@
|
||||
import { Building2, Megaphone, Newspaper, ShieldCheck } from 'lucide-react';
|
||||
import { WindowCard } from '../components/WindowCard';
|
||||
import { Reveal } from '../components/Reveal';
|
||||
import { Section, SectionHeading } from './shared';
|
||||
|
||||
/** Sekcja „Ekosystem” — siłownie, sprzęt, feed. */
|
||||
export function Ecosystem() {
|
||||
return (
|
||||
<Section id="ekosystem">
|
||||
<SectionHeading
|
||||
kicker="/ekosystem"
|
||||
title="Ekosystem"
|
||||
lead="Siłownia to nie adres, tylko zbiór sprzętu, ludzi i zasad. FitOS modeluje jedne i drugie — od wirtualnych po prywatne."
|
||||
/>
|
||||
<div className="mt-12 grid gap-4 md:grid-cols-2">
|
||||
<Reveal>
|
||||
<WindowCard icon={Building2} title="Silownie.app">
|
||||
<p>
|
||||
Zaczynasz od <span className="text-ink">wirtualnych</span>: społeczność odwzorowuje
|
||||
prawdziwe siłownie, a oceny 👍/👎 mówią, czy opis dobrze oddaje rzeczywistość. Dalej{' '}
|
||||
<span className="text-ink">realne</span>: weryfikacja z dokumentami, adres, galeria z
|
||||
okładką, grafik i <span className="text-ink">pojemność</span>. Są też{' '}
|
||||
<span className="text-ink">prywatne</span> — wyłącznie z zaproszeniem.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal delayMs={60}>
|
||||
<WindowCard icon={ShieldCheck} title="Katalog.sprzetu">
|
||||
<p>
|
||||
Sprzęt prosto z katalogu:{' '}
|
||||
<span className="text-ink">
|
||||
hantle, kettlebell, sztanga, wyciąg, maszyna, ławka, cardio, masa ciała
|
||||
</span>
|
||||
. Każdy wpis ze specyfikacją i zdjęciami — plan wie, czym realnie zrobisz trening.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal>
|
||||
<WindowCard icon={Newspaper} title="Aktualnosci.feed">
|
||||
<p>
|
||||
Jeden <span className="text-ink">feed</span> na dwa źródła: plany od trenera i
|
||||
ogłoszenia siłowni. Ten sam kanał informuje Cię o zmianie planu i o awarii prądu.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal delayMs={60}>
|
||||
<WindowCard icon={Megaphone} title="Ogoloszenia.silowni">
|
||||
<p>Przykład, który zobaczysz w feedzie:</p>
|
||||
<p className="rounded-md border border-line bg-input px-3 py-2 font-mono text-xs text-ink">
|
||||
⚠ Awaria prądu — siłownia nieczynna
|
||||
</p>
|
||||
<p>
|
||||
Ogłoszenie trafia do <span className="text-ink">członków</span>, nie do całego świata.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
</div>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
62
web/src/sections/Footer.tsx
Normal file
62
web/src/sections/Footer.tsx
Normal file
@@ -0,0 +1,62 @@
|
||||
import { Brandmark } from '../components/Brandmark';
|
||||
import { adminUrl, appUrl } from '../lib/links';
|
||||
|
||||
const ABOUT: [string, string][] = [
|
||||
['Producent', 'FitOS'],
|
||||
['Wersja', 'MVP (v1)'],
|
||||
['Rdzeń', 'Express + Prisma + PostgreSQL'],
|
||||
['Interfejs', 'React + Vite, motyw Ember'],
|
||||
['Środowisko', 'dev / staging / prod — ten sam kod, inne porty'],
|
||||
];
|
||||
|
||||
/** Stopka „O tym systemie” — tabela w stylu About This Computer. */
|
||||
export function Footer() {
|
||||
return (
|
||||
<footer className="border-t border-line">
|
||||
<div className="mx-auto grid w-full max-w-6xl gap-10 px-5 py-14 md:grid-cols-2">
|
||||
<div>
|
||||
<div className="flex items-center gap-2.5">
|
||||
<Brandmark size={24} />
|
||||
<span className="font-display text-sm font-bold text-ink">O tym systemie</span>
|
||||
</div>
|
||||
<dl className="mt-4 overflow-hidden rounded-lg border border-line">
|
||||
{ABOUT.map(([term, value], i) => (
|
||||
<div
|
||||
key={term}
|
||||
className={`grid grid-cols-[8rem_1fr] gap-2 px-4 py-2.5 text-[12.5px] ${
|
||||
i % 2 ? 'bg-card' : 'bg-input/60'
|
||||
}`}
|
||||
>
|
||||
<dt className="font-medium text-dim">{term}</dt>
|
||||
<dd className="text-ink">{value}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
</div>
|
||||
<div className="flex flex-col justify-between gap-6">
|
||||
<p className="max-w-sm text-[13px] leading-relaxed text-dim">
|
||||
FitOS to system operacyjny treningu: plany, sesje na żywo, killstreak, trenerzy i
|
||||
siłownie — wszystko na jednym, self-hostedzie.
|
||||
</p>
|
||||
<div className="flex flex-wrap gap-3">
|
||||
<a
|
||||
href={appUrl()}
|
||||
className="inline-flex items-center gap-1.5 rounded-md border border-line bg-card px-3.5 py-2 text-[13px] font-semibold text-ink transition-colors hover:border-accent/50"
|
||||
>
|
||||
Otwórz aplikację <span aria-hidden="true">↗</span>
|
||||
</a>
|
||||
<a
|
||||
href={adminUrl()}
|
||||
className="inline-flex items-center gap-1.5 rounded-md border border-line bg-card px-3.5 py-2 text-[13px] font-semibold text-ink transition-colors hover:border-accent/50"
|
||||
>
|
||||
Panel admina <span aria-hidden="true">↗</span>
|
||||
</a>
|
||||
</div>
|
||||
<p className="font-mono text-[11px] text-dim">
|
||||
© {new Date().getFullYear()} FitOS — trening, który się dowozi.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
54
web/src/sections/Hero.tsx
Normal file
54
web/src/sections/Hero.tsx
Normal file
@@ -0,0 +1,54 @@
|
||||
import { ArrowRight, ShieldCheck } from 'lucide-react';
|
||||
import { BootLog } from '../components/BootLog';
|
||||
import { PhoneMock } from '../components/PhoneMock';
|
||||
import { adminUrl, appUrl } from '../lib/links';
|
||||
|
||||
/** Hero jako boot screen: log startowy po lewej, mock telefonu po prawej. */
|
||||
export function Hero() {
|
||||
return (
|
||||
<section className="relative mx-auto w-full max-w-6xl px-5 pb-16 pt-14 sm:pb-24 sm:pt-20">
|
||||
<div className="grid items-center gap-12 lg:grid-cols-[1.15fr_0.85fr]">
|
||||
<div>
|
||||
<div className="window-glow rounded-lg border border-line bg-input/70 px-4 py-3 shadow-card">
|
||||
<BootLog />
|
||||
</div>
|
||||
|
||||
<h1 className="mt-8 text-4xl font-bold leading-[1.08] tracking-tight text-ink sm:text-6xl">
|
||||
Trening, <br />
|
||||
który się <span className="text-accent">dowozi.</span>
|
||||
</h1>
|
||||
<p className="mt-4 max-w-md text-[16.5px] leading-relaxed text-dim">
|
||||
FitOS to system operacyjny treningu. Od planowania po ostatnią serię.
|
||||
</p>
|
||||
|
||||
<div className="mt-7 flex flex-wrap items-center gap-3">
|
||||
<a
|
||||
href={appUrl()}
|
||||
className="inline-flex items-center gap-2 rounded-lg border-0 bg-(image:--btn-grad) px-5 py-2.5 text-sm font-bold text-accent-ink shadow-(--btn-shadow) transition-transform hover:-translate-y-px"
|
||||
>
|
||||
Otwórz aplikację <ArrowRight size={16} aria-hidden="true" />
|
||||
</a>
|
||||
<a
|
||||
href={adminUrl()}
|
||||
className="inline-flex items-center gap-2 rounded-lg border border-line bg-card px-5 py-2.5 text-sm font-semibold text-ink transition-colors hover:border-accent/50"
|
||||
>
|
||||
<ShieldCheck size={16} aria-hidden="true" className="text-accent" />
|
||||
Panel admina
|
||||
</a>
|
||||
</div>
|
||||
<p className="mt-4 font-mono text-[11px] text-dim">
|
||||
bez rejestracji z poziomu tej strony · dane treningowe zostają na Twoim serwerze
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="relative">
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="absolute inset-x-8 top-6 bottom-0 rounded-full bg-accent/10 blur-3xl"
|
||||
/>
|
||||
<PhoneMock />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
90
web/src/sections/ModulesTrainee.tsx
Normal file
90
web/src/sections/ModulesTrainee.tsx
Normal file
@@ -0,0 +1,90 @@
|
||||
import {
|
||||
CalendarDays,
|
||||
ClipboardList,
|
||||
Dumbbell,
|
||||
Flame,
|
||||
Ruler,
|
||||
Timer,
|
||||
TrendingUp,
|
||||
} from 'lucide-react';
|
||||
import { WindowCard } from '../components/WindowCard';
|
||||
import { Reveal } from '../components/Reveal';
|
||||
import { Section, SectionHeading } from './shared';
|
||||
|
||||
/** Sekcja „Moduły — dla ćwiczącego” (Trening.app). */
|
||||
export function ModulesTrainee() {
|
||||
return (
|
||||
<Section id="moduly">
|
||||
<SectionHeading
|
||||
kicker="/moduly/trening.app"
|
||||
title="Moduły — dla ćwiczącego"
|
||||
lead="Aplikacja, w której trenujesz. Każdy moduł to okienko jednego systemu — dane płyną między nimi bez kopiowania."
|
||||
/>
|
||||
<div className="mt-12 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Reveal>
|
||||
<WindowCard icon={ClipboardList} title="Plany.app">
|
||||
<p>
|
||||
Cała struktura treningu:{' '}
|
||||
<span className="text-ink">tydzień → dzień → sesja → seria</span>. Plan dojrzewa w
|
||||
trybie szkic → aktywny, a tygodnie mogą mieć aliasy („Deload”). Siłownia
|
||||
ogranicza dobór sprzętu, daty dni liczą się automatycznie.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal delayMs={60}>
|
||||
<WindowCard icon={Timer} title="Sesja na zywo">
|
||||
<p>
|
||||
Wpisujesz powtórzenia, <span className="text-ink">RIR 0–10</span> i suwak trudności{' '}
|
||||
<span className="text-ink">1–5</span>. Timer przerwy pilnuje przerw, a przycisk{' '}
|
||||
„Norma spełniona” domyka serię. Serie ponad plan? Proszę bardzo — jako
|
||||
bonus.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal delayMs={120}>
|
||||
<WindowCard icon={Flame} title="Killstreak.app">
|
||||
<p>
|
||||
Kolejne <span className="text-ink">skuteczne treningi</span> tworzą serię. Reset po
|
||||
pominięciu lub dniu częściowym — bez litości, bez oszukiwania. Widzisz rekord{' '}
|
||||
<span className="font-mono text-accent">best</span> i kropki z ostatnich 30 dni.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal>
|
||||
<WindowCard icon={TrendingUp} title="Postepy.app">
|
||||
<p>
|
||||
Wykresy szacowanego <span className="text-ink">1RM i objętości</span>, rekordy i
|
||||
delty. Ćwiczenia dopasowane do Twoich celów i wykluczeń — patrzysz na to, co realnie
|
||||
rośnie.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal delayMs={60}>
|
||||
<WindowCard icon={Ruler} title="Pomiary.app">
|
||||
<p>
|
||||
Waga i obwody: <span className="text-ink">klatka, talia, biceps L/P</span> i reszta
|
||||
taśmy. System liczy deltę od pierwszego pomiaru, więc postęp widać w liczbach, nie w
|
||||
lustrze.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal delayMs={120}>
|
||||
<WindowCard icon={CalendarDays} title="Kalendarz.app">
|
||||
<p>
|
||||
Rok treningowy na jednym ekranie:{' '}
|
||||
<span className="text-ink">norma, bonus, deficyt</span> w każdym dniu. Historia z
|
||||
komentarzami przy seriach — pamiętasz nie tylko ciężar, ale i dlaczego.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal className="sm:col-span-2 lg:col-span-3">
|
||||
<div className="flex items-center gap-3 rounded-lg border border-dashed border-line px-4 py-3 font-mono text-xs text-dim">
|
||||
<Dumbbell size={14} aria-hidden="true" className="flex-none text-accent" />
|
||||
pula ćwiczeń: 200+ ruchów z katalogu — Hantle, Kettlebell, Sztanga, Wyciąg, Maszyna,
|
||||
Ławka, Cardio, Masa ciała
|
||||
</div>
|
||||
</Reveal>
|
||||
</div>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
60
web/src/sections/ModulesTrainer.tsx
Normal file
60
web/src/sections/ModulesTrainer.tsx
Normal file
@@ -0,0 +1,60 @@
|
||||
import { CalendarCheck2, MessagesSquare, UserRound, UserRoundCog } from 'lucide-react';
|
||||
import { WindowCard } from '../components/WindowCard';
|
||||
import { Reveal } from '../components/Reveal';
|
||||
import { Section, SectionHeading } from './shared';
|
||||
|
||||
/** Sekcja „Moduły — dla trenera” (Coaching.app). */
|
||||
export function ModulesTrainer() {
|
||||
return (
|
||||
<Section id="trener">
|
||||
<SectionHeading
|
||||
kicker="/moduly/coaching.app"
|
||||
title="Moduły — dla trenera"
|
||||
lead="Ten sam system, inne konto. Trener widzi to, czego potrzebujesz do pracy z podopiecznym — nic więcej."
|
||||
/>
|
||||
<div className="mt-12 grid gap-4 md:grid-cols-2">
|
||||
<Reveal>
|
||||
<WindowCard icon={UserRound} title="Podopieczni.app">
|
||||
<p>
|
||||
Kokpit relacji w sześciu zakładkach:{' '}
|
||||
<span className="text-ink">
|
||||
Przegląd, Rozmowa, Dyscyplina, Postępy, Kalendarz, Plany
|
||||
</span>
|
||||
. System sam świeci flagami: <span className="text-accent">zerowany streak</span>,{' '}
|
||||
<span className="text-accent">brak sesji 7 dni</span>,{' '}
|
||||
<span className="text-accent">wysoki deficyt</span>. Serie kolorowane wg zakresu.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal delayMs={60}>
|
||||
<WindowCard icon={UserRoundCog} title="Planowanie.app">
|
||||
<p>
|
||||
Jeden <span className="text-ink">aktywny plan</span> na podopiecznego — zero wersji
|
||||
roboczych w obiegu. W normy wstawiasz <em>„Wyniki podopiecznego”</em>,
|
||||
więc progresja liczy się od realnych ciężarów, nie ze sufitu.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal>
|
||||
<WindowCard icon={MessagesSquare} title="Komunikator.app">
|
||||
<p>
|
||||
Relacja <span className="text-ink">trener ↔ podopieczny</span>, osobny wątek na
|
||||
relację. Zamiast zrzutu ekranu załączasz <span className="text-ink">sesję</span> albo
|
||||
konkretne <span className="text-ink">ćwiczenie z wynikami</span> — rozmowa ma
|
||||
kontekst.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
<Reveal delayMs={60}>
|
||||
<WindowCard icon={CalendarCheck2} title="Zaproszenia.app">
|
||||
<p>
|
||||
Współpraca trenerska i dostęp do <span className="text-ink">prywatnych siłowni</span>{' '}
|
||||
— przez zaproszenia z <span className="text-ink">terminem ważności</span>. Klucz
|
||||
wygasa, dostęp nie zostaje poślizgiem.
|
||||
</p>
|
||||
</WindowCard>
|
||||
</Reveal>
|
||||
</div>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
68
web/src/sections/Properties.tsx
Normal file
68
web/src/sections/Properties.tsx
Normal file
@@ -0,0 +1,68 @@
|
||||
import { Reveal } from '../components/Reveal';
|
||||
import { Section, SectionHeading } from './shared';
|
||||
|
||||
interface PropertyStat {
|
||||
value: string;
|
||||
label: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
const STATS: PropertyStat[] = [
|
||||
{
|
||||
value: 'PWA',
|
||||
label: 'Instalowalna',
|
||||
description: 'Dodajesz do ekranu głównego i działa jak aplikacja.',
|
||||
},
|
||||
{
|
||||
value: 'PL/EN',
|
||||
label: 'Dwa języki',
|
||||
description: 'Interfejs po polsku i angielsku, przełączany w locie.',
|
||||
},
|
||||
{ value: '2', label: 'Motywy', description: 'Ciemny i jasny — ten sam system, dwie poświaty.' },
|
||||
{
|
||||
value: 'JWT',
|
||||
label: 'access + refresh',
|
||||
description:
|
||||
'Krótki access w headerze, refresh w ciastku httpOnly z rotacją przy każdym odświeżeniu.',
|
||||
},
|
||||
{
|
||||
value: '100%',
|
||||
label: 'audyt ActivityLog',
|
||||
description: 'Każda czynność administratora trafia do logu — pełny audyt, bez wyjątków.',
|
||||
},
|
||||
{
|
||||
value: 'Self',
|
||||
label: 'hosted',
|
||||
description:
|
||||
'PostgreSQL + Prisma + Express + nginx na Twoim sprzęcie. Twoje dane, Twoje zasady.',
|
||||
},
|
||||
{
|
||||
value: '0',
|
||||
label: 'zależności zewnętrznych',
|
||||
description: 'W liczeniu treningu, serii i killstreaka nie ma żadnego zewnętrznego API.',
|
||||
},
|
||||
];
|
||||
|
||||
/** Sekcja „Właściwości systemu” — siatka statów jak okno „About”. */
|
||||
export function Properties() {
|
||||
return (
|
||||
<Section id="wlasciwosci">
|
||||
<SectionHeading
|
||||
kicker="/wlasciwosci"
|
||||
title="Właściwości systemu"
|
||||
lead="To, co pod maską — liczby, które da się sprawdzić w kodzie."
|
||||
/>
|
||||
<div className="mt-12 grid grid-cols-1 gap-px overflow-hidden rounded-lg border border-line bg-line sm:grid-cols-2 lg:grid-cols-4">
|
||||
{STATS.map((stat, i) => (
|
||||
<Reveal key={stat.label} delayMs={(i % 4) * 50} className="h-full">
|
||||
<div className="flex h-full flex-col gap-1 bg-card px-5 py-6">
|
||||
<span className="font-display text-3xl font-bold text-accent">{stat.value}</span>
|
||||
<span className="text-[13px] font-semibold text-ink">{stat.label}</span>
|
||||
<p className="mt-1 text-[12.5px] leading-relaxed text-dim">{stat.description}</p>
|
||||
</div>
|
||||
</Reveal>
|
||||
))}
|
||||
</div>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
88
web/src/sections/Roles.tsx
Normal file
88
web/src/sections/Roles.tsx
Normal file
@@ -0,0 +1,88 @@
|
||||
import { Dumbbell, Shield, UserRound, UsersRound } from 'lucide-react';
|
||||
import type { LucideIcon } from 'lucide-react';
|
||||
import { Reveal } from '../components/Reveal';
|
||||
import { Section, SectionHeading } from './shared';
|
||||
|
||||
interface Role {
|
||||
icon: LucideIcon;
|
||||
label: string;
|
||||
summary: string;
|
||||
gains: string[];
|
||||
}
|
||||
|
||||
// Treść 1:1 ze słownika ról panelu admina (admin common.json → roles).
|
||||
const ROLES: Role[] = [
|
||||
{
|
||||
icon: Dumbbell,
|
||||
label: 'Ćwiczący',
|
||||
summary: 'Zwykły członek siłowni — trenuje i korzysta z planów.',
|
||||
gains: ['Tworzenie planów i prowadzenie treningów', 'Dostęp do feedu i statystyk siłowni'],
|
||||
},
|
||||
{
|
||||
icon: UserRound,
|
||||
label: 'Trener',
|
||||
summary: 'Prowadzi podopiecznych i układa im plany treningowe.',
|
||||
gains: [
|
||||
'Zapraszanie podopiecznych i opieka nad nimi',
|
||||
'Tworzenie i edycja ich planów',
|
||||
'Wgląd w postępy podopiecznych',
|
||||
],
|
||||
},
|
||||
{
|
||||
icon: UsersRound,
|
||||
label: 'Właściciel',
|
||||
summary: 'Zarządza siłownią — to uprawnienie, nie samo członkostwo.',
|
||||
gains: [
|
||||
'Dane, godziny i adres siłowni',
|
||||
'Sprzęt, zdjęcia i grafik',
|
||||
'Zapraszanie ludzi i nadawanie im ról',
|
||||
],
|
||||
},
|
||||
{
|
||||
icon: Shield,
|
||||
label: 'Administrator',
|
||||
summary: 'Dostęp do całego panelu administratora FitOS.',
|
||||
gains: [
|
||||
'Zarządzanie wszystkimi użytkownikami i siłowniami',
|
||||
'Weryfikacja zgłoszeń siłowni',
|
||||
'Katalogi, komunikaty i logi systemowe',
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
/** Sekcja „Procesy” — role w systemie, karta na rolę. */
|
||||
export function Roles() {
|
||||
return (
|
||||
<Section id="role">
|
||||
<SectionHeading
|
||||
kicker="/procesy/role"
|
||||
title="Procesy — role"
|
||||
lead="Jedno konto, cztery tryby pracy. Rola decyduje, które okna systemu w ogóle zobaczysz."
|
||||
/>
|
||||
<div className="mt-12 grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
||||
{ROLES.map((role, i) => (
|
||||
<Reveal key={role.label} delayMs={i * 60} className="h-full">
|
||||
<div className="window-glow flex h-full flex-col rounded-lg border border-line bg-(image:--card-grad) p-5 shadow-card">
|
||||
<span className="grid size-10 place-items-center rounded-md border border-line bg-input text-accent">
|
||||
<role.icon size={18} aria-hidden="true" />
|
||||
</span>
|
||||
<h3 className="mt-4 font-display text-lg font-bold text-ink">{role.label}</h3>
|
||||
<p className="mt-1 text-[13px] leading-relaxed text-dim">{role.summary}</p>
|
||||
<ul className="mt-4 flex flex-1 flex-col gap-2 border-t border-line pt-4">
|
||||
{role.gains.map((g) => (
|
||||
<li key={g} className="flex gap-2 text-[13px] leading-snug text-dim">
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="mt-1.5 size-1.5 flex-none rounded-full bg-accent"
|
||||
/>
|
||||
{g}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</Reveal>
|
||||
))}
|
||||
</div>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
42
web/src/sections/SiteHeader.tsx
Normal file
42
web/src/sections/SiteHeader.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import { Brandmark } from '../components/Brandmark';
|
||||
import { appUrl } from '../lib/links';
|
||||
|
||||
const ANCHORS = [
|
||||
{ href: '#moduly', label: 'Moduły' },
|
||||
{ href: '#role', label: 'Role' },
|
||||
{ href: '#wlasciwosci', label: 'Właściwości' },
|
||||
];
|
||||
|
||||
/** Pasek „systemowy” — sticky, jak topbar apki: znak, wersja, kotwice, CTA. */
|
||||
export function SiteHeader() {
|
||||
return (
|
||||
<header className="sticky top-0 z-50 border-b border-line bg-bg/85 backdrop-blur-md">
|
||||
<div className="mx-auto flex h-14 w-full max-w-6xl items-center gap-3 px-5">
|
||||
<a href="#gora" className="flex items-center gap-2.5 text-ink">
|
||||
<Brandmark size={26} />
|
||||
<span className="font-display text-[15px] font-bold tracking-tight">FitOS</span>
|
||||
<span className="rounded-full border border-line bg-input px-2 py-0.5 font-mono text-[10px] text-dim">
|
||||
v1 · MVP
|
||||
</span>
|
||||
</a>
|
||||
<nav aria-label="Sekcje strony" className="ml-auto hidden items-center gap-5 sm:flex">
|
||||
{ANCHORS.map((a) => (
|
||||
<a
|
||||
key={a.href}
|
||||
href={a.href}
|
||||
className="text-[13px] font-medium text-dim transition-colors hover:text-ink"
|
||||
>
|
||||
{a.label}
|
||||
</a>
|
||||
))}
|
||||
</nav>
|
||||
<a
|
||||
href={appUrl()}
|
||||
className="ml-auto inline-flex items-center gap-1 rounded-md border-0 bg-(image:--btn-grad) px-3.5 py-1.5 text-[13px] font-bold text-accent-ink shadow-(--btn-shadow) transition-transform hover:-translate-y-px sm:ml-0"
|
||||
>
|
||||
Uruchom <span aria-hidden="true">▸</span>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
38
web/src/sections/shared.tsx
Normal file
38
web/src/sections/shared.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { ReactNode } from 'react';
|
||||
import { cn } from '../lib/utils';
|
||||
import { Reveal } from '../components/Reveal';
|
||||
|
||||
interface SectionHeadingProps {
|
||||
kicker: string;
|
||||
title: string;
|
||||
lead?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
/** Nagłówek sekcji: mono-kicker (ścieżka „plikowa”), tytuł i lead. */
|
||||
export function SectionHeading({ kicker, title, lead, className }: SectionHeadingProps) {
|
||||
return (
|
||||
<Reveal className={cn('mx-auto max-w-2xl text-center', className)}>
|
||||
<p className="font-mono text-xs tracking-widest text-accent">{kicker}</p>
|
||||
<h2 className="mt-2 text-3xl font-bold text-ink sm:text-4xl">{title}</h2>
|
||||
{lead && <p className="mt-3 text-[15px] leading-relaxed text-dim">{lead}</p>}
|
||||
</Reveal>
|
||||
);
|
||||
}
|
||||
|
||||
interface SectionProps {
|
||||
id: string;
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function Section({ id, children, className }: SectionProps) {
|
||||
return (
|
||||
<section
|
||||
id={id}
|
||||
className={cn('mx-auto w-full max-w-6xl scroll-mt-24 px-5 py-16 sm:py-20', className)}
|
||||
>
|
||||
{children}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
267
web/src/styles.css
Normal file
267
web/src/styles.css
Normal file
@@ -0,0 +1,267 @@
|
||||
@import 'tailwindcss';
|
||||
|
||||
/* ===== FitOS „Ember” — ciepły grafit + koral (dark, jedyny motyw strony web) ===== */
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
--bg: #141210;
|
||||
--bg-card: #1c1917;
|
||||
--bg-input: #0f0d0b;
|
||||
--line: #2b2620;
|
||||
--text: #f2ede6;
|
||||
--text-dim: #a1968a;
|
||||
--accent: #ff6b4a;
|
||||
--accent-dark: #f0542f;
|
||||
--accent-ink: #1c0d06;
|
||||
--accent-text: #ff7e61;
|
||||
|
||||
--shadow: 0 1px 0 color-mix(in srgb, var(--text) 4%, transparent) inset;
|
||||
--card-grad: linear-gradient(
|
||||
180deg,
|
||||
color-mix(in srgb, var(--text) 2.5%, var(--bg-card)),
|
||||
var(--bg-card) 60%
|
||||
);
|
||||
--glow: 0 8px 40px -16px color-mix(in srgb, var(--accent) 40%, transparent);
|
||||
--ambient: radial-gradient(
|
||||
720px 340px at 50% -80px,
|
||||
color-mix(in srgb, var(--accent) 8%, transparent),
|
||||
transparent 70%
|
||||
);
|
||||
--grain-opacity: 0.028;
|
||||
|
||||
--dur-1: 120ms;
|
||||
--dur-2: 180ms;
|
||||
--dur-3: 240ms;
|
||||
--ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
|
||||
|
||||
--btn-grad: linear-gradient(
|
||||
180deg,
|
||||
color-mix(in srgb, var(--accent) 88%, #fff),
|
||||
var(--accent-dark)
|
||||
);
|
||||
--btn-shadow:
|
||||
0 3px 14px -6px color-mix(in srgb, var(--accent) 65%, transparent),
|
||||
inset 0 1px 0 color-mix(in srgb, #fff 28%, transparent);
|
||||
--mark-grad: linear-gradient(
|
||||
160deg,
|
||||
color-mix(in srgb, var(--accent) 82%, #fff),
|
||||
var(--accent-dark)
|
||||
);
|
||||
--mark-shadow: 0 2px 10px -3px color-mix(in srgb, var(--accent) 60%, transparent);
|
||||
--radius: 0.875rem;
|
||||
}
|
||||
|
||||
/* Map design tokens to Tailwind utilities (bg-bg, text-dim, border-line, font-display, ...) */
|
||||
@theme inline {
|
||||
--font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
||||
--font-display: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
|
||||
--font-mono: 'Cascadia Code', ui-monospace, SFMono-Regular, Consolas, monospace;
|
||||
|
||||
--color-bg: var(--bg);
|
||||
--color-card: var(--bg-card);
|
||||
--color-input: var(--bg-input);
|
||||
--color-line: var(--line);
|
||||
--color-ink: var(--text);
|
||||
--color-dim: var(--text-dim);
|
||||
--color-accent: var(--accent);
|
||||
--color-accent-dark: var(--accent-dark);
|
||||
--color-accent-ink: var(--accent-ink);
|
||||
--color-accent-text: var(--accent-text);
|
||||
|
||||
--shadow-card: var(--shadow);
|
||||
--shadow-glow: var(--glow);
|
||||
|
||||
--radius-lg: var(--radius);
|
||||
--radius-md: calc(var(--radius) - 4px);
|
||||
--radius-sm: calc(var(--radius) - 6px);
|
||||
}
|
||||
|
||||
/* Pulsujący wskaźnik „na żywo” (kopiowany ze stylów apki) */
|
||||
@keyframes live-ping {
|
||||
0% {
|
||||
transform: scale(0.5);
|
||||
opacity: 0.8;
|
||||
}
|
||||
80%,
|
||||
100% {
|
||||
transform: scale(1.5);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.live-dot {
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border-radius: 99px;
|
||||
background: var(--accent);
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.live-dot::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -4px;
|
||||
border-radius: 99px;
|
||||
border: 1.5px solid var(--accent);
|
||||
opacity: 0.7;
|
||||
animation: live-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
|
||||
}
|
||||
|
||||
/* Kursor karetki w boot-logu */
|
||||
@keyframes caret-blink {
|
||||
0%,
|
||||
49% {
|
||||
opacity: 1;
|
||||
}
|
||||
50%,
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.boot-caret {
|
||||
display: inline-block;
|
||||
width: 0.55ch;
|
||||
height: 1.1em;
|
||||
margin-left: 2px;
|
||||
vertical-align: text-bottom;
|
||||
background: var(--accent);
|
||||
animation: caret-blink 1s steps(1) infinite;
|
||||
}
|
||||
|
||||
/* Zapalanie kropek killstreaka */
|
||||
@keyframes streak-ignite {
|
||||
from {
|
||||
transform: scale(0);
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.streak-dot {
|
||||
animation: streak-ignite 260ms var(--ease-out-quart) backwards;
|
||||
}
|
||||
|
||||
/* Wejścia sekcji na scroll (IntersectionObserver dodaje .revealed) */
|
||||
.reveal {
|
||||
opacity: 0;
|
||||
transform: translateY(18px);
|
||||
transition:
|
||||
opacity var(--dur-3) var(--ease-out-quart),
|
||||
transform var(--dur-3) var(--ease-out-quart);
|
||||
transition-delay: var(--reveal-delay, 0ms);
|
||||
}
|
||||
|
||||
.reveal.revealed {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
/* Glow kafelków-okien na hover */
|
||||
.window-glow {
|
||||
transition:
|
||||
box-shadow var(--dur-2) ease,
|
||||
border-color var(--dur-2) ease,
|
||||
transform var(--dur-2) var(--ease-out-quart);
|
||||
}
|
||||
|
||||
.window-glow:hover {
|
||||
border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
|
||||
box-shadow: var(--glow);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
@layer base {
|
||||
html {
|
||||
background-color: var(--bg);
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: var(--font-sans);
|
||||
background: transparent;
|
||||
color: var(--text);
|
||||
font-size: 15px;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
/* ciepła poświata u góry widoku */
|
||||
body::before {
|
||||
content: '';
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 420px;
|
||||
background: var(--ambient);
|
||||
pointer-events: none;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
/* ziarno — przełamuje płaskie powierzchnie */
|
||||
body::after {
|
||||
content: '';
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
z-index: 60;
|
||||
opacity: var(--grain-opacity);
|
||||
mix-blend-mode: overlay;
|
||||
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: var(--font-display);
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--accent-text);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: color-mix(in srgb, var(--accent) 32%, transparent);
|
||||
}
|
||||
|
||||
:focus-visible {
|
||||
outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Redukcja ruchu: typewriter/kropki/wejścia renderują się statycznie */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
html {
|
||||
scroll-behavior: auto;
|
||||
}
|
||||
|
||||
.live-dot::after,
|
||||
.boot-caret {
|
||||
animation: none;
|
||||
}
|
||||
|
||||
.boot-caret {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.streak-dot {
|
||||
animation: none;
|
||||
}
|
||||
|
||||
.reveal {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.window-glow:hover {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
77
web/test/e2e/fixtures.ts
Normal file
77
web/test/e2e/fixtures.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import { test as base, expect, type Page } from '@playwright/test';
|
||||
|
||||
export type { Page };
|
||||
|
||||
export interface ConsoleIssue {
|
||||
kind: 'console.error' | 'pageerror';
|
||||
text: string;
|
||||
}
|
||||
|
||||
interface GuardState {
|
||||
issues: ConsoleIssue[];
|
||||
allowed: RegExp[];
|
||||
}
|
||||
|
||||
const guards = new WeakMap<Page, GuardState>();
|
||||
|
||||
/**
|
||||
* Strona web nie wykonuje żadnych żądań — brak domyślnie ignorowanych błędów.
|
||||
* Jakikolwiek console.error/pageerror = FAIL.
|
||||
*/
|
||||
const DEFAULT_ALLOWED: RegExp[] = [];
|
||||
|
||||
/**
|
||||
* Test z automatycznym guardem błędów konsoli (kopia wzorca z app, bez mockApi).
|
||||
*
|
||||
* Każdy test importujący `test` z tego pliku FAILUJE, jeśli na stronie pojawi się:
|
||||
* - console.error (błąd z konsoli przeglądarki)
|
||||
* - nieobsłużony wyjątek (pageerror)
|
||||
*
|
||||
* Assert dzieje się automatycznie w afterEach — nie trzeba nic deklarować w teście.
|
||||
*/
|
||||
export const test = base;
|
||||
|
||||
test.beforeEach(({ page }) => {
|
||||
const state: GuardState = { issues: [], allowed: [...DEFAULT_ALLOWED] };
|
||||
guards.set(page, state);
|
||||
|
||||
page.on('console', (msg) => {
|
||||
if (msg.type() !== 'error') return;
|
||||
const text = msg.text();
|
||||
if (state.allowed.some((re) => re.test(text))) return;
|
||||
state.issues.push({ kind: 'console.error', text });
|
||||
});
|
||||
|
||||
page.on('pageerror', (err) => {
|
||||
const text = `${err.message}${err.stack ? `\n${err.stack}` : ''}`;
|
||||
if (state.allowed.some((re) => re.test(err.message))) return;
|
||||
state.issues.push({ kind: 'pageerror', text });
|
||||
});
|
||||
});
|
||||
|
||||
test.afterEach(({ page }, testInfo) => {
|
||||
const state = guards.get(page);
|
||||
if (!state || state.issues.length === 0) return;
|
||||
|
||||
testInfo.annotations.push({
|
||||
type: 'console-errors',
|
||||
description: state.issues.map((i) => `[${i.kind}] ${i.text}`).join('\n'),
|
||||
});
|
||||
|
||||
expect(
|
||||
state.issues,
|
||||
`Wykryto błędy konsoli / nieobsłużone wyjątki:\n${state.issues
|
||||
.map((i) => ` [${i.kind}] ${i.text}`)
|
||||
.join('\n')}`,
|
||||
).toEqual([]);
|
||||
});
|
||||
|
||||
/**
|
||||
* Dozwolone ignorowanie błędów konsoli pasujących do wzorca (wyjątki).
|
||||
*/
|
||||
export function allowConsoleError(page: Page, pattern: RegExp) {
|
||||
const state = guards.get(page);
|
||||
if (state) state.allowed.push(pattern);
|
||||
}
|
||||
|
||||
export { expect };
|
||||
35
web/test/e2e/landing.spec.ts
Normal file
35
web/test/e2e/landing.spec.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { expect, test } from './fixtures';
|
||||
|
||||
test('tytuł i komunikat główny strony', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await expect(page).toHaveTitle('FitOS — Trening, który się dowozi.');
|
||||
await expect(page.getByRole('heading', { level: 1 })).toHaveText('Trening, który się dowozi.');
|
||||
});
|
||||
|
||||
test('boot log wpisuje linie i zostawia je widoczne', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await expect(page.getByText('$ system gotowy — 0 błędów')).toBeVisible({ timeout: 15_000 });
|
||||
await expect(page.getByText('moduł Trening', { exact: false })).toBeVisible();
|
||||
await expect(page.getByText('OK', { exact: true })).toHaveCount(3);
|
||||
});
|
||||
|
||||
test('nawigacja kotwicowa i CTA prowadzą na porty dev', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
const nav = page.getByRole('navigation', { name: 'Sekcje strony' });
|
||||
await expect(nav.getByRole('link', { name: 'Moduły' })).toHaveAttribute('href', '#moduly');
|
||||
await expect(nav.getByRole('link', { name: 'Role' })).toHaveAttribute('href', '#role');
|
||||
await expect(nav.getByRole('link', { name: 'Właściwości' })).toHaveAttribute(
|
||||
'href',
|
||||
'#wlasciwosci',
|
||||
);
|
||||
|
||||
const appLinks = page.getByRole('link', { name: /Otwórz aplikację/ });
|
||||
await expect(appLinks.first()).toHaveAttribute('href', /^http:\/\/localhost:9001$/);
|
||||
await expect(appLinks).toHaveCount(3);
|
||||
|
||||
const adminLinks = page.getByRole('link', { name: /Panel admina/ });
|
||||
await expect(adminLinks.first()).toHaveAttribute('href', /^http:\/\/localhost:9000$/);
|
||||
|
||||
// kotwice istnieją w dokumencie
|
||||
await expect(page.locator('section#moduly, section#role, section#wlasciwosci')).toHaveCount(3);
|
||||
});
|
||||
33
web/test/landing.test.tsx
Normal file
33
web/test/landing.test.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import App from '../src/App';
|
||||
|
||||
describe('strona-wizytówka FitOS', () => {
|
||||
it('renderuje nagłówek główny z hasłem systemu', () => {
|
||||
render(<App />);
|
||||
expect(
|
||||
screen.getByRole('heading', { level: 1, name: 'Trening, który się dowozi.' }),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('CTA kierują do aplikacji i panelu admina na domyślnych portach dev', () => {
|
||||
render(<App />);
|
||||
const app = screen.getAllByRole('link', { name: /Otwórz aplikację/i })[0];
|
||||
const admin = screen.getAllByRole('link', { name: /Panel admina/i })[0];
|
||||
expect(app).toHaveAttribute('href', 'http://localhost:9001');
|
||||
expect(admin).toHaveAttribute('href', 'http://localhost:9000');
|
||||
});
|
||||
|
||||
it('pokazuje opisy modułów i ról po polsku', () => {
|
||||
render(<App />);
|
||||
expect(screen.getByText('Moduły — dla ćwiczącego')).toBeInTheDocument();
|
||||
expect(screen.getByText('Moduły — dla trenera')).toBeInTheDocument();
|
||||
expect(screen.getByText('Ekosystem')).toBeInTheDocument();
|
||||
expect(screen.getByText('Procesy — role')).toBeInTheDocument();
|
||||
expect(screen.getByText('Właściwości systemu')).toBeInTheDocument();
|
||||
expect(screen.getByText('Killstreak')).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByText('Prowadzi podopiecznych i układa im plany treningowe.'),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
9
web/test/setup.ts
Normal file
9
web/test/setup.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import '@testing-library/jest-dom/vitest';
|
||||
import { afterEach } from 'vitest';
|
||||
import { cleanup } from '@testing-library/react';
|
||||
|
||||
// vitest działa z globals:false, więc auto-cleanup RTL nie jest rejestrowany
|
||||
// automatycznie; sprzątamy DOM po każdym teście.
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
});
|
||||
22
web/tsconfig.app.json
Normal file
22
web/tsconfig.app.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
"resolveJsonModule": true,
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"composite": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
14
web/tsconfig.e2e.json
Normal file
14
web/tsconfig.e2e.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"lib": ["ES2020", "DOM"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force"
|
||||
},
|
||||
"include": ["test/e2e", "playwright.config.ts"]
|
||||
}
|
||||
4
web/tsconfig.json
Normal file
4
web/tsconfig.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [{ "path": "./tsconfig.app.json" }]
|
||||
}
|
||||
12
web/vite.config.ts
Normal file
12
web/vite.config.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
|
||||
// Strona-wizytówka: zero wywołań API, więc BEZ proxy /api (w przeciwieństwie do app/admin).
|
||||
export default defineConfig({
|
||||
plugins: [react(), tailwindcss()],
|
||||
server: {
|
||||
port: 5175,
|
||||
host: true,
|
||||
},
|
||||
});
|
||||
14
web/vitest.config.ts
Normal file
14
web/vitest.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
esbuild: {
|
||||
// testy są poza tsconfig.app.json (jsx: react-jsx dotyczy src) — wymuszamy
|
||||
// automatyczny runtime JSX dla całej transformacji
|
||||
jsx: 'automatic',
|
||||
},
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
setupFiles: ['test/setup.ts'],
|
||||
include: ['test/**/*.{test.ts,tsx}'],
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user