- Introduced .editorconfig for consistent coding styles across the project. - Added .golangci.yml for Go linting configuration. - Updated AGENTS.md to clarify project structure and components. - Enhanced CONTRIBUTING.md with Makefile usage for common tasks. - Updated Dockerfiles to use Go 1.24 and improved build instructions. - Refined README.md and deployment documentation for clarity. - Added testing documentation in testing.md for backend and frontend tests. - Introduced Makefile for streamlined development commands and tasks.
49 lines
2.9 KiB
Markdown
49 lines
2.9 KiB
Markdown
# hnh-map
|
|
|
|
Automapper server for HnH, (mostly) compatible with https://github.com/APXEOLOG/hnh-auto-mapper-server
|
|
|
|
The Docker image is built from sources in this repository.
|
|
|
|
**Ports:** In production the app listens on **8080**. For local development with `docker-compose.dev.yml`, the frontend runs on **3000** and the backend on **3080** (to avoid conflicts with other services on 8080).
|
|
|
|
Run it via whatever you feel like. The app expects `/map` to be mounted as a volume (database and images are stored here):
|
|
|
|
docker build -t hnh-map .
|
|
docker run -v /srv/hnh-map:/map -p 80:8080 hnh-map
|
|
|
|
Set it up under a domain name however you prefer (nginx reverse proxy, traefik, caddy, apache, whatever) and
|
|
point your auto-mapping supported client at it (like Purus pasta).
|
|
|
|
## Documentation
|
|
|
|
- [Architecture](docs/architecture.md) — high-level design and backend layout (`cmd/hnh-map`, `internal/app`)
|
|
- [API](docs/api.md) — HTTP API (auth, cabinet, map data, admin)
|
|
- [Configuration](docs/configuration.md) — environment variables and flags
|
|
- [Development](docs/development.md) — local run, Docker Compose dev, build
|
|
- [Deployment](docs/deployment.md) — Docker, reverse proxy, backups
|
|
|
|
See also [CONTRIBUTING.md](CONTRIBUTING.md) for development workflow.
|
|
|
|
In production the app serves static assets from the `frontend/` directory; that directory is the **build output** of the app in `frontend-nuxt/` (see [docs/development.md](docs/development.md)).
|
|
|
|
Only other thing you need to do is setup users and set your zero grid.
|
|
|
|
First login: username **admin**, password from `HNHMAP_BOOTSTRAP_PASSWORD` (in dev Compose it defaults to `admin`). Go to the admin portal and hit "ADD USER". Don't forget to toggle on all the roles (you'll need admin, at least)
|
|
|
|
### OAuth (Google)
|
|
|
|
To enable "Login with Google", set `HNHMAP_OAUTH_GOOGLE_CLIENT_ID`, `HNHMAP_OAUTH_GOOGLE_CLIENT_SECRET`, and `HNHMAP_BASE_URL` (your app's full URL). Create OAuth credentials in Google Cloud Console and add the callback URL `{HNHMAP_BASE_URL}/map/api/oauth/google/callback` to Authorized redirect URIs. See [deployment.md](docs/deployment.md) for details.
|
|
|
|
Once you create your first user, you'll get kicked out and have to log in as it.
|
|
The admin user will be gone at this point. Next you'll want to add users for anyone else, and then you'll need to create your tokens to upload stuff.
|
|
|
|
You'll probably want to set the prefix (this gets put at the front of the tokens, and should be something like `http://example.com`) to make it easier to configure clients.
|
|
|
|
The first client to connect will set the 0,0 grid, but you can wipe the data in the admin portal to reset (and the next client to connect should set a new 0,0 grid)
|
|
|
|
### Roles
|
|
|
|
- **Map**: View the map
|
|
- **Upload**: Send character, marker, and tile data to the server
|
|
- **Admin**: Modify server settings, create and edit users, wipe data
|