Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

alepha

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alepha

Alepha is a convention-driven TypeScript framework for building robust, end-to-end type-safe applications, from serverless APIs to full-stack React apps.

latest
Source
npmnpm
Version
0.10.1
Version published
Maintainers
1
Created
Source

Logo Alepha

npm npm npm npm GitHub stars

A convention-driven TypeScript framework for building type-safe full-stack applications.

Quick Start

npx @alepha/cli create my-app

Or manually:

npm install alepha

What is this?

Alepha is an opinionated framework that handles everything from database to frontend. It uses a descriptor-based architecture ($action, $page, $repository, etc.) and enforces type safety across the entire stack.

import { run } from "alepha";
import { $action } from "alepha/server";

class App {
  hello = $action({
    handler: () => "Hello world!",
  })
}

run(App);

Examples

Type-safe API endpoint

import { $action } from "alepha/server";
import { t } from "alepha/core";

class UserController {
  getUser = $action({
    schema: {
      params: t.object({ id: t.string() }),
      response: t.object({
        name: t.string(),
        email: t.string()
      })
    },
    handler: async ({ params }) => {
      return { name: "John", email: "john@example.com" };
    }
  });
}

Database with Drizzle ORM

import {$entity, $repository, pg} from "alepha/postgres";
import {t, Static} from "alepha";

export const users = $entity({
  id: pg.primaryKey(),
  name: t.string(),
  email: t.string()
});

type CreateUser = Static<typeof users.$insertSchema>;

class UserService {
  users = $repository(users);

  async create(data: CreateUser) {
    return await this.users.create(data);
  }
}

React SSR Page

import { $page } from "alepha/react";

class HomePage {
  index = $page({
    component: () => <div>Hello from React SSR!</div>
  });
}

Core Concepts

  • Descriptors: Define your app logic with $action, $page, $repository, $cache, $email, etc.
  • Type Safety: TypeBox schemas validate data from DB to API to frontend
  • DI Container: Built-in dependency injection using $inject()
  • Convention over Config: Minimal boilerplate, sensible defaults
  • Full-Stack: React SSR, Vite, class-based router with type-safe routing

Stack

  • Node.js 22+
  • TypeScript
  • React (SSR)
  • Vite
  • Drizzle ORM
  • PostgreSQL

👉 For more information, please visit the documentation.

License

MIT

Keywords

alepha

FAQs

Package last updated on 29 Sep 2025

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