astraengine

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

AstraEngine Go

AstraEngine is a modular Go engine for building multi-platform bots, community systems and platform automation products.

It is not just a single bot template. AstraEngine is designed as a reusable runtime core: it provides the event loop, routing, middleware pipeline, platform abstraction, storage contracts, plugin lifecycle and integration boundaries that concrete bots and automation apps can be built on top of.

Purpose

AstraEngine is intended to be the foundation for products that need one shared backend logic layer across multiple platforms, such as Telegram, VK, Discord and future adapters.

The engine focuses on:

  • keeping business logic independent from platform SDKs;
  • providing a unified event and context model;
  • supporting plugins and reusable modules;
  • allowing different storage/cache implementations;
  • keeping platform adapters isolated from the core;
  • making it easier to build bots, admin tools and automation services on one architecture.

Install

go get github.com/andrewkydev/astraengine

Project layout

AstraEngine is designed as:

  • core — engine runtime, events, context, router, middleware and platform interfaces.
  • keyboard — unified keyboard and button builder for supported platforms.
  • payload — callback payload model, codec and helpers.
  • storage — database/session interfaces and basic memory implementation.
  • cache — cache interfaces and basic memory implementation.
  • admin — basic Admin HTTP API skeleton for engine management.
  • platform — Telegram/VK/Discord platform adapters.
  • plugin — plugin lifecycle, contracts and registry.
  • plugins — example built-in engine plugins.
  • examples — runnable examples built on top of AstraEngine.
  • docs/PROJECT_STRUCTURE.md — current module map and dependency boundaries.

Run examples

go mod tidy
go run ./examples/multi-platform

Environment:

cp .env.example .env
# fill TELEGRAM_TOKEN / VK_TOKEN / VK_GROUP_ID

Adapters use real SDKs:

  • Telegram: github.com/go-telegram/bot
  • VK: github.com/SevereCloud/vksdk/v3
  • Discord: github.com/bwmarrin/discordgo

Release readiness

CLI migrations

go run ./cmd/astraengine migrate up
go run ./cmd/astraengine migrate status
go run ./cmd/astraengine migrate down 1

Key env vars:

  • ASTRAENGINE_STORAGE_DRIVER=memory|postgres
  • ASTRAENGINE_DATABASE_URL=postgres://... — PostgreSQL connection string for the postgres driver.
  • ASTRAENGINE_PG_AUTO_SCHEMA=true — auto-create engine tables, for example system_users and astra_sessions.
  • ASTRAENGINE_MIGRATIONS_STORE=file|session — migrations state storage, default: file.
  • ASTRAENGINE_MIGRATIONS_FILE=.astraengine/migrations.json — file-based migrations state path.

Architecture rule

The engine core must not import Telegram/VK/Discord SDKs directly. Platform SDKs must live only inside adapters.

This keeps AstraEngine reusable: the same core can run with different platform adapters, while business logic and plugins remain platform-independent.

License

MIT. See LICENSE.

Documentation

Overview

Package astraengine exposes the public convenience API for building bots and automation apps on top of the AstraEngine runtime.

Most concrete implementations still live in subpackages such as core/app, platform/telegram, storage/postgres and plugin. The root package intentionally stays small so application code can start from astraengine.New while importing only the adapters and storage backends it actually needs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App = app.App

App is the main AstraEngine runtime type.

func New

func New(name string) *App

New creates a new AstraEngine app runtime.

type Cache

type Cache = cache.Cache

Cache is the engine cache contract.

type Group

type Group = app.Group

Group is a route group with its own middleware chain.

type Handler

type Handler = middleware.Handler

Handler processes a single normalized engine event.

type Middleware

type Middleware = middleware.Middleware

Middleware wraps a Handler with cross-cutting behavior.

type Platform

type Platform = platform.Platform

Platform is implemented by concrete adapters such as Telegram, VK and Discord.

type Plugin

type Plugin = plugin.Plugin

Plugin is the engine plugin contract.

type Store

type Store = storage.Store

Store is the engine storage contract.

Jump to

Keyboard shortcuts

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