NexThings Core is the backend service for user authentication and device-registry foundations in the NexThings platform.
- Go
- Fiber
- GORM
- SQLite (local) / PostgreSQL (production)
- Swagger UI (OpenAPI)
cmd/main.goapplication entrypointinternal/routesroute registrationinternal/handlers/apiAPI handlersinternal/modelsdatabase modelsinternal/schemasrequest/response schema definitionsinternal/templateslanding page templatesdocsgenerated OpenAPI spec files
- Install dependencies:
go mod tidy- Create a
.envfile in the project root:
NEXTHINGS_PORT=8080
NEXTHINGS_ENVIRONMENT=Local
NEXTHINGS_POSTGRES_DSN=
NEXTHINGS_EMAIL_FROM=
NEXTHINGS_EMAIL_APP_PASSWORD=- Start the server:
go run ./cmd/main.goServer starts on http://localhost:8080 by default.
- Swagger UI:
http://localhost:8080/docs/index.html - OpenAPI JSON:
http://localhost:8080/docs/doc.json
If you change handler annotations, regenerate docs:
go install github.com/swaggo/swag/cmd/swag@latest
$(go env GOPATH)/bin/swag init -g cmd/main.go -o docsPOST /api/v1/users/registerPOST /api/v1/users/loginGET /api/v1/users/verify-account/:uid/:tokenPATCH /api/v1/users/reset-password/
- Local mode uses SQLite file
nexthings.sqlite. - Production mode uses PostgreSQL DSN from
NEXTHINGS_POSTGRES_DSN.