A Go application that indexes conference talks from moresleep into Elasticsearch.
This application fetches talk data from a moresleep instance and indexes it into two Elasticsearch indexes:
javazone_private: All talks with full data (requires authentication)javazone_public: Only talks with status "APPROVED" (public data only)
make templ # Generate templ templates
make build # Build the application (includes templ)
make test # Run tests
make run # Run the application locally (includes templ)
make fmt # Format code
make lint # Run linter
make docker # Build Docker image
make up # Start all services with docker compose
make down # Stop all servicesThis project uses clean hexagonal architecture:
internal/adapters/- Infrastructure implementationsapi/- HTTP API handlersweb/- Web admin dashboard (templ + htmx)handlers/- Web request handlerstemplates/- templ templates
auth/- OIDC authentication (middleware, handlers)session/- In-memory session storagemoresleep/- Client for fetching data from moresleep APIelasticsearch/- Elasticsearch bulk indexing client
internal/app/- Business logic (indexing service)internal/config/- Centralized configurationinternal/domain/- Domain models (Talk, Conference, Speaker)internal/ports/- Port interfaces (TalkSource, SearchIndex)
| Variable | Description | Default |
|---|---|---|
MODE |
Running mode (production or development). API disabled in production. |
production |
PORT |
HTTP server port | 8080 |
MORESLEEP_URL |
Base URL of moresleep instance | http://localhost:8082 |
MORESLEEP_USER |
Username for moresleep authentication | (empty) |
MORESLEEP_PASSWORD |
Password for moresleep authentication | (empty) |
ELASTICSEARCH_URL |
Elasticsearch URL | http://localhost:9200 |
ELASTICSEARCH_USER |
Username for Elasticsearch authentication | (empty) |
ELASTICSEARCH_PASSWORD |
Password for Elasticsearch authentication | (empty) |
PRIVATE_INDEX |
Name of private index | javazone_private |
PUBLIC_INDEX |
Name of public index | javazone_public |
OIDC_ISSUER_URL |
OIDC provider issuer URL (production only) | (empty) |
OIDC_CLIENT_ID |
OIDC client ID (production only) | (empty) |
OIDC_CLIENT_SECRET |
OIDC client secret (production only) | (empty) |
OIDC_REDIRECT_URL |
OIDC callback URL (production only) | (empty) |
| Method | Path | Description |
|---|---|---|
| GET | /health |
Health check endpoint |
| POST | /api/reindex |
Trigger full reindex of all conferences |
| POST | /api/reindex/conference/{slug} |
Reindex a specific conference |
| POST | /api/reindex/talk/{talkId} |
Reindex a specific talk |
| GET | /admin |
Web admin dashboard (auth required in production) |
| GET | /auth/callback |
OIDC callback handler (production only) |
| POST | /auth/logout |
Logout and clear session (production only) |
Tests use testify for assertions. Run with:
make testFor coverage report:
make coverage- Start Elasticsearch:
make up - Run the application:
make run - Trigger reindex:
curl -X POST http://localhost:8080/api/reindex