A modern Go web application for form management with MariaDB backend.
Features
β¨ Core Features
- Form Management System
- Contact Form Submissions
- Email Subscription Management
- Status Tracking
- Validation
- RESTful API
- OpenAPI/Swagger Documentation
- Versioned Endpoints (v1)
- Standardized Response Format
- Modern UI
- Server-side Rendering
- Dark Mode Support
- Responsive Design
- MariaDB Database
- Connection Pooling
- Migration System
π οΈ Technical Features
- Clean Architecture
- Domain-Driven Design
- Separation of Concerns
- SOLID Principles
- Dependency Injection (Uber FX)
- Structured Logging (Zap)
- Comprehensive Testing
- Unit Tests
- Mock Implementations
- Test Utilities
- Task Automation
- Docker Development
Architecture
The project follows Clean Architecture principles with clear separation of concerns:
Core Domain Layer (/internal/core/
)
Contains business logic and domain entities:
- Domain Models and Interfaces
- Business Rules and Validation
- Use Cases and Services
- No External Dependencies
Implements infrastructure and technical concerns:
- Database Implementations
- Server Configuration
- Error Handling
- External Integrations
Application Layer
/internal/
βββ api/ - API endpoints and versioning
βββ handlers/ - Request handlers
βββ middleware/ - HTTP middleware
βββ response/ - Response formatting
βββ validation/ - Input validation
Infrastructure Layer
/internal/
βββ app/ - Application bootstrapping
βββ config/ - Configuration management
βββ database/ - Database connections
βββ logger/ - Logging infrastructure
βββ web/ - Web server setup
Presentation Layer
/internal/
βββ components/ - UI components
βββ ui/ - UI logic
βββ view/ - View templates
Dependencies
The project follows a strict dependency rule where dependencies point inward:
- Core Domain: No external dependencies
- Platform: Implements core interfaces
- Application: Depends on core and platform
- Infrastructure: Configures and connects components
- Presentation: Consumes application services
Project Structure
/internal/
βββ api/ - API endpoints and handlers
βββ app/ - Application setup
βββ components/ - UI components
βββ config/ - Configuration
βββ core/ - Business logic
βββ database/ - Database layer
βββ handlers/ - HTTP handlers
βββ logger/ - Logging
βββ middleware/ - HTTP middleware
βββ models/ - Data models
βββ platform/ - Platform code
βββ response/ - API responses
βββ ui/ - UI code
βββ validation/ - Input validation
βββ view/ - View templates
βββ web/ - Web server
Quick Start
-
Prerequisites:
- Docker
- VS Code with Dev Containers
- Git
-
Clone and Setup:
git clone https://github.com/jonesrussell/goforms.git
cd goforms
code .
-
Start Development:
- Click "Reopen in Container" when prompted
- Copy environment file:
cp .env.example .env
- Install dependencies:
task install
- Start server:
task dev
-
View the application at http://localhost:8090
Documentation
π Comprehensive documentation is available in the docs
directory:
Tech Stack
- Go 1.23
- MariaDB 10.11
- Echo v4
- Uber FX
- Zap Logger
- Task Runner
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.