AI-Powered Backend Development

Build backends with natural language

MangoJS is a lightweight Node.js framework for building secure, efficient microservices. Speak your architecture into existence with AI-driven development.

~3kb Core Size
<1ms Routing
100% TypeScript
AI Prompt
โฏ โ–Š

Everything you need
for modern backends

Built with developer experience in mind. Write less, ship more.

AI-First Development

Describe your service in plain English. MangoJS comes with optimized prompts and patterns for AI-assisted development. Build entire microservices with natural language.

"Create a user authentication service with JWT tokens"

Lightning Fast

Optimized routing engine with sub-millisecond response times. Built for high-throughput microservices.

Type-Safe

Full TypeScript support with strict typing. Catch errors at compile time, not runtime.

Dependency Injection

Clean, modular code with Inversify-powered DI. Easy testing and loose coupling built-in.

Security First

Built-in auth decorators, group permissions, and resource ownership validation.

Microservice Ready

Designed for distributed systems from day one. Scale horizontally with built-in patterns for service communication, queue systems, and scheduled tasks.

BullMQ Queues Cron Scheduler Worker Threads

From idea to API
in minutes

01

Describe Your Service

Use natural language to describe what you want to build. MangoJS templates guide AI to generate the right code.

"Create a blog post service with CRUD operations"
02

AI Generates Code

The framework generates layered architecture: Database entities, Services with business logic, and Controllers with type-safe APIs.

๐Ÿ“ db/models/Post.ts
๐Ÿ“ services/post.service.ts
๐Ÿ“ routes/posts.controller.ts
03

Ship to Production

Type-safe endpoints with Swagger docs, ready for deployment. Add features incrementally with the same workflow.

GET/api/v1/posts
POST/api/v1/posts
PUT/api/v1/posts/:id
DELETE/api/v1/posts/:id

Clean, declarative
developer experience

// Clean decorator-based routing
@Controller("/api/v1/users")
export class UserController {

  @Get("/")
  async getUsers(req: Request, res: Response) {
    const users = await userService.getAll();
    return res.status(200).json({ data: users });
  }

  @Post("/")
  @HasGroups(["Admin"])  // Built-in auth
  async createUser(req: Request, res: Response) {
    const user = await userService.create(req.body);
    return res.status(201).json({ data: user });
  }
}
// Automatic transaction management
@injectable()
export class UserService {

  @inject(INVERSITY_TYPES.PersistenceContext)
  private _persistence: IPersistenceContext;

  async create(data: UserPost): Promise<User> {
    return await this._persistence.inTransaction(
      async (em: EntityManager) => {
        const user = em.create(User, data);
        await em.save(user);
        return user;
      }
    );
  }
}
// Cron-based scheduled tasks
@Schedule('0 0 * * *', { 
  timezone: 'UTC',
  runOnStart: false 
})
@injectable()
export class CleanupTask extends ScheduledTask {

  async run(): Promise<void> {
    await this.performCleanup();
  }

  onComplete(): void {
    console.log('Cleanup finished!');
  }

  onError(error: Error): void {
    this.alertService.notify(error);
  }
}
// Distributed job processing
@QueueWorker('email-queue', { concurrency: 5 })
@injectable()
export class EmailWorker implements IQueueWorkerHandler {

  async process(job: Job<EmailData>): Promise<void> {
    const { to, subject, body } = job.data;
    
    await job.updateProgress(50);
    await this.sendEmail(to, subject, body);
    await job.updateProgress(100);
  }

  onFailed(job: Job, error: Error): void {
    console.error(`Job failed: ${error.message}`);
  }
}

Onion architecture
built for scale

Controllers
HTTP/API Layer
Services
Business Logic
Database
Data Models
๐Ÿ”„

Dependencies Flow Inward

Outer layers depend on inner layers, never the reverse

๐Ÿ—ƒ๏ธ

Database Agnostic

Switch databases without changing business logic

๐Ÿงช

Testable by Design

DI makes unit testing a breeze

Ready to build
something amazing?

1

Install MangoJS

npm install mangojs-core
2

Start Building with AI

"Start a MangoJS application using the quick-start template"