Skip to content

Commit 35b56f7

Browse files
committed
add web ui
1 parent 47fcf6f commit 35b56f7

1,446 files changed

Lines changed: 222224 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,8 @@ REDIS_DATABASE_FOR_AIOGRAM=0
5959
BASE_URL_API_LOCAL=http://localhost:8001/api
6060
BASE_URL_API_CONTAINER=http://api:8001/api
6161
BASE_URL_API_PROD=https://your-prod-domain.com/api
62+
63+
# ==========================================
64+
# WEB UI
65+
# ==========================================
66+
WEB_UI_PORT=3000

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ifeq (revision,$(firstword $(MAKECMDGOALS)))
55
$(eval $(RUN_ARGS):;@:)
66
endif
77

8-
.PHONY: start start-bot up down bot-up bot-down infra-up infra-down revision migrate
8+
.PHONY: start start-bot up down bot-up bot-down infra-up infra-down revision migrate ui-install ui-dev
99

1010
# --- Локальный запуск ---
1111

@@ -63,6 +63,16 @@ revision:
6363
migrate:
6464
uv run alembic upgrade head
6565

66+
# --- Web UI ---
67+
68+
# Установить зависимости web_ui
69+
ui-install:
70+
cd web_ui && npm install
71+
72+
# Запустить web_ui в dev-режиме (api должен быть запущен на localhost:8001)
73+
ui-dev:
74+
cd web_ui && npm run dev
75+
6676
# --- Lint ---
6777

6878
st:

docker-compose.bot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,16 @@ services:
8484
- "${PORT}:${PORT}"
8585
networks:
8686
- scheduler
87+
88+
web_ui:
89+
build:
90+
context: ./web_ui
91+
dockerfile: Dockerfile
92+
env_file: .env
93+
depends_on:
94+
- api
95+
restart: always
96+
ports:
97+
- "${WEB_UI_PORT}:80"
98+
networks:
99+
- scheduler

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,16 @@ services:
102102
restart: always
103103
networks:
104104
- scheduler
105+
106+
web_ui:
107+
build:
108+
context: ./web_ui
109+
dockerfile: Dockerfile
110+
env_file: .env
111+
depends_on:
112+
- api
113+
restart: always
114+
ports:
115+
- "${WEB_UI_PORT}:80"
116+
networks:
117+
- scheduler

web_ui/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node:20-alpine AS build
2+
3+
WORKDIR /app
4+
5+
COPY package.json package-lock.json ./
6+
RUN npm ci
7+
8+
COPY . .
9+
RUN npm run build
10+
11+
FROM nginx:alpine
12+
COPY --from=build /app/dist /usr/share/nginx/html
13+
COPY nginx.conf /etc/nginx/conf.d/default.conf
14+
15+
EXPOSE 80

web_ui/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Medication Reminders</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/src/main.tsx"></script>
11+
</body>
12+
</html>

web_ui/nginx.conf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
server {
2+
listen 80;
3+
root /usr/share/nginx/html;
4+
index index.html;
5+
6+
location /api {
7+
proxy_pass http://api:8001;
8+
proxy_http_version 1.1;
9+
proxy_set_header Host $host;
10+
proxy_set_header X-Real-IP $remote_addr;
11+
}
12+
13+
location / {
14+
try_files $uri $uri/ /index.html;
15+
}
16+
}

web_ui/node_modules/.bin/baseline-browser-mapping

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web_ui/node_modules/.bin/browserslist

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web_ui/node_modules/.bin/esbuild

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)