Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 1b7ad52

Browse files
committed
feat(docs): feature docs
1 parent e0e642d commit 1b7ad52

21 files changed

+2922
-0
lines changed

.opencode/init

Whitespace-only changes.

.opencode/opencode.db

4 KB
Binary file not shown.

.opencode/opencode.db-shm

32 KB
Binary file not shown.

.opencode/opencode.db-wal

125 KB
Binary file not shown.

AGENTS.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# GoPlate Agent Context
2+
3+
This guide provides essential dev context for automated agents working in this repository (GoPlate — a Go-based REST API boilerplate).
4+
5+
## 1. Build, Lint, and Test
6+
- **Build**: `make build` or `go build -o server main.go`
7+
- **Run**: `make run` (builds then runs)
8+
- **Dev (hot reload)**: `make dev` (needs reflex)
9+
- **Format**: `make fmt` or `go fmt ./...`
10+
- **Test all**: `make test` or `go test ./...`
11+
- **Test (single file)**: `go test ./path/to/pkg/file_test.go`
12+
- **Test Coverage**: `make test-coverage`
13+
- **Linting**: Uses `go fmt` (strict gofmt style); no golangci-lint config by default
14+
15+
## 2. Code Style Guidelines
16+
- **Imports**: Standard library, then third-party, then local imports (grouped, no blank lines between groups)
17+
- **Formatting**: Always use `gofmt`; tabs not spaces
18+
- **Types**: Prefer explicit struct field types; use `interface{}` or `any` sparingly (replace where modern Go suggests)
19+
- **Naming**: `CamelCase` for structs/interfaces, `camelCase` for vars, `ALL_CAPS` for constants; exported symbols are Capitalized
20+
- **Error handling**: Return Go `error` type; wrap or enrich errors with context (e.g., `fmt.Errorf`); log errors with `logs.Error`/`logs.Fatal`
21+
- **JSON struct tags**: Always used for API inputs/outputs
22+
- **Tests**: Standard `_test.go` files; assertions via Go testing or testify if added
23+
- **Env/config**: Managed via `env/` package and `.env` file
24+
25+
## 3. Project Structure
26+
- App code is under `cmd/`, `pkg/`, `domains/`, `router/`
27+
- DB/migrations/seed in `db/`, utility code in `pkg/utils/`
28+
29+
No Cursor or Copilot rules present. If new lint, type, or style guidelines are added, update this file accordingly.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- migrate:up
2+
CREATE TABLE jobs (
3+
id SERIAL PRIMARY KEY,
4+
type VARCHAR(255) NOT NULL,
5+
payload JSON,
6+
state VARCHAR(16) NOT NULL CHECK (state IN ('pending', 'started', 'finished', 'failed')),
7+
error_msg TEXT,
8+
attempts INT NULL,
9+
available_at TIMESTAMP NULL,
10+
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
11+
started_at TIMESTAMP NULL,
12+
finished_at TIMESTAMP NULL
13+
);
14+
15+
-- migrate:down
16+
DROP TABLE IF EXISTS jobs;

