Skip to content

jimmitjoo/gemquick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

86 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Gemquick

alt gemquick

Gemquick is a modern, full-featured web application framework for Go that provides everything you need to build scalable web applications quickly and securely.

Features

  • πŸš€ Chi Router - Fast and lightweight HTTP router
  • πŸ—„οΈ Multi-Database Support - PostgreSQL, MySQL, MariaDB, SQLite
  • πŸ” Security First - CSRF protection, rate limiting, input validation, XSS prevention
  • πŸ“§ Email System - Multiple provider support with templates
  • πŸ’Ύ Caching - Redis and Badger cache implementations
  • πŸ”„ Background Jobs - Job queue with cron scheduler
  • 🌐 WebSocket Support - Real-time communication with hub pattern
  • πŸ“ File Storage - S3 and MinIO filesystem integrations
  • πŸ“± SMS Integration - Multiple SMS provider support
  • 🎨 Template Engine - Jet template engine for dynamic views
  • πŸ“Š Logging & Metrics - Structured logging with health monitoring
  • πŸ”‘ Session Management - Secure session handling with multiple stores
  • πŸ› οΈ CLI Tools - Project scaffolding and code generation

Installation

Clone the repository and build the CLI tool:

git clone https://github.com/jimmitjoo/gemquick
cd gemquick
make build

This will create the gq executable in dist/gq. You can move this file to your PATH for global access.

Quick Start

Create a New Project

gq new my_project
cd my_project
make start

Project Structure

my_project/
β”œβ”€β”€ .env                 # Environment configuration
β”œβ”€β”€ Makefile            # Build and development commands
β”œβ”€β”€ handlers/           # HTTP handlers
β”œβ”€β”€ migrations/         # Database migrations
β”œβ”€β”€ views/              # Template files
β”œβ”€β”€ email/              # Email templates
β”œβ”€β”€ data/               # Models and database logic
β”œβ”€β”€ public/             # Static assets
β”œβ”€β”€ middleware/         # Custom middleware
└── logs/               # Application logs

Development

Available Make Commands

make key           # Generate new encryption key
make auth          # Create authentication system with user model
make mail          # Create new email template
make model         # Create new model in data directory
make migration     # Create new database migration
make handler       # Create new HTTP handler
make session       # Create session tables in database
make api-controller    # Create new API controller
make controller    # Create new resource controller
make middleware    # Create new middleware
make docker        # Generate Docker configuration
make deploy        # Generate deployment configuration

Testing

Gemquick includes a beautiful test runner with colored output:

# Run all tests with colors
make test

# Run tests for specific package
./run-tests -p ./cache/...

# Generate coverage report
make cover

# Run tests without Docker dependencies
./run-tests -s

Database Migrations

# Run migrations up
gq migrate up

# Roll back migrations
gq migrate down

# Create new migration
make migration name=create_users_table

Core Components

Web Server Configuration

app := gemquick.Gemquick{}
app.New(rootPath)
app.AppName = "MyApp"
app.Debug = true

Database Connection

Supports multiple databases through environment configuration:

  • PostgreSQL
  • MySQL/MariaDB
  • SQLite

Caching

Choose between Redis or Badger cache:

// Redis cache
app.Cache = app.CreateRedisCache()

// Badger cache
app.Cache = app.CreateBadgerCache()

Background Jobs

// Register a job processor
app.JobManager.RegisterProcessor("send-email", emailProcessor)

// Queue a job
app.JobManager.QueueJob("send-email", data)

WebSocket Support

// Initialize WebSocket hub
hub := websocket.NewHub()
go hub.Run()

Security Features

  • CSRF protection middleware
  • Rate limiting and throttling
  • Input validation and sanitization
  • SQL injection prevention
  • XSS protection
  • Session fixation protection
  • Secure password hashing

Configuration

Configuration is managed through .env file:

# Application
APP_NAME=MyApp
DEBUG=true
PORT=4000

# Database
DATABASE_TYPE=postgres
DATABASE_DSN=your_connection_string

# Cache
CACHE=redis
REDIS_HOST=localhost:6379

# Session
SESSION_TYPE=redis
SESSION_LIFETIME=24

# Mail
MAIL_PROVIDER=smtp
SMTP_HOST=localhost
SMTP_PORT=1025

API Development

Gemquick includes API utilities for building RESTful services:

  • Version management
  • Standardized JSON responses
  • API middleware
  • Error handling
// API versioning
api.Version("v1", func(r chi.Router) {
    r.Get("/users", handlers.GetUsers)
})

// JSON responses
api.JSON(w, http.StatusOK, data)

Testing Philosophy

  • Comprehensive test coverage (aim for >80% on critical paths)
  • Table-driven tests for better coverage
  • Security-focused testing
  • Docker-optional test execution
  • Colorful test output for better readability

Contributing

Bug reports and pull requests are welcome on GitHub at the Gemquick repository. This project is intended to be a safe, welcoming space for collaboration. Contributors are expected to adhere to the Contributor Covenant.

License

The Gemquick framework is available as open source under the terms of the MIT License.

Documentation

For detailed documentation and examples, see:

Support

For issues, questions, or suggestions, please open an issue on the GitHub repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages