A simple, lightweight TypeScript web framework built on Bun inspired by Laravel's elegant MVC style.
Fast, minimal, and developer-friendly with decorators, Prisma integration, and easy response rendering.
- TypeScript & Bun-powered for speed and type safety
- MVC architecture with Controllers, Routes, and Middleware
- Route decorators for clean route definitions
- EJS templating with dynamic rendering support
- Response helpers: HTML, JSON, XML, redirects, errors
- Built-in middleware support and request logging
- Prisma ORM for database management
- Easy to extend and customize
- Bun installed on your system
- Node.js and npm/yarn (optional, for Prisma CLI)
bun installStart the development server:
bun run startAccess the app at:
http://localhost:3000
/app
/controllers # Controller classes
/middlewares # Middleware functions
/models # Prisma models and business logic
/config # Configuration files
/public # Static files (CSS, JS, images)
/views # EJS templates for rendering
/server.ts # Server entry point
| Method | Path | Description |
|---|---|---|
| GET | / |
Render home page with EJS view |
| GET | /json |
Returns a JSON response |
| GET | /html |
Returns raw HTML response |
| GET | /redirect |
Redirects to external URL |
| GET | /error |
Returns 500 Internal Server Error |
import RequestMethod from "../enums/RequestMethod";
import { Route } from "../decorators/Route";
import Renderer from "../helpers/Renderer";
export default class HomeController {
@Route("/", RequestMethod.GET)
async index() {
return await Renderer.view("home", { title: "Welcome", message: "Hello from Bun Framework!" });
}
@Route("/json", RequestMethod.GET)
jsonExample() {
return Renderer.json({ message: "Hello from JSON response!" });
}
}Setup your database using Prisma ORM.
npx prisma migrate dev --name initUsage in code:
import Database from "../utils/Database";
const users = await Database.prisma.user.findMany();export function logger(request: Request, response: Response, next: Function): void {
console.log(`${request.method} ${request.url} - ${new Date().toISOString()}`);
next();
}Register middleware as needed in your server setup.
- Build your project with Bun if needed.
- Deploy on any platform supporting Bun (Linux servers, Docker containers, or cloud providers).
- Ensure environment variables and database credentials are configured correctly.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page and submit pull requests.
This project is licensed under the MIT License.