A simple Todo List web application built with Go, demonstrating DO-178C compliance practices.
| ID | Requirement |
|---|---|
| REQ01 | Users should be able to LOGIN |
| REQ02 | Users should be able to create new TODOs |
| REQ03 | Users should be able to see all todo lists |
| REQ04 | Users should NOT be able to modify/delete TODOs they did not create |
- Language: Go 1.25+
- Web Framework: Gin
- Database: SQLite or PostgreSQL with GORM
- Authentication: JWT (golang-jwt/jwt/v5), optional OIDC login
- Password Hashing: bcrypt
todo_app/
├── main.go # Application entry point
├── go.mod # Go module definition
├── models/
│ └── models.go # Database models (User, Todo)
├── db/
│ └── db.go # Database initialization
├── auth/
│ └── auth.go # Authentication middleware and helpers
├── handlers/
│ ├── auth_handler.go # Login/Register handlers
│ └── todo_handler.go # Todo CRUD handlers
├── PLAN.md # Software development plan
├── CONFIGURATION.md # Configuration documentation
└── TEST_REQUIREMENT_TRACE.md # Requirements traceability matrix
POST /api/register- Register a new userPOST /api/login- Login and receive JWT tokenGET /api/auth/config- Return public auth configurationGET /api/auth/oidc/login- Start OIDC authorization-code loginGET /api/auth/oidc/callback- Complete OIDC login and receive JWT tokenGET /api/todos- List all todos (REQ03)GET /api/todos/:id- Get a specific todo (REQ03)
POST /api/todos- Create a new todo (REQ02)PUT /api/todos/:id- Update a todo (REQ04 - owner only)DELETE /api/todos/:id- Delete a todo (REQ04 - owner only)
# Download dependencies
go mod tidy
# Run the application
go run main.go
# Or build and run
go build -o todo-app
./todo-appPORT- Server port (default: 8080)APP_ENV/ENV/GIN_MODE- Runtime mode; set production values to requireJWT_SECRETJWT_SECRET- JWT signing secret, required outside development modeCORS_ALLOWED_ORIGIN- Allowed browser origin for CORS; empty defaults to same-origin onlyDB_DRIVER- Database driver:sqliteorpostgres(default:sqlite)DB_PATH- SQLite database path (default: todo_app.db)DB_HOST- PostgreSQL/RDS hostDB_PORT- PostgreSQL/RDS port (default: 5432)DB_NAME- PostgreSQL database nameDB_USER- PostgreSQL database userDB_REGION/AWS_REGION- AWS region for RDS IAM authenticationDB_SSLMODE- PostgreSQL TLS mode (default: verify-full; supported values:verify-full,verify-ca)DB_SSLROOTCERT/DB_RDS_CA_CERT_PATH- RDS CA bundle pathDB_IAM_AUTH- Enable RDS IAM auth token generation (default: true)DB_PASSWORD- Optional PostgreSQL password for non-IAM connections (DB_IAM_AUTH=false)DB_MAX_OPEN_CONNS- PostgreSQL max open connections (default: 25)DB_MAX_IDLE_CONNS- PostgreSQL max idle connections (default: 5)OIDC_ISSUER_URL- OIDC issuer URLOIDC_CLIENT_ID- OIDC client IDOIDC_CLIENT_SECRET- OIDC client secretOIDC_REDIRECT_URL- OIDC redirect URLOIDC_STATE_SECRET- OIDC state cookie signing secret; falls back toJWT_SECRETwhen unsetOIDC_COOKIE_SECURE- Set OIDC state cookieSecureattribute (default: true; set false only for local HTTP)OIDC_CODE_VERIFIER_STORE_MAX_ENTRIES- Max in-memory OIDC PKCE verifier entries (default: 1024)
# Run all tests
go test ./...
# Run tests with coverage
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.outMIT