@ahmadjavaiddev/aura 1.0.1 β†’ 1.0.3

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 +86 -60
  2. package/dist/index.js +772 -718
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,98 +1,124 @@
1
- # πŸš€ Aura
1
+ # Aura
2
2
 
3
- **Aura** is a powerful, interactive CLI scaffolder designed to generate modern, high-performance Express.js backends in seconds. It abstracts away the boilerplate while giving you full control over the features you actually need.
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.
4
5
 
5
- Built for speed with **Bun** and **TypeScript**, Aura ensures your project starts with a solid, type-safe foundation.
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)
6
8
 
7
- [![npm version](https://img.shields.io/npm/v/@ahmadjavaiddev/aura.svg)](https://www.npmjs.com/package/@ahmadjavaiddev/aura)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+ ---
10
+
11
+ ## Why Aura?
9
12
 
10
- ## πŸ“¦ Installation & Usage
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
+ ---
11
19
 
12
- You can run Aura directly without installing it globally using `npx`:
20
+ ## Quick Start
21
+
22
+ Start your next project immediately with `npx`:
13
23
 
14
24
  ```bash
15
25
  npx @ahmadjavaiddev/aura my-new-project
16
26
  ```
17
27
 
18
28
  ### Options
19
- - `my-new-project`: The name of the directory to create.
20
- - `--version`, `-v`: Show version number.
21
- - `--help`, `-h`: Show help information.
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
+ ---
22
37
 
23
- ## ✨ Features
38
+ ## Pick Your Stack
24
39
 
25
- Aura is highly modular. During the interactive setup, you can pick and choose from the following:
40
+ Aura is modular by design. Select only the components you need for your project:
26
41
 
27
- - πŸ—„οΈ **Database ORMs**: Prisma (PostgreSQL), Drizzle (PostgreSQL), or Mongoose (MongoDB).
28
- - πŸ” **Authentication**: Clerk (Hosted), Better-Auth (Self-hosted), or a Custom JWT Middleware starter.
29
- - ⚑ **Caching**: Distributed caching with Redis or simple In-memory local caching.
30
- - πŸͺ΅ **Logging**: Advanced OpenTelemetry (with PostHog integration) or standard Console logging.
31
- - πŸš₯ **Rate Limiting**: Redis-based (distributed) or Basic (memory-based) protection.
32
- - πŸ“¨ **Emails**: Integration with Resend or traditional SMTP via Nodemailer.
33
- - πŸ”„ **Background Jobs**: Built-in support for Inngest event-driven background functions.
34
- - πŸ“ **Linting & Formatting**: Biome (Ultra-fast) or the classic Prettier + ESLint combo.
35
- - πŸ“„ **Pagination**: Pre-configured Zod schemas and pagination helpers.
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
+ ---
36
64
 
37
- ## πŸ—οΈ Project Structure
65
+ ## ⚑ Aura Add
38
66
 
39
- Aura follows a clean, "Abstraction-First" architecture. All framework-heavy code is tucked away in the `src/base` directory, allowing you to focus on your business logic.
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:
40
79
 
41
80
  ```text
42
81
  my-new-project/
43
82
  β”œβ”€β”€ src/
44
- β”‚ β”œβ”€β”€ app.ts # Entry point
45
- β”‚ β”œβ”€β”€ routes/ # Your API routes go here
46
- β”‚ β”œβ”€β”€ base/ # Framework abstractions (Route Registry, etc.)
83
+ β”‚ β”œβ”€β”€ app.ts # Clean main entry point
84
+ β”‚ β”œβ”€β”€ routes/ # YOUR LOGIC: API endpoints live here
85
+ β”‚ β”œβ”€β”€ base/ # THE CORE: Framework abstractions (Internal)
47
86
  β”‚ β”œβ”€β”€ config/ # Environment & service configurations
48
- β”‚ β”œβ”€β”€ middlewares/ # Custom middlewares (Auth, Logging)
49
- β”‚ β”œβ”€β”€ utils/ # Shared utilities (Zod helpers, Errors)
50
- β”‚ └── [models/db/inngest] # Feature-specific directories
51
- β”œβ”€β”€ .env # Pre-configured environment variables
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
52
91
  β”œβ”€β”€ package.json
53
92
  └── tsconfig.json
54
93
  ```
55
94
 
56
- ## πŸš€ Getting Started
57
-
58
- Once generated, your project is ready to go:
59
-
60
- 1. **Install Dependencies**:
61
- ```bash
62
- cd my-new-project
63
- bun install
64
- ```
65
-
66
- 2. **Database Setup** (if applicable):
67
- ```bash
68
- bun run db:generate # For Prisma
69
- ```
70
-
71
- 3. **Start Development**:
72
- ```bash
73
- bun run dev
74
- ```
95
+ ---
75
96
 
76
- ## πŸ› οΈ Defining Routes
97
+ ## Defining Routes
77
98
 
78
- Aura makes route definition simple and type-safe using `defineRoute`:
99
+ Aura makes route definition declarative and type-safe using the `defineRoute` utility. Every route automatically returns a heavily standardized `ApiResponse<T>`:
79
100
 
80
101
  ```typescript
81
- import { defineRoute } from "../base";
102
+ import { defineRoute } from "../base/define-route";
82
103
  import { z } from "zod";
83
104
 
84
- export default defineRoute({
85
- method: "GET",
86
- path: "/hello",
87
- schema: {
88
- query: z.object({ name: z.string().optional() })
105
+ export const createUser = defineRoute({
106
+ method: "post",
107
+ path: "/users",
108
+ input: {
109
+ body: z.object({ name: z.string(), email: z.string().email() })
89
110
  },
90
- handler: async ({ req, res, query }) => {
91
- res.json({ message: `Hello, ${query.name || "World"}!` });
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 };
92
118
  },
93
119
  });
94
120
  ```
95
121
 
96
122
  ---
97
123
 
98
- Built with ❀️ by [Ahmad Javaid](https://github.com/ahmadjavaiddev)
124
+ Built by [Ahmad Javaid](https://github.com/ahmadjavaiddev)