Astra

module
v0.0.0-...-41a30da Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT

README ΒΆ

Astra Framework

astraframework.appwrite.network

A batteries-included, production-grade Go web framework.

Go Report Card Go Reference CI/CD Pipeline


Astra provides everything you need to build scalable, secure, and maintainable applications with Go. It prioritizes Developer Experience (DX), Security by Default, and Operational Maturity.

πŸ“ Table of Contents


Why Astra?

Astra was built to solve the "configuration fatigue" in the Go ecosystem. While Go is powerful, setting up a production-ready web server often requires stitching together dozens of libraries. Astra gives you a cohesive, opinions-included foundation:

  • πŸ’¨ Zero to Production: Pre-configured with everything from database migrations to OpenTelemetry.
  • 🎨 Modern Frontend: First-class support for Vite, allowing you to build rich SSR or SPA apps seamlessly.
  • πŸ›‘οΈ Secure by Design: Transparent encryption for sensitive data and automatic security headers.
  • πŸ“ˆ Scalable Architecture: Built-in support for Redis Sentinel, Cluster, and multi-tenant background jobs.

Key Features

Category Capabilities
⚑️ Performance Multi-threaded Event Emitter, Bytedance Sonic JSON engine, high-speed routing
πŸ›‘οΈ Security Transparent PII Encryption, PSR Audit Logging, PKCE OAuth2, CSP & HSTS middleware
πŸ“¦ Batteries Unified Migration Runner (Advisory Locking), Redis Sentinel, Job Queues
πŸ› οΈ DX & Tooling High-fidelity Scaffolding, SSE-powered Dev Dashboard, Key Rotation CLI
🌐 Web & SSR Native Vite Integration, Asset Helpers, Flash Messages, WebSocket Channels
πŸ“ˆ Ops Ready OpenTelemetry, Prometheus (/metrics), Liveness/Readiness probes

Quickstart

1. Install the CLI
go install github.com/shauryagautam/Astra/cmd/astra@latest
2. Scaffold your Project
astra new myapp --api-only
cd myapp
3. Setup & Start
# Setup dependencies and run migrations
make setup
astra dev

Your app is now running at http://localhost:3333 with Auto-Reload enabled!

Documentation

Project Structure

Astra enforces a clean, predictable directory layout inspired by industry best practices:

β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ handler/       # Request handlers (Controllers)
β”‚   β”œβ”€β”€ schema/        # Data models, validation & DTOs
β”‚   β”œβ”€β”€ jobs/          # Background task logic
β”‚   └── middleware/    # Application-specific middleware
β”œβ”€β”€ database/
β”‚   β”œβ”€β”€ migrations/    # Versioned SQL migration files
β”‚   └── seeders/       # Test data sets for development
β”œβ”€β”€ internal/          # Private core framework logic
β”œβ”€β”€ pkg/               # Publicly exportable packages
β”œβ”€β”€ routes/            # Route definitions & registration
β”œβ”€β”€ shared/            # Shared types, constants, and clients
β”œβ”€β”€ main.go            # Application entry point
└── wire.go            # Dependency injection source

Testing

Astra is built for testability. Use our high-fidelity test_util package for expressive integration tests:

func TestUserCreation(t *testing.T) {
    // 1. Initialize Test App with temporary resources
    app := test_util.NewTestApp(t, nil)
    
    // 2. Perform actions and assert results fluently
    app.POST("/users", map[string]string{"name": "John"}).
        ExpectStatus(201).
        ExpectJSON("name", "John")
}

Contributing

We welcome contributions! Whether it's a bug report, feature request, or a PR, check out our Contributing Guide to get started.

License

Astra is open-source software licensed under the MIT License.

Directories ΒΆ

Path Synopsis
cmd
astra-server command
examples
multi_database command
orm_demo command
internal
assets
Package assets provides an esbuild-based asset pipeline for bundling, minifying, and fingerprinting JavaScript and CSS asset.
Package assets provides an esbuild-based asset pipeline for bundling, minifying, and fingerprinting JavaScript and CSS asset.
pkg
database
Package database provides the seeder infrastructure for populating the database with test or production seed data.
Package database provides the seeder infrastructure for populating the database with test or production seed data.
database/migration
Package migrations is deprecated.
Package migrations is deprecated.
dto
Package dto provides Data Transfer Object (DTO) mapping helpers.
Package dto provides Data Transfer Object (DTO) mapping helpers.
engine
Package core provides the fundamental building blocks of an Astra application, including the IoC Container and the Application lifecycle manager.
Package core provides the fundamental building blocks of an Astra application, including the IoC Container and the Application lifecycle manager.
engine/config
Package config provides typed configuration loading for Astra applications.
Package config provides typed configuration loading for Astra applications.
engine/event
Package events provides a lightweight, thread-safe, in-process event emitter for decoupling controllers from side-effects (emails, audit logs, etc.).
Package events provides a lightweight, thread-safe, in-process event emitter for decoupling controllers from side-effects (emails, audit logs, etc.).
engine/http
Package middleware provides chaos engineering primitives for Astra.
Package middleware provides chaos engineering primitives for Astra.
identity/auth
Package auth provides a comprehensive authentication and authorization suite for the Astra framework.
Package auth provides a comprehensive authentication and authorization suite for the Astra framework.
notification
Package notification provides a unified abstraction for sending notifications across multiple channels (email, SMS, Slack, push, etc.).
Package notification provides a unified abstraction for sending notifications across multiple channels (email, SMS, Slack, push, etc.).
policy
Package policy provides a resource-level authorization gate.
Package policy provides a resource-level authorization gate.
session
Package session provides a flexible, secure HTTP session layer for the Astra framework.
Package session provides a flexible, secure HTTP session layer for the Astra framework.
test_util
Package testing provides model factories for use in tests and seed data.
Package testing provides model factories for use in tests and seed data.
ws

Jump to

Keyboard shortcuts

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