A microservice for managing blog posts, comments, likes and user interactions.
Run the service:
go run cmd/main.go
The service will start on port 8080.
Run all tests:
go clean -testcache && go test -v ./...
Run specific module tests:
go test -v ./internal/users/...
go test -v ./internal/posts/...
go test -v ./internal/comments/...
go test -v ./internal/likes/...
go test -v ./internal/summary/...
Method | Endpoint | Module | Description |
---|---|---|---|
POST | /register |
Users | Register new user |
POST | /login |
Users | User authentication |
Method | Endpoint | Module | Description |
---|---|---|---|
POST | /posts |
Posts | Create new post |
POST | /posts/pubsub |
Posts | Publish post event |
Method | Endpoint | Module | Description |
---|---|---|---|
POST | /comments |
Comments | Create new comment |
POST | /comments/pubsub |
Comments | Publish comment event |
Method | Endpoint | Module | Description |
---|---|---|---|
POST | /likes |
Likes | Create new like |
POST | /likes/pubsub |
Likes | Publish like event |
Method | Endpoint | Module | Description |
---|---|---|---|
POST | /summary |
Summary | Get user's yearly activity summary |
Directory | Purpose |
---|---|
/cmd |
Main application entry points |
/config |
Application configuration |
/internal |
Private application code |
/internal/app |
Application bootstrapping and DI |
/internal/users |
User authentication & management |
/internal/posts |
Blog posts management |
/internal/comments |
Comments management |
/internal/likes |
Likes management |
/internal/summary |
Activity summary |
/pkg |
Shared packages |
/pkg/database |
Database utilities |
/pkg/middleware |
HTTP middleware |
/pkg/module |
Common interfaces |
/pkg/pubsub |
PubSub utilities |
/pkg/res |
HTTP response helpers |
/pkg/utils |
Common utilities |
/tests |
Integration & E2E tests |
/tests/e2e |
End-to-end tests |
/tests/helper |
Test helpers |