
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
Alepha is a convention-driven TypeScript framework for building robust, end-to-end type-safe applications, from serverless APIs to full-stack React apps.
A convention-driven TypeScript framework for building type-safe full-stack applications.
npx @alepha/cli create my-app
Or manually:
npm install alepha
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.
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
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
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
MIT
FAQs
Alepha is a convention-driven TypeScript framework for building robust, end-to-end type-safe applications, from serverless APIs to full-stack React apps.
The npm package alepha receives a total of 204 weekly downloads. As such, alepha popularity was classified as not popular.
We found that alepha demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.