|
1 | | -<br/> |
2 | | -<br/> |
3 | | -<br/> |
| 1 | +# 0x7B |
4 | 2 |
|
5 | | -> Formerly Deepkit — renamed after European Union “no genuine use” ruling. Trademarks don't like open-source. |
6 | | -
|
7 | | -<br/> |
8 | | -<br/> |
| 3 | +**The modern TypeScript framework for building high-performance, type-safe full-stack applications.** |
9 | 4 |
|
10 | 5 | <a href="https://discord.gg/U24mryk7Wq"><img alt="Discord" src="https://img.shields.io/discord/759513055117180999?style=square&label=Discord" /></a> |
11 | | -<a href="https://www.npmjs.com/package/@deepkit/type"><img alt="npm" src="https://img.shields.io/npm/v/@deepkit/type.svg?style=square" /></a> |
12 | | -[](https://github.com/marcj/untitled-code/actions/workflows/main.yml) |
| 6 | +<a href="https://www.npmjs.com/package/@7b/core"><img alt="npm" src="https://img.shields.io/npm/v/@7b/core.svg?style=square" /></a> |
| 7 | +[](https://github.com/marcj/deepkit/actions/workflows/main.yml) |
| 8 | + |
| 9 | +0x7B is a comprehensive TypeScript framework that brings runtime type information, zero-dependency architecture, and enterprise-grade features for building modern applications. Born from Deepkit, restructured with a focus on simplicity and developer experience. |
| 10 | + |
| 11 | +## Why 0x7B? |
| 12 | + |
| 13 | +We've consolidated **56+ packages into 7 focused packages**, making it dramatically easier to understand, install, and use: |
| 14 | + |
| 15 | +- **🚀 Zero Dependencies**: Core packages have no dependencies - install only what you need |
| 16 | +- **📦 Simplified Structure**: 7 logical packages instead of 56+ scattered ones |
| 17 | +- **🎯 Better DX**: Cleaner imports, predictable APIs, easier navigation |
| 18 | +- **⚡ High Performance**: Runtime type system with advanced serialization |
| 19 | +- **🔒 Type Safety**: Full TypeScript support with runtime validation |
| 20 | +- **🌐 Full-Stack Ready**: From CLI tools to HTTP servers to database ORMs |
| 21 | + |
| 22 | +## Architecture |
| 23 | + |
| 24 | +``` |
| 25 | +@7b/runtime → Zero dependencies: core utilities, decorators, benchmarks |
| 26 | +@7b/reflection → Runtime type system and reflection |
| 27 | +@7b/codec → Binary serialization (BSON) and validation |
| 28 | +@7b/core → Application framework: DI, CLI, logging, events |
| 29 | +@7b/io → Networking: HTTP, RPC, message brokers, filesystem |
| 30 | +@7b/db → Database: ORM, migrations, PostgreSQL, MySQL, SQLite, MongoDB |
| 31 | +@7b/ui → Angular UI components and frontend integrations |
| 32 | +``` |
| 33 | + |
| 34 | +## Quick Start |
| 35 | + |
| 36 | +### Installation |
| 37 | + |
| 38 | +```bash |
| 39 | +# Core framework |
| 40 | +npm install @7b/core @7b/reflection |
| 41 | + |
| 42 | +# Add networking |
| 43 | +npm install @7b/io |
| 44 | + |
| 45 | +# Add database support |
| 46 | +npm install @7b/db @7b/db/postgres |
| 47 | +``` |
13 | 48 |
|
14 | | -This is a new modular TypeScript framework for backend applications based on runtime types. |
| 49 | +### Simple HTTP Server |
15 | 50 |
|
16 | | -## Docs |
| 51 | +```typescript |
| 52 | +import { App } from '@7b/core'; |
| 53 | +import { HttpServer, route } from '@7b/io/http'; |
17 | 54 |
|
18 | | -Check out the [Documentation](https://deepkit.io/documentation/introduction) to get started. |
| 55 | +class HelloController { |
| 56 | + @route.get('/hello/:name') |
| 57 | + hello(name: string) { |
| 58 | + return `Hello, ${name}!`; |
| 59 | + } |
| 60 | +} |
19 | 61 |
|
20 | | -## Getting started |
| 62 | +const app = new App(); |
| 63 | +app.use(HttpServer); |
| 64 | +app.use(HelloController); |
| 65 | +app.run(); |
| 66 | +``` |
| 67 | + |
| 68 | +### With Database |
| 69 | + |
| 70 | +```typescript |
| 71 | +import { App, Logger } from '@7b/core'; |
| 72 | +import { HttpServer, route } from '@7b/io/http'; |
| 73 | +import { Database } from '@7b/db'; |
| 74 | +import { PostgresAdapter } from '@7b/db/postgres'; |
| 75 | + |
| 76 | +interface User { |
| 77 | + id: number; |
| 78 | + name: string; |
| 79 | + email: string; |
| 80 | +} |
21 | 81 |
|
22 | | -To create an app from scratch, you can use NPM init: |
| 82 | +class UserController { |
| 83 | + constructor(private database: Database) {} |
23 | 84 |
|
24 | | -```shell |
25 | | -npm init @deepkit/app@latest my-deepkit-app |
| 85 | + @route.get('/users') |
| 86 | + async getUsers() { |
| 87 | + return await this.database.query(User).find(); |
| 88 | + } |
| 89 | +} |
| 90 | + |
| 91 | +const app = new App(); |
| 92 | +app.use(HttpServer); |
| 93 | +app.use(UserController); |
| 94 | +app.use({ |
| 95 | + provide: Database, |
| 96 | + useFactory: () => new Database(new PostgresAdapter('postgres://localhost/mydb')) |
| 97 | +}); |
| 98 | +app.run(); |
26 | 99 | ``` |
27 | 100 |
|
| 101 | +## Key Features |
| 102 | + |
| 103 | +### Runtime Type System |
| 104 | + |
| 105 | +0x7B provides full runtime type information without decorators: |
| 106 | + |
| 107 | +```typescript |
| 108 | +import { serialize, deserialize } from '@7b/codec'; |
| 109 | + |
| 110 | +interface User { |
| 111 | + id: number; |
| 112 | + name: string; |
| 113 | + createdAt: Date; |
| 114 | +} |
| 115 | + |
| 116 | +const user: User = { id: 1, name: 'Alice', createdAt: new Date() }; |
| 117 | +const json = serialize<User>(user, 'json'); |
| 118 | +const bson = serialize<User>(user, 'bson'); |
| 119 | +const restored = deserialize<User>(json, 'json'); |
| 120 | +``` |
| 121 | + |
| 122 | +### Dependency Injection |
| 123 | + |
| 124 | +Built-in, powerful DI container: |
| 125 | + |
| 126 | +```typescript |
| 127 | +import { App } from '@7b/core'; |
| 128 | + |
| 129 | +class Database { |
| 130 | + connect() { /* ... */ } |
| 131 | +} |
| 132 | + |
| 133 | +class UserService { |
| 134 | + constructor(private db: Database) {} |
| 135 | +} |
| 136 | + |
| 137 | +const app = new App(); |
| 138 | +app.use(Database); |
| 139 | +app.use(UserService); |
| 140 | +``` |
| 141 | + |
| 142 | +### CLI Commands |
| 143 | + |
| 144 | +```typescript |
| 145 | +import { App, cli } from '@7b/core'; |
| 146 | + |
| 147 | +class Commands { |
| 148 | + @cli.command('migrate') |
| 149 | + async migrate() { |
| 150 | + console.log('Running migrations...'); |
| 151 | + } |
| 152 | +} |
| 153 | + |
| 154 | +app.use(Commands); |
| 155 | +app.run(); // Run: node app.js migrate |
| 156 | +``` |
| 157 | + |
| 158 | +### Database ORM |
| 159 | + |
| 160 | +Type-safe queries with support for PostgreSQL, MySQL, SQLite, and MongoDB: |
| 161 | + |
| 162 | +```typescript |
| 163 | +import { Database } from '@7b/db'; |
| 164 | +import { entity, PrimaryKey, AutoIncrement } from '@7b/reflection'; |
| 165 | + |
| 166 | +@entity |
| 167 | +class User { |
| 168 | + id: number & PrimaryKey & AutoIncrement = 0; |
| 169 | + name: string = ''; |
| 170 | + email: string = ''; |
| 171 | +} |
| 172 | + |
| 173 | +const users = await database.query(User) |
| 174 | + .filter({ name: { $regex: /john/i } }) |
| 175 | + .orderBy('createdAt', 'desc') |
| 176 | + .limit(10) |
| 177 | + .find(); |
| 178 | +``` |
| 179 | + |
| 180 | +## Migration from Deepkit |
| 181 | + |
| 182 | +The package consolidation provides a clearer, simpler import structure: |
| 183 | + |
| 184 | +```typescript |
| 185 | +// Before (Deepkit) |
| 186 | +import { isClass } from '@deepkit/core'; |
| 187 | +import { serialize } from '@deepkit/type'; |
| 188 | +import { Database } from '@deepkit/orm'; |
| 189 | +import { PostgresAdapter } from '@deepkit/postgres'; |
| 190 | +import { Logger } from '@deepkit/logger'; |
| 191 | +import { HttpRouter } from '@deepkit/http'; |
| 192 | + |
| 193 | +// After (0x7B) |
| 194 | +import { isClass } from '@7b/runtime'; |
| 195 | +import { serialize } from '@7b/reflection'; |
| 196 | +import { Database } from '@7b/db'; |
| 197 | +import { PostgresAdapter } from '@7b/db/postgres'; |
| 198 | +import { Logger } from '@7b/core'; |
| 199 | +import { HttpServer } from '@7b/io/http'; |
| 200 | +``` |
| 201 | + |
| 202 | +Most APIs remain unchanged - it's primarily import path updates. We provide an automated migration tool: |
| 203 | + |
| 204 | +```bash |
| 205 | +npx @7b/migrate |
| 206 | +``` |
| 207 | + |
| 208 | +## Documentation |
| 209 | + |
| 210 | +- [Full Documentation](https://deepkit.io/documentation/introduction) |
| 211 | +- [API Reference](https://deepkit.io/documentation/api) |
| 212 | +- [Examples](./examples) |
| 213 | + |
28 | 214 | ## Community Packages |
29 | 215 |
|
30 | | -- [OpenAPI](https://github.com/hanayashiki/deepkit-openapi): Automatic OpenAPI doc and Swagger UI generation based on HTTP routes. |
31 | | -- [Serverless Adapter](https://github.com/H4ad/serverless-adapter): Run Deepkit on top of AWS Lambda, Azure, Digital Ocean and many other clouds. |
32 | | -- [REST](https://github.com/deepkit-rest/rest): DeepKit REST opens up a whole new declarative and extensive approach for developing REST APIs. |
33 | | -- [Stripe](https://github.com/deepkit-community/modules/tree/master/packages/stripe): Interacting with the Stripe API or consuming Stripe webhooks in your Deepkit applications is now easy as pie 🥧. |
34 | | -- [GraphQL](https://github.com/marcus-sa/deepkit-graphql/tree/main/packages/core): Create GraphQL servers using Deepkit |
35 | | -- [Apollo Server](https://github.com/marcus-sa/deepkit-graphql/tree/main/packages/apollo): Run your Deepkit GraphQL server using Apollo |
36 | | -- [Remix](https://github.com/marcus-sa/deepkit-modules/tree/main/packages/remix): Create Remix apps using Deepkit as the server |
37 | | -- [Remix Validated Form](https://github.com/marcus-sa/deepkit-modules/tree/main/packages/remix-validated-form): Use Deepkit Type as form validator for Remix |
38 | | -- [Nx Webpack Plugin](https://github.com/marcus-sa/deepkit-modules/tree/main/packages/nx-webpack-plugin): Nx Webpack plugin for Deepkit |
| 216 | +- [OpenAPI](https://github.com/hanayashiki/deepkit-openapi): Automatic OpenAPI doc and Swagger UI generation |
| 217 | +- [Serverless Adapter](https://github.com/H4ad/serverless-adapter): Run on AWS Lambda, Azure, Digital Ocean |
| 218 | +- [REST](https://github.com/deepkit-rest/rest): Declarative REST API development |
| 219 | +- [Stripe](https://github.com/deepkit-community/modules/tree/master/packages/stripe): Stripe integration |
| 220 | +- [GraphQL](https://github.com/marcus-sa/deepkit-graphql): GraphQL server support |
| 221 | +- [Remix](https://github.com/marcus-sa/deepkit-modules/tree/main/packages/remix): Remix integration |
39 | 222 |
|
40 | 223 | ## Examples |
41 | 224 |
|
42 | | -- [example with HTTP, RPC, and CLI controller](https://github.com/deepkit/deepkit-framework/blob/master/packages/example-app/app.ts). |
43 | | -- [HTTP router with custom http server](https://github.com/deepkit/deepkit-framework/blob/master/packages/example-app/slim.ts). |
44 | | -- [Bookstore](https://github.com/marcj/deepkit-bookstore): Auto REST CRUD + Deepkit API Console. |
45 | | -- [Webpack](https://github.com/marcj/deepkit-webpack): Type Compiler with Webpack. |
46 | | -- [GraphQL](https://github.com/marcus-sa/deepkit-graphql/tree/main/examples/orm-integration): Deepkit GraphQL server application with ORM integration |
47 | | -- [Remix](https://github.com/marcus-sa/deepkit-modules/tree/main/apps/example-remix): Remix application using Deepkit as the server |
48 | | -- [Angular](https://github.com/marcus-sa/deepkit-angular-template): Angular SSR application using Deepkit as the server with RPC |
| 225 | +- [HTTP, RPC, and CLI controller](./packages/example-app/app.ts) |
| 226 | +- [HTTP router with custom server](./packages/example-app/slim.ts) |
| 227 | +- [Bookstore](https://github.com/marcj/deepkit-bookstore): Auto REST CRUD + API Console |
| 228 | +- [Webpack](https://github.com/marcj/deepkit-webpack): Type Compiler with Webpack |
| 229 | +- [GraphQL](https://github.com/marcus-sa/deepkit-graphql/tree/main/examples/orm-integration): GraphQL with ORM |
| 230 | +- [Remix](https://github.com/marcus-sa/deepkit-modules/tree/main/apps/example-remix): Remix application |
| 231 | +- [Angular](https://github.com/marcus-sa/deepkit-angular-template): Angular SSR with RPC |
49 | 232 |
|
50 | 233 | ## Contributing |
51 | 234 |
|
52 | | -If you are interested in contributing to the development, check out the [Development Docs](./DEVELOPMENT.md) to learn more about setting up your local development environment. |
| 235 | +We welcome contributions! Please see [DEVELOPMENT.md](./DEVELOPMENT.md) for development setup and guidelines. |
| 236 | + |
| 237 | +## License |
| 238 | + |
| 239 | +MIT License - see [LICENSE](./LICENSE) |
| 240 | + |
| 241 | +## Support |
| 242 | + |
| 243 | +- [Discord Community](https://discord.gg/U24mryk7Wq) |
| 244 | +- [GitHub Issues](https://github.com/marcj/deepkit/issues) |
| 245 | +- [Documentation](https://deepkit.io) |
0 commit comments