TPTIP-3: настроить выдачу каталога, проверки и сбор ошибок
This commit is contained in:
parent
6713e77330
commit
cbc89c1038
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@ -0,0 +1,5 @@
|
||||
.git
|
||||
node_modules
|
||||
.env
|
||||
.env.*
|
||||
test-results
|
||||
@ -9,7 +9,7 @@ check="$1"
|
||||
cfg=.peppa/project.json
|
||||
cmd=$(jq -r --arg c "$check" '.checks[$c] // empty' "$cfg" 2>/dev/null)
|
||||
if [[ -z "$cmd" ]]; then
|
||||
echo "peppa: проверка «$check» не настроена — пропуск"
|
||||
echo "peppa: проверка «${check}» не настроена — пропуск"
|
||||
exit 0
|
||||
fi
|
||||
log=$(mktemp)
|
||||
|
||||
@ -69,8 +69,9 @@ report() { # report <status> [reason]
|
||||
}
|
||||
|
||||
dc() { # dc <image> <compose args…>
|
||||
local img="$1"; shift
|
||||
IMAGE="$img" HOST="$host" ROUTER="$router" APP_PORT="$port" docker compose -p "$project" -f "$compose" "$@"
|
||||
local img="$1" sentry_env=staging; shift
|
||||
[[ $env_name == prod ]] && sentry_env=prod
|
||||
SENTRY_RELEASE="$sha" SENTRY_ENVIRONMENT="${SENTRY_ENVIRONMENT:-$sentry_env}" IMAGE="$img" HOST="$host" ROUTER="$router" APP_PORT="$port" docker compose -p "$project" -f "$compose" "$@"
|
||||
}
|
||||
|
||||
healthy() {
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@ -2,3 +2,8 @@ node_modules/
|
||||
.env
|
||||
.env.local
|
||||
.DS_Store
|
||||
|
||||
node_modules/
|
||||
test-results/
|
||||
playwright-report/
|
||||
generated/
|
||||
|
||||
15
.peppa/memory.md
Normal file
15
.peppa/memory.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Память проекта
|
||||
|
||||
## Команды
|
||||
- Проверки: bash .gitea/peppa-check.sh install|lint|test; npm ci, npm run lint, npm test. NODE_TEST_CONTEXT снимается в npm test, иначе Node пропускает запуск тестов.
|
||||
- TPTIP-3: npm ci; npm run build; npm start; проверки npm run lint и npm test, браузер npx playwright install chromium && npx playwright test. Каталог /recipes.html, ru/kk/en, локальные фото assets/.
|
||||
|
||||
## Решения
|
||||
- Приложение — index.html, данные в localStorage tpt.v1; чистая логика между LOGIC:START/END тестируется через node:vm, интерфейс — jsdom.
|
||||
- Каталог gym-plan.i18n.js содержит ru/kk/en (?lang= или язык браузера); GymPlan.draft создаёт независимый черновик для openWorkoutForm, сохраняется только обычная запись workouts.
|
||||
- server.js отдаёт файлы по белому списку FILES и /healthz; без index.html на / показывается about.html. Dockerfile использует COPY . . с .dockerignore.
|
||||
- Новый статический файл добавляйте в server.js FILES и sw.js FILES с повышением CACHE для офлайн-режима.
|
||||
- Переводы страницы продукта — about.i18n.json (ru/kk/en).
|
||||
|
||||
## Грабли
|
||||
- На 17.11.2026 origin/main содержал только bootstrap, приложение было в task/tptip-8, сервер — в task/tptip-6; task/tptip-5 включает обе зависимости. При объединении server.js и Dockerfile использована версия TPTIP-6.
|
||||
@ -1 +1,18 @@
|
||||
{"slug":"treker-po-trenirovkam-i-pitaniyu","key":"TPTIP","name":"Трекер по тренировкам и питанию","peppaUrl":"https://peppa.telecom.quest"}
|
||||
{
|
||||
"slug": "treker-po-trenirovkam-i-pitaniyu",
|
||||
"key": "TPTIP",
|
||||
"name": "Трекер по тренировкам и питанию",
|
||||
"peppaUrl": "https://peppa.telecom.quest",
|
||||
"checks": {
|
||||
"install": "npm ci",
|
||||
"lint": "npm run lint",
|
||||
"test": "npm test",
|
||||
"build": "npm run build"
|
||||
},
|
||||
"deploy": {
|
||||
"compose": "deploy/compose.yml",
|
||||
"service": "web",
|
||||
"port": 3000,
|
||||
"health": "/healthz"
|
||||
}
|
||||
}
|
||||
|
||||
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
FROM node:22-bookworm-slim AS build
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY telemetry-client.js ./
|
||||
RUN npm run build
|
||||
RUN npm prune --omit=dev
|
||||
|
||||
FROM node:22-bookworm-slim
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production PORT=3000
|
||||
COPY --from=build /app/node_modules ./node_modules
|
||||
COPY --from=build /app/generated ./generated
|
||||
COPY server.js recipes.html recipes.css recipes.js recipes-core.js recipes.data.json recipes.i18n.json recipes-status.i18n.js ./
|
||||
COPY assets ./assets
|
||||
EXPOSE 3000
|
||||
CMD ["node", "server.js"]
|
||||
@ -7,6 +7,10 @@ services:
|
||||
image: ${IMAGE}
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
SENTRY_DSN: "${SENTRY_DSN:-}"
|
||||
PUBLIC_SENTRY_DSN: "${PUBLIC_SENTRY_DSN:-}"
|
||||
SENTRY_RELEASE: "${SENTRY_RELEASE:-}"
|
||||
SENTRY_ENVIRONMENT: "${SENTRY_ENVIRONMENT:-dev}"
|
||||
PORT: "${APP_PORT:-3000}"
|
||||
networks:
|
||||
- traefik_default
|
||||
|
||||
@ -18,3 +18,8 @@
|
||||
пояснение о сыром весе и приблизительных значениях, сообщение отсутствия фото,
|
||||
ошибка загрузки и повторная попытка, подвал. Сверены с docs/glossary.md;
|
||||
обращение на «вы», технические идентификаторы и суммы отсутствуют.
|
||||
|
||||
Мониторинг ошибок: `SENTRY_DSN` для сервера, `PUBLIC_SENTRY_DSN` для браузера,
|
||||
`SENTRY_RELEASE` — SHA версии, `SENTRY_ENVIRONMENT` — dev/staging/prod.
|
||||
Без DSN SDK не инициализируется, sendDefaultPii выключен. Клиентский SDK
|
||||
собирается через `npm run build`; перед npm start выполните эту команду.
|
||||
|
||||
7
eslint.config.mjs
Normal file
7
eslint.config.mjs
Normal file
@ -0,0 +1,7 @@
|
||||
import js from '@eslint/js';
|
||||
import globals from 'globals';
|
||||
export default [
|
||||
{ ignores: ['node_modules/**', 'generated/**'] },
|
||||
js.configs.recommended,
|
||||
{ files: ['**/*.js', '**/*.mjs'], languageOptions: { globals: { ...globals.node, ...globals.browser } } }
|
||||
];
|
||||
@ -12,4 +12,4 @@
|
||||
- Node tests и ESLint; команды записываются в checks, для preview требуется Dockerfile и deploy из шаблона Node.
|
||||
|
||||
## Risks / Trade-offs
|
||||
Фото иллюстрируют блюдо и могут отличаться от результата → подпись на странице. Погрешность состава → явная подпись «примерно». Личные загрузки и Sentry не добавляются: нет нового backend поведения, отдельная инфраструктура вне задачи.
|
||||
Фото иллюстрируют блюдо и могут отличаться от результата → подпись на странице. Погрешность состава → явная подпись «примерно». Личные загрузки вне задачи. Sentry подключён по общему правилу проекта: DSN только из env, без DSN SDK не запускается; sendDefaultPii=false, release и environment из переменных окружения. Клиентский пакет собирается esbuild локально, внешнего CDN нет.
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
# Tasks
|
||||
|
||||
## 1. Каталог
|
||||
- [ ] 1.1 Добавить три рецепта, переводы ru/kk/en и локальные фотографии; проверить полноту данных и пересчёт тестами, записать источники фото.
|
||||
- [ ] 1.2 Сделать адаптивную страницу, управление порциями и замену недоступного фото; проверить в браузере, сверить тексты со словарём.
|
||||
- [x] 1.1 Добавить три рецепта, переводы ru/kk/en и локальные фотографии; проверить полноту данных и пересчёт тестами, записать источники фото.
|
||||
- [x] 1.2 Сделать адаптивную страницу, управление порциями и замену недоступного фото; проверить в браузере, сверить тексты со словарём.
|
||||
|
||||
## 2. Доставка и проверка
|
||||
- [ ] 2.1 Подключить выдачу страницы и ресурсов, настроить линтер и проверки; проверить HTTP-маршруты и запрет произвольных файлов тестами.
|
||||
- [ ] 2.2 Запустить проверки проекта, проверить страницу на узком экране и выполнить openspec validate.
|
||||
- [x] 2.1 Подключить выдачу страницы и ресурсов, настроить линтер и проверки; проверить HTTP-маршруты и запрет произвольных файлов тестами.
|
||||
- [x] 2.2 Запустить проверки проекта, проверить страницу на узком экране и выполнить openspec validate.
|
||||
|
||||
## Workflow follow-up
|
||||
- Записать память, архивировать change, открыть PR и передать на ревью.
|
||||
|
||||
2348
package-lock.json
generated
Normal file
2348
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
21
package.json
Normal file
21
package.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "tptip-recipes",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"test": "node --test tests/*.test.js",
|
||||
"start": "node server.js",
|
||||
"build": "esbuild telemetry-client.js --bundle --minify --outfile=generated/telemetry.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.0",
|
||||
"@playwright/test": "^1.56.0",
|
||||
"esbuild": "^0.28.2",
|
||||
"eslint": "^9.39.0",
|
||||
"globals": "^16.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sentry/browser": "^11.13.0",
|
||||
"@sentry/node": "^11.13.0"
|
||||
}
|
||||
}
|
||||
2
playwright.config.js
Normal file
2
playwright.config.js
Normal file
@ -0,0 +1,2 @@
|
||||
const { defineConfig } = require('@playwright/test');
|
||||
module.exports = defineConfig({ testDir: './tests/browser', use: { baseURL: 'http://127.0.0.1:3093', browserName: 'chromium' }, webServer: { command: 'node server.js', env: { PORT: '3093' }, url: 'http://127.0.0.1:3093/healthz' } });
|
||||
@ -1 +1 @@
|
||||
:root{font-family:system-ui,-apple-system,sans-serif;color:#243c33;background:#f5f4ed;font-synthesis:none}*{box-sizing:border-box}body{margin:0}main{max-width:1420px;margin:auto;padding:40px 5vw 60px}header{display:flex;justify-content:space-between;gap:24px;align-items:start;margin-bottom:28px}h1{font-family:Georgia,serif;font-size:clamp(2.5rem,5vw,4.4rem);font-weight:400;line-height:1.06;max-width:700px;margin:18px 0}header p{max-width:650px;line-height:1.6}.eyebrow{text-transform:uppercase;letter-spacing:.15em;font-size:.75rem;font-weight:700;color:#52725c}select,button{font:inherit;color:inherit;background:#fff;border:1px solid #c3ccc1;border-radius:10px;min-height:44px;padding:8px 14px}label{display:grid;gap:8px;font-size:.85rem}button{cursor:pointer}button:disabled{opacity:.35;cursor:default}button:focus-visible,select:focus-visible{outline:3px solid #9b632d;outline-offset:3px}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;align-items:start}article{background:#fff;border-radius:22px;overflow:hidden;border:1px solid #e0e5da}figure{margin:0;background:#e2e8dc;position:relative;min-height:210px}img{width:100%;aspect-ratio:1.5;object-fit:cover;display:block}.time{position:absolute;left:18px;bottom:16px;border-radius:20px;background:#fff;padding:7px 12px;font-size:.8rem}.content{padding:24px}h2{font-family:Georgia,serif;font-size:1.9rem;font-weight:400;margin:0 0 22px;line-height:1.2}h3{font-size:1.05rem;margin:26px 0 10px}.servings{display:flex;justify-content:space-between;align-items:center;gap:10px;padding-bottom:16px;border-bottom:1px solid #e3e8de}.controls{display:flex;gap:14px;align-items:center}output{min-width:12px;text-align:center;font-weight:700}.nutrition{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;background:#edf3e8;border-radius:12px;padding:14px 8px;margin:8px 0 0}.nutrition div{text-align:center}.nutrition strong{display:block;font-size:1.1rem}.nutrition span{font-size:.65rem;line-height:1.3;display:block;margin-top:5px}.small{font-size:.78rem;line-height:1.6;color:#536658}.ingredients{list-style:none;padding:0;margin:8px 0}.ingredients li{display:flex;justify-content:space-between;gap:16px;padding:9px 0;border-bottom:1px solid #edf0e8;font-size:.9rem}.ingredients b{white-space:nowrap}ol{padding-left:24px;margin:12px 0 0}ol li{font-size:.9rem;line-height:1.6;padding-left:4px;margin-bottom:12px}ol li::marker{color:#537347;font-weight:700}.note{max-width:850px;margin:28px 0;line-height:1.7;color:#536658;font-size:.85rem}footer{border-top:1px solid #d3ddce;padding-top:24px;font-family:Georgia,serif}.photo-error{padding:28px;line-height:1.6;margin:0}.failure{padding:40px;max-width:600px}.total{margin-top:16px}body[data-loaded="true"] main{animation:appear .3s ease-out}@keyframes appear{from{opacity:0}to{opacity:1}}@media(max-width:1050px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){main{padding:24px 18px 40px}header{display:block}header label{display:flex;align-items:center;margin-top:20px}.grid{grid-template-columns:1fr}h1{font-size:2.7rem}.content{padding:22px}img{aspect-ratio:1.6}}@media(prefers-reduced-motion:reduce){body[data-loaded="true"] main{animation:none}}
|
||||
:root{font-family:system-ui,-apple-system,sans-serif;color:#243c33;background:#f5f4ed;font-synthesis:none}*{box-sizing:border-box}body{margin:0}main{max-width:1420px;margin:auto;padding:40px 5vw 60px}header{display:flex;justify-content:space-between;gap:24px;align-items:start;margin-bottom:28px}h1{font-family:Georgia,serif;font-size:clamp(2.5rem,5vw,4.4rem);font-weight:400;line-height:1.06;max-width:700px;margin:18px 0}header p{max-width:650px;line-height:1.6}.eyebrow{text-transform:uppercase;letter-spacing:.15em;font-size:.75rem;font-weight:700;color:#52725c}select,button{font:inherit;color:inherit;background:#fff;border:1px solid #c3ccc1;border-radius:10px;min-height:44px;padding:8px 14px}label{display:grid;gap:8px;font-size:.85rem}button{cursor:pointer}button:disabled{opacity:.35;cursor:default}button:focus-visible,select:focus-visible{outline:3px solid #9b632d;outline-offset:3px}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;align-items:start}article{background:#fff;border-radius:22px;overflow:hidden;border:1px solid #e0e5da}figure{margin:0;background:#e2e8dc;position:relative;min-height:210px}img{width:100%;height:auto;aspect-ratio:1.5;object-fit:cover;display:block}.time{position:absolute;left:18px;bottom:16px;border-radius:20px;background:#fff;padding:7px 12px;font-size:.8rem}.content{padding:24px}h2{font-family:Georgia,serif;font-size:1.9rem;font-weight:400;margin:0 0 22px;line-height:1.2}h3{font-size:1.05rem;margin:26px 0 10px}.servings{display:flex;justify-content:space-between;align-items:center;gap:10px;padding-bottom:16px;border-bottom:1px solid #e3e8de}.controls{display:flex;gap:14px;align-items:center}output{min-width:12px;text-align:center;font-weight:700}.nutrition{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;background:#edf3e8;border-radius:12px;padding:14px 8px;margin:8px 0 0}.nutrition div{text-align:center}.nutrition strong{display:block;font-size:1.1rem}.nutrition span{font-size:.65rem;line-height:1.3;display:block;margin-top:5px}.small{font-size:.78rem;line-height:1.6;color:#536658}.ingredients{list-style:none;padding:0;margin:8px 0}.ingredients li{display:flex;justify-content:space-between;gap:16px;padding:9px 0;border-bottom:1px solid #edf0e8;font-size:.9rem}.ingredients b{white-space:nowrap}ol{padding-left:24px;margin:12px 0 0}ol li{font-size:.9rem;line-height:1.6;padding-left:4px;margin-bottom:12px}ol li::marker{color:#537347;font-weight:700}.note{max-width:850px;margin:28px 0;line-height:1.7;color:#536658;font-size:.85rem}footer{border-top:1px solid #d3ddce;padding-top:24px;font-family:Georgia,serif}.photo-error{padding:28px;line-height:1.6;margin:0}.failure{padding:40px;max-width:600px}.total{margin-top:16px}body[data-loaded="true"] main{animation:appear .3s ease-out}@keyframes appear{from{opacity:0}to{opacity:1}}@media(max-width:1050px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){main{padding:24px 18px 40px}header{display:block}header label{display:flex;align-items:center;margin-top:20px}.grid{grid-template-columns:1fr}h1{font-size:2.7rem}.content{padding:22px}img{aspect-ratio:1.6}}@media(prefers-reduced-motion:reduce){body[data-loaded="true"] main{animation:none}}
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title></title><link rel="stylesheet" href="/recipes.css">
|
||||
<script defer src="/recipes-status.i18n.js"></script><script defer src="/recipes-core.js"></script><script defer src="/recipes.js"></script>
|
||||
<script defer src="/telemetry.js"></script>
|
||||
</head>
|
||||
<body><main id="app" aria-busy="true"></main></body>
|
||||
</html>
|
||||
|
||||
57
server.js
Normal file
57
server.js
Normal file
@ -0,0 +1,57 @@
|
||||
const Sentry = require('@sentry/node');
|
||||
if (process.env.SENTRY_DSN) Sentry.init({ dsn: process.env.SENTRY_DSN, release: process.env.SENTRY_RELEASE, environment: process.env.SENTRY_ENVIRONMENT || 'dev', sendDefaultPii: false });
|
||||
// Мини-сервер стенда (TPTIP-6): слушает $PORT, /healthz → 200, отдаёт файлы приложения по белому списку.
|
||||
// Пока index.html нет, на «/» открывается каталог рецептов.
|
||||
const http = require('node:http');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const DIR = process.env.APP_DIR || __dirname;
|
||||
const FILES = {
|
||||
'/': ['index.html', 'text/html; charset=utf-8'],
|
||||
'/index.html': ['index.html', 'text/html; charset=utf-8'],
|
||||
'/manifest.webmanifest': ['manifest.webmanifest', 'application/manifest+json'],
|
||||
'/sw.js': ['sw.js', 'text/javascript; charset=utf-8'],
|
||||
'/icon.svg': ['icon.svg', 'image/svg+xml'],
|
||||
'/recipes.html': ['recipes.html', 'text/html; charset=utf-8'],
|
||||
'/recipes.css': ['recipes.css', 'text/css; charset=utf-8'],
|
||||
'/telemetry.js': ['generated/telemetry.js', 'text/javascript; charset=utf-8'],
|
||||
'/recipes.js': ['recipes.js', 'text/javascript; charset=utf-8'],
|
||||
'/recipes-core.js': ['recipes-core.js', 'text/javascript; charset=utf-8'],
|
||||
'/recipes.data.json': ['recipes.data.json', 'application/json; charset=utf-8'],
|
||||
'/recipes.i18n.json': ['recipes.i18n.json', 'application/json; charset=utf-8'],
|
||||
'/recipes-status.i18n.js': ['recipes-status.i18n.js', 'text/javascript; charset=utf-8'],
|
||||
'/assets/oats.jpg': ['assets/oats.jpg', 'image/jpeg'],
|
||||
'/assets/chicken.jpg': ['assets/chicken.jpg', 'image/jpeg'],
|
||||
'/assets/salad.jpg': ['assets/salad.jpg', 'image/jpeg'],
|
||||
'/about.html': ['about.html', 'text/html; charset=utf-8'],
|
||||
'/about.i18n.json': ['about.i18n.json', 'application/json; charset=utf-8']
|
||||
};
|
||||
const FALLBACK = { '/': ['recipes.html', 'text/html; charset=utf-8'] };
|
||||
|
||||
function send(res, f, fallback) {
|
||||
fs.readFile(path.join(DIR, f[0]), (err, buf) => {
|
||||
if (err && err.code === 'ENOENT' && fallback) return send(res, fallback, null);
|
||||
if (err && err.code === 'ENOENT') { res.writeHead(404); return res.end('not found'); }
|
||||
if (err) { res.writeHead(500); return res.end('error'); }
|
||||
res.writeHead(200, { 'content-type': f[1], 'cache-control': 'no-cache' });
|
||||
res.end(buf);
|
||||
});
|
||||
}
|
||||
|
||||
function createServer() {
|
||||
return http.createServer((req, res) => {
|
||||
const url = (req.url || '/').split('?')[0];
|
||||
if (url === '/healthz') { res.writeHead(200, { 'content-type': 'text/plain' }); return res.end('ok'); }
|
||||
if (url === '/telemetry.json') {
|
||||
res.writeHead(200, { 'content-type': 'application/json', 'cache-control': 'no-store' });
|
||||
return res.end(JSON.stringify({ dsn: process.env.PUBLIC_SENTRY_DSN || '', release: process.env.SENTRY_RELEASE, environment: process.env.SENTRY_ENVIRONMENT || 'dev' }));
|
||||
}
|
||||
const f = FILES[url];
|
||||
if (!f) { res.writeHead(404); return res.end('not found'); }
|
||||
send(res, f, FALLBACK[url]);
|
||||
});
|
||||
}
|
||||
|
||||
if (require.main === module) createServer().listen(Number(process.env.PORT) || 3000, '0.0.0.0');
|
||||
module.exports = { createServer };
|
||||
4
telemetry-client.js
Normal file
4
telemetry-client.js
Normal file
@ -0,0 +1,4 @@
|
||||
import * as Sentry from '@sentry/browser';
|
||||
fetch('/telemetry.json').then(response => response.json()).then(config => {
|
||||
if (config.dsn) Sentry.init({ ...config, sendDefaultPii: false });
|
||||
}).catch(() => { /* Optional telemetry must not prevent opening recipes. */ });
|
||||
@ -36,5 +36,5 @@ test('Узкий экран: тексты видимы, горизонтальн
|
||||
await page.goto('/recipes.html?lang=kk');
|
||||
await expect(page.locator('article')).toHaveCount(3);
|
||||
expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBeTruthy();
|
||||
await page.screenshot({ path: '/tmp/tptip-3-mobile.png', fullPage: true });
|
||||
await page.screenshot({ path: '/tmp/tptip-3-mobile.png', fullPage: true, animations: 'disabled' });
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user