Files
hnh-map/docs/development.md
Nikolay Tatarinov fea17e6bac Refactor routing and documentation for SPA deployment
- Updated the application to serve the SPA from the root path instead of /map/, enhancing accessibility.
- Modified redirect logic to ensure backward compatibility with old /map/* URLs.
- Adjusted documentation across multiple files to reflect the new routing structure and API endpoints.
- Improved handling of OAuth redirects and session management in the backend.
- Updated frontend configuration to align with the new base URL settings.
2026-02-25 00:32:59 +03:00

51 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Разработка
## Локальный запуск
### Бэкенд (Go)
Из корня репозитория:
```bash
go build -o hnh-map ./cmd/hnh-map
./hnh-map -grids=./grids -port=8080
```
Или без сборки:
```bash
go run ./cmd/hnh-map -grids=./grids -port=8080
```
Сервер будет отдавать статику из каталога `frontend/` (нужно предварительно собрать фронт, см. ниже).
### Фронтенд (Nuxt)
```bash
cd frontend-nuxt
npm install
npm run dev
```
В dev-режиме приложение доступно по корню (например `http://localhost:3000/`). Бэкенд должен быть доступен; при необходимости настройте прокси в `nuxt.config.ts` (например на `http://localhost:8080`).
### Docker Compose (разработка)
```bash
docker compose -f docker-compose.dev.yml up
```
- Фронт: порт **3000** (Nuxt dev-сервер).
- Бэкенд: порт **3080** (чтобы не конфликтовать с другими сервисами на 8080).
Откройте http://localhost:3000/. Запросы к `/map/api`, `/map/updates`, `/map/grids` проксируются на бэкенд (host `backend`, порт 3080).
### Сборка образа и prod-композ
```bash
docker build -t hnh-map .
docker compose -f docker-compose.prod.yml up -d
```
В prod фронт собран в образ и отдаётся бэкендом из каталога `frontend/`; порт 8080.