Skip to content

vonderklaas/social-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Folder Structure

/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

Order of Development

  1. Project Architecture:
  • Set Up Development Environment
  • Clean Layered Architecture
  1. Scaffolding API Server:
  • Set Up HTTP Server and API: net/http, go-chi
  • Add Hot Reloading: air
  • Environment Variables: direnv
  1. Databases:
  • Repository Pattern
  • Running PostgreSQL container on Docker
  • Configuring the DB Connection Pool
  • Persisting Data
  • SQL Migrations
  1. 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
  1. The User Feed:
  • Creating User Profile
  • Get User By ID
  • Add Followers Table
  • SQL Indexes
  • User Feed Algorithm
  1. Filtering, Sorting, and Pagination:
  • Pagination
  • Sorting
  • Fuzzy Search
  1. Swagger
  • API Docs
  • Documented Routes
  1. Logging
  • Adding Structured Logging
  1. User Creation
  • User Registration Flow
  • SQL Transactions
  • User Activation

About

A social networking backend built with Go. It features RESTful APIs for managing users, posts, and comments. It includes a modular structure, PostgreSQL, Docker, Redis, hot reloading, and more.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors