@ahmadjavaiddev/aura 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +124 -0
  2. package/dist/index.js +1177 -0
  3. package/package.json +29 -0
package/README.md ADDED
@@ -0,0 +1,124 @@
1
+ # Aura
2
+
3
+ **The High-Performance API Scaffolder.**
4
+ Aura is an interactive CLI designed for developers who want to build modern Express.js backends—without the boilerplate. It abstracts framework complexities into a dedicated core while giving you total control over the features you need.
5
+
6
+ [![npm version](https://img.shields.io/npm/v/@ahmadjavaiddev/aura.svg?style=flat-square)](https://www.npmjs.com/package/@ahmadjavaiddev/aura)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
8
+
9
+ ---
10
+
11
+ ## Why Aura?
12
+
13
+ - **Zero Boilerplate**: Skip the setup. Get a production-ready API in 30 seconds.
14
+ - **Abstraction-First**: Your logic in `src/routes`, framework magic in `src/base`.
15
+ - **Full-Type Safety**: Built from the ground up with TypeScript and Zod.
16
+ - **Enterprise-Ready**: Built-in support for OpenTelemetry, Redis, Auth, and Inngest.
17
+
18
+ ---
19
+
20
+ ## Quick Start
21
+
22
+ Start your next project immediately with `npx`:
23
+
24
+ ```bash
25
+ npx @ahmadjavaiddev/aura my-new-project
26
+ ```
27
+
28
+ ### Options
29
+ | Command | Description |
30
+ | :--- | :--- |
31
+ | `aura [name]` | Create a new project in the specified directory |
32
+ | `aura add [feature]` | Inject a new feature (e.g. `redis`, `prisma`) into an existing Aura project |
33
+ | `-v, --version` | Display current Aura version |
34
+ | `-h, --help` | Show usage information |
35
+
36
+ ---
37
+
38
+ ## Pick Your Stack
39
+
40
+ Aura is modular by design. Select only the components you need for your project:
41
+
42
+ ### Database & Models
43
+ - **ORM Options**: Prisma (PostgreSQL), Drizzle (SQL), Mongoose (MongoDB).
44
+ - **Auto-Sync**: Pre-configured scripts for database migrations and client generation.
45
+
46
+ ### Security & Auth
47
+ - **Providers**: Clerk (Hosted), Better-Auth (Self-hosted), Custom JWT.
48
+ - **Protection**: Optional Redis-based Rate Limiting and Role-based access skeletons.
49
+
50
+ ### Performance & Scaling
51
+ - **Caching**: Choose between local In-memory or distributed Redis caching.
52
+ - **Background Jobs**: Native Inngest support for event-driven background functions.
53
+
54
+ ### Observability & Tooling
55
+ - **Logging**: Console-based or OpenTelemetry + PostHog for production tracking.
56
+ - **Development**: Choice of **Biome** (Ultra-fast) or **ESLint + Prettier**.
57
+ - **Email**: Integrated **Resend** or traditional **SMTP** (Nodemailer).
58
+
59
+ ### Infrastructure
60
+ - **Docker**: Automatically generate a production-ready `Dockerfile` and `docker-compose.yml`.
61
+ - **CI/CD**: Generate GitHub Actions workflows for seamless testing and linting pipelines.
62
+
63
+ ---
64
+
65
+ ## ⚡ Aura Add
66
+
67
+ Scaffolded a barebones project but decided you need Redis later? Use the `aura add` command to intelligently inject features into your existing project—modifying `package.json`, updating environment variables, injecting imports, and setting up initializations automatically using slot markers!
68
+
69
+ ```bash
70
+ aura add redis
71
+ aura add prisma
72
+ ```
73
+
74
+ ---
75
+
76
+ ## The Aura Blueprint
77
+
78
+ The generated project structure is designed to isolate framework code from your business logic:
79
+
80
+ ```text
81
+ my-new-project/
82
+ ├── src/
83
+ │ ├── app.ts # Clean main entry point
84
+ │ ├── routes/ # YOUR LOGIC: API endpoints live here
85
+ │ ├── base/ # THE CORE: Framework abstractions (Internal)
86
+ │ ├── config/ # Environment & service configurations
87
+ │ ├── middlewares/ # Custom middlewares (Auth, Logger)
88
+ │ ├── utils/ # Shared utilities (Zod, Errors, Email)
89
+ │ └── ... # Feature directories (models, inngest, etc.)
90
+ ├── .env # Pre-configured environment boilerplate
91
+ ├── package.json
92
+ └── tsconfig.json
93
+ ```
94
+
95
+ ---
96
+
97
+ ## Defining Routes
98
+
99
+ Aura makes route definition declarative and type-safe using the `defineRoute` utility. Every route automatically returns a heavily standardized `ApiResponse<T>`:
100
+
101
+ ```typescript
102
+ import { defineRoute } from "../base/define-route";
103
+ import { z } from "zod";
104
+
105
+ export const createUser = defineRoute({
106
+ method: "post",
107
+ path: "/users",
108
+ input: {
109
+ body: z.object({ name: z.string(), email: z.string().email() })
110
+ },
111
+ output: z.object({ id: z.string(), name: z.string() }),
112
+ handler: async ({ body }) => {
113
+ // Body is fully typed!
114
+ const { name, email } = body;
115
+ // Return the output according to the schema - Aura automatically wraps it in a standard response:
116
+ // { success: true, data: { ... }, metadata: { timestamp: "...", path: "/users" } }
117
+ return { id: "123", name };
118
+ },
119
+ });
120
+ ```
121
+
122
+ ---
123
+
124
+ Built by [Ahmad Javaid](https://github.com/ahmadjavaiddev)