/bin: compiled binaries (e.g., air, build artifacts)
/cmd/api: main HTTP API server (entrypoint and route handlers)
/cmd/migrate: Database migration SQL files and seed logic
/docs: project documentation (designs, API specs, notes)
/internal/db: db connection utilities and seeding helpers
/internal/env: environment variable configuration and helpers
/internal/store: storage layer: database access logic for posts, users, etc.
/scripts: supporting SQL and shell scripts
- Project Architecture:
- Set Up Development Environment
- Clean Layered Architecture
- Scaffolding API Server:
- Set Up HTTP Server and API: net/http, go-chi
- Add Hot Reloading: air
- Environment Variables: direnv
- Databases:
- Repository Pattern
- Running PostgreSQL container on Docker
- Configuring the DB Connection Pool
- Persisting Data
- SQL Migrations
- Posts CRUD:
- Marshalling JSON
- Creating a Post
- Getting a Post by ID
- Internal Errors Package
- HTTP Payload Validation: go-validator
- DB Relationships
- SQL Joins
- Adding Comments to Posts
- Updating Posts: PATCH
- Deleting Posts
- Standardising JSON Responses
- Optimistic Concurrency Control
- Managing SQL Query Timeouts
- Database Seeding
- The User Feed:
- Creating User Profile
- Get User By ID
- Add Followers Table
- SQL Indexes
- User Feed Algorithm
- Filtering, Sorting, and Pagination:
- Pagination
- Sorting
- Fuzzy Search
- Swagger
- API Docs
- Documented Routes
- Logging
- Adding Structured Logging
- User Creation
- User Registration Flow
- SQL Transactions
- User Activation