goforms

module
v0.0.0-...-84048cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2025 License: MIT

README ΒΆ

GoForms

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
Platform Layer (/internal/platform/)

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

  1. Prerequisites:

    • Docker
    • VS Code with Dev Containers
    • Git
  2. Clone and Setup:

    git clone https://github.com/jonesrussell/goforms.git
    cd goforms
    code .
    
  3. Start Development:

    • Click "Reopen in Container" when prompted
    • Copy environment file: cp .env.example .env
    • Install dependencies: task install
    • Start server: task dev
  4. 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.

Directories ΒΆ

Path Synopsis
cmd
internal
application/handler
Package handler provides HTTP request handlers following a consistent pattern for dependency injection and configuration.
Package handler provides HTTP request handlers following a consistent pattern for dependency injection and configuration.
infrastructure/database
Package database provides database connection and management
Package database provides database connection and management
infrastructure/logging
Package logging provides a unified logging interface using zap
Package logging provides a unified logging interface using zap
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL