🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

alepha

Package Overview
Dependencies
Maintainers
1
Versions
42
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.7
Version published
Weekly downloads
209
-28.42%
Maintainers
1
Weekly downloads
 
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.

For more information, please visit the documentation.

Examples

Type-safe API endpoint

Write type-safe API endpoints with automatic OpenAPI documentation and more.

// app.ts
import { run, t } from "alepha";
import { $action } from "alepha/server";
import { $swagger } from "alepha/server/swagger";

class Api {
  docs = $swagger({
    info: {
      title: "My API",
      version: "1.0.0",
    }
  })

  sayHello = $action({
    path: "/hello/:name",
    schema: {
      params: t.object({
        name: t.text()
      }),
      response: t.object({
        message: t.text(),
      })
    },
    handler: async ({ params }) => {
      return { message: `Hello ${params.name} !` };
    }
  });
}

run(Api);
node app.ts

Database with Drizzle ORM

Drizzle ORM is a type-safe ORM for TypeScript, bundled inside Alepha.

You need drizzle-kit CLI as dev dependencies:

npm install -D drizzle-kit
// app.ts
import { $hook, run, t } from "alepha";
import { $entity, $repository, pg } from "alepha/postgres";
import { $logger } from "alepha/logger";

export const users = $entity({
  name: "users",
  schema: t.object({
    id: pg.primaryKey(),
    name: t.text(),
  }),
});


class Db {
  log = $logger();
  users = $repository(users);

  ready = $hook({
    on: "ready",
    handler: async () => {
      await this.users.create({
        name: "John Doe",
      });
      this.log.info("Users:", await this.users.find());
    }
  })
}

run(Db)
node app.ts

React Application

Build full-stack React applications, with server-side rendering (SSR) and client-side rendering (CSR).

React is required as a dependency:

npm install react react-dom
npm install -D @types/react
// app.tsx
import { run, t } from "alepha";
import { $page } from "alepha/react";
import { useState } from "react";

const Hello = (props: { count: number }) => {
  const [ count, setCount ] = useState(props.count);
  return <button onClick={() => setCount(count + 1)}>Clicked: {count}</button>
}

class HomePage {
  index = $page({
    schema: {
      query: t.object({
        start: t.number({ default: 0 }),
      })
    },
    component: Hello,
    resolve: (req) => {
      return { count: req.query.start };
    },
  });
}

run(HomePage);

Vite is required as a devDependencies:

npm install -D vite

Add the Alepha Vite plugin to your Vite config:

// vite.config.ts
import { viteAlepha } from "alepha/vite";
import { defineConfig } from "vite";

export default defineConfig({
  plugins: [
    viteAlepha()
  ]
});

Create an index.html file:

<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>App</title>
</head>
<body>
<script type="module" src="app.tsx"></script>
</body>
</html>

Then run Vite:

npx vite

License

MIT

Keywords

alepha

FAQs

Package last updated on 22 Oct 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