docs/README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# GoPlate Documentation
2+
3+
Welcome to **GoPlate** - a modern, production-ready Go boilerplate for building REST APIs with best practices built-in.
4+
5+
## What is GoPlate?
6+
7+
GoPlate is a comprehensive Go boilerplate that provides everything you need to build robust REST APIs quickly and efficiently. It combines the power of modern Go frameworks with battle-tested patterns and tools to give you a solid foundation for your next project.
8+
9+
## Key Features
10+
11+
### 🔥 High Performance
12+
- Built on **Fiber** framework - one of the fastest HTTP frameworks for Go
13+
- Optimized for high throughput and low latency
14+
- Efficient memory usage and minimal overhead
15+
16+
### 🗄️ Database Integration
17+
- **GORM** ORM with support for MySQL and PostgreSQL
18+
- Database migrations and seeders
19+
- Connection pooling and optimization
20+
- Automatic model generation
21+
22+
### 🔐 Security First
23+
- JWT authentication middleware
24+
- Request validation with `go-playground/validator`
25+
- CORS support
26+
- Basic authentication for admin endpoints
27+
- Environment-based configuration
28+
29+
### 🛠️ Developer Experience
30+
- Hot reload development server
31+
- Comprehensive CLI tools via Makefile
32+
- Code generation for models, DTOs, and more
33+
- Structured logging with file rotation
34+
- Test coverage reporting
35+
36+
### 📦 Clean Architecture
37+
- Well-organized project structure following Go conventions
38+
- Separation of concerns
39+
- Modular design for easy maintenance
40+
- Scalable codebase organization
41+
42+
### ⏰ Background Processing
43+
- In-memory task queue with worker pools
44+
- CRON-based job scheduling
45+
- Asynchronous task processing
46+
- Configurable worker concurrency
47+
48+
## Quick Overview
49+
50+
```go
51+
// Simple API endpoint example
52+
func (c *Controller) GetUsers(ctx *fiber.Ctx) error {
53+
users, err := c.userService.GetAll()
54+
if err != nil {
55+
return ctx.Status(500).JSON(fiber.Map{
56+
"error": "Failed to fetch users",
57+
})
58+
}
59+
60+
return ctx.JSON(fiber.Map{
61+
"success": true,
62+
"data": users,
63+
})
64+
}
65+
```
66+
67+
## Architecture Highlights
68+
69+
- **MVC Pattern**: Clean separation between Models, Views, and Controllers
70+
- **Middleware Stack**: Authentication, CORS, logging, and error handling
71+
- **Service Layer**: Business logic abstraction
72+
- **Repository Pattern**: Data access abstraction
73+
- **Dependency Injection**: Loose coupling between components
74+
75+
## Use Cases
76+
77+
GoPlate is perfect for:
78+
79+
- **REST APIs**: Build scalable web APIs
80+
- **Microservices**: Create lightweight, focused services
81+
- **Backend Services**: Power mobile and web applications
82+
- **Data Processing**: Handle background tasks and scheduled jobs
83+
- **Prototyping**: Quickly validate ideas with a solid foundation
84+
85+
## Getting Started
86+
87+
Ready to build something amazing? Let's get you started:
88+
89+
1. **[Quick Start](/quick-start)** - Get up and running in minutes
90+
2. **[Installation](/installation)** - Detailed installation guide
91+
3. **[Configuration](/configuration)** - Configure your environment
92+
4. **[Project Structure](/project-structure)** - Understand the codebase
93+
94+
## Community & Support
95+
96+
- **GitHub**: [sheenazien8/goplate](https://github.com/sheenazien8/goplate)
97+
- **Issues**: Report bugs and request features
98+
- **Discussions**: Ask questions and share ideas
99+
100+
---
101+
102+
**Ready to start building?** Head over to the [Quick Start](/quick-start) guide!

docs/_coverpage.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# GoPlate
2+
3+
> A modern, production-ready Go boilerplate for building REST APIs with best practices built-in.
4+
5+
- 🔥 **Fast** - Built on Fiber framework with high performance
6+
- 🗄️ **Database Ready** - GORM with MySQL/PostgreSQL support
7+
- 🔐 **Secure** - JWT authentication and validation built-in
8+
- 🛠️ **Developer Friendly** - Hot reload, migrations, and code generation
9+
- 📦 **Clean Architecture** - Well-organized project structure
10+
-**Background Tasks** - Queue system and CRON scheduler
11+
12+
[GitHub](https://github.com/sheenazien8/goplate)
13+
[Get Started](/quick-start)
14+
15+
![color](#f0f0f0)

docs/_navbar.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- [Home](/)
2+
- [Quick Start](/quick-start)
3+
- [API Reference](/api-reference)
4+
- [Examples](/examples)
5+
- [GitHub](https://github.com/sheenazien8/goplate)

docs/_sidebar.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
- **Getting Started**
2+
- [Introduction](/)
3+
- [Quick Start](/quick-start)
4+
- [Installation](/installation)
5+
- [Configuration](/configuration)
6+
7+
- **Development**
8+
- [Project Structure](/project-structure)
9+
- [Database](/database)
10+
- [Routing](/routings)
11+
- [DTOs & Validation](/validation-and-dto)
12+
13+
- **Features**
14+
- [Authentication](/authentication)
15+
- [Logging](/logging)
16+
- [Background Tasks](/background-tasks)
17+
- [Task Scheduler](/task-scheduler)
18+
- [Error Handling](/error-handling)
19+
20+
- **API Reference**
21+
- [Endpoints](/api-reference)
22+
- [Request/Response](/request-response)
23+
- [Status Codes](/status-codes)
24+
25+
- **Deployment**
26+
- [Production Setup](/production-setup)
27+
- [Docker](/docker)
28+
- [Environment Variables](/environment-variables)
29+
<!---->
30+
<!-- - **Advanced** -->
31+
<!-- - [Code Generation](/code-generation) -->
32+
<!-- - [Testing](/testing) -->
33+
<!-- - [Performance](/performance) -->
34+
<!-- - [Best Practices](/best-practices) -->
35+
36+
- **Examples**
37+
- [Basic CRUD](/examples/crud)
38+
- [Authentication Flow](/examples/auth)
39+
- [Background Jobs](/examples/jobs)
40+
41+
- **Contributing**
42+
- [Development Setup](/contributing/setup)
43+
- [Guidelines](/contributing/guidelines)

0 commit comments

Comments
 (0)