Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@structa/cli

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@structa/cli

Structa Framework CLI - TypeScript API framework compiler

latest
Source
npmnpm
Version
0.8.7
Version published
Maintainers
1
Created
Source

Structa Framework

A TypeScript-like API framework built with Rust. Write .structa files that compile to JavaScript.

██████╗ ███████╗███████╗██╗███╗   ██╗██╗   ██╗███████╗
██╔══██╗██╔════╝██╔════╝██║████╗  ██║██║   ██║██╔════╝
██████╔╝█████╗  █████╗  ██║██╔██╗ ██║██║   ██║███████╗
██╔══██╗██╔══╝  ██╔══╝  ██║██║╚██╗██║██║   ██║╚════██║
██║  ██║███████╗███████╗██║██║ ╚████║╚██████╔╝███████║
╚═╝  ╚═╝╚══════╝╚══════╝╚═╝╚═╝  ╚═══╝ ╚═════╝ ╚══════╝

Features

  • Rust Compiler - Fast compilation of .structa files
  • Hot Reload - Development server with auto-recompilation
  • Dependency Injection - Built-in DI container
  • Modular Packages - HTTP, ORM, Validation, Cache, Queue, Mail
  • Matrix-style CLI - Beautiful terminal interface

Quick Start

# Build CLI
cargo build --release

# Create project
structa init my-api
cd my-api

# Install dependencies
structa install

# Run development server
structa dev --port 3000

CLI Commands

structa init <name>      # Initialize new project
structa dev [--port]     # Run development server
structa build [--release] # Build project
structa install          # Install dependencies
structa add <package>    # Add npm package
structa remove <package> # Remove package
structa generate <type> <name>  # Generate code
structa orm <command>    # Database operations

Packages

PackageVersionDescription
@structa/http0.8.1HTTP server with routing and middleware
@structa/orm0.8.1Database ORM (MySQL, PostgreSQL, SQLite)
@structa/validation0.8.1Input validation with decorators
@structa/cache0.8.1Caching (Memory, Redis, File)
@structa/queue0.8.1Job queues with retry support
@structa/mail0.8.1Email sending (SMTP, SendGrid)
@structa/swagger0.8.1OpenAPI documentation
@structa/websockets0.8.1WebSocket support
@structa/graphql0.8.1GraphQL integration
@structa/testing0.8.1Testing utilities

DSL Syntax

controller UserController {
    path: "/users"
    
    @Inject("UserService")
    userService
    
    @Get("/")
    async getAll() {
        return await this.userService.findAll()
    }
    
    @Get("/:id")
    async getById(id) {
        return await this.userService.findById(id)
    }
    
    @Post("/")
    async create(data) {
        return await this.userService.create(data)
    }
    
    @Delete("/:id")
    async delete(id) {
        return await this.userService.delete(id)
    }
}

service UserService {
    @Inject("UserRepository")
    userRepo
    
    async findAll() {
        return await this.userRepo.findAll()
    }
    
    async findById(id) {
        return await this.userRepo.findById(id)
    }
    
    async create(data) {
        return await this.userRepo.save(data)
    }
    
    async delete(id) {
        return await this.userRepo.delete(id)
    }
}

repository UserRepository {
    async findAll() {
        return [
            { id: 1, name: "John", email: "john@example.com" },
            { id: 2, name: "Jane", email: "jane@example.com" }
        ]
    }
    
    async findById(id) {
        return { id, name: "John", email: "john@example.com" }
    }
    
    async save(data) {
        return { id: Date.now(), ...data }
    }
    
    async delete(id) {
        return { success: true }
    }
}

Architecture

┌─────────────────────────────────────────────────────────┐
│                      Structa CLI                         │
│  init | dev | build | generate | install | orm         │
└─────────────────────────────────────────────────────────┘
                             │
                             ▼
┌─────────────────────────────────────────────────────────┐
│                   Rust Compiler                          │
│  ┌─────────┐   ┌─────────┐   ┌───────────────────┐   │
│  │  Lexer  │ → │ Parser  │ → │ Code Generator     │   │
│  └─────────┘   └─────────┘   └───────────────────┘   │
└─────────────────────────────────────────────────────────┘
                             │
                             ▼
┌─────────────────────────────────────────────────────────┐
│              JavaScript Output (Runtime)                 │
│  Controllers, Services, Repositories, DTOs              │
└─────────────────────────────────────────────────────────┘

Project Structure

structa/
├── crates/
│   └── structa/          # CLI (commands: structa init, structa dev, etc.)
├── packages/               # npm packages
│   ├── http/
│   ├── orm/
│   ├── validation/
│   ├── cache/
│   ├── queue/
│   ├── mail/
│   ├── swagger/
│   ├── websockets/
│   ├── graphql/
│   └── testing/
└── docs/                  # Documentation

Documentation

  • Getting Started
  • CLI Commands
  • DSL Syntax
  • HTTP Package
  • ORM Package
  • Validation Package
  • Cache Package
  • Queue Package
  • Mail Package

License

MIT

FAQs

Package last updated on 07 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts