A WebAuthn passwordless authentication demo built with Go backend and React frontend. Features functional programming patterns with try monads for robust error handling.
Stack: Go + FastHTTP, React + TypeScript + Vite, PostgreSQL, Redis
# 1. Copy environment configuration
cp .env.example .env
# 2. Start all services with hot reload
docker-compose up --watchAccess:
- Frontend:
http://localhost:5173(Vite dev server with hot reload) - Backend API:
http://localhost:8080(Go with hot reload) - Database:
localhost:5555(PostgreSQL)
Hot Reload: Both frontend and backend automatically reload on file changes.
Copy .env.example to .env and adjust values as needed:
cp .env.example .envNote: Remove user: 501:501 in docker-compose.yml if using mount volumes.
Functional Programming Approach: Uses IBM/fp-go inspired try monad pattern for clean error handling and functional composition.
Key Features:
- Custom try monad implementation in
types/try_monad.go - Centralized error system in
internal/weberror/ - Functional composition in handlers and utilities
- Clean separation between business logic and HTTP concerns
Development Commands:
make run- Run Go app locallymake build- Build binarymake docker-up- Start all servicescd views && npm run dev- Frontend dev server
- UI and persist display name
- persist credentials table for 1 to many relationship with user table.