{"id":15305461,"url":"https://github.com/alenvelocity/aureolin","last_synced_at":"2025-10-09T03:11:55.290Z","repository":{"id":43660310,"uuid":"416018353","full_name":"AlenVelocity/Aureolin","owner":"AlenVelocity","description":"Aureolin is a fast and powerful MVC Framework","archived":false,"fork":false,"pushed_at":"2025-02-04T00:38:03.000Z","size":464,"stargazers_count":26,"open_issues_count":12,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T09:21:50.494Z","etag":null,"topics":["api","backend","decorators","esnext","koa","node","preact","rest","server","ssr"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/aureolin","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlenVelocity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"alen01"}},"created_at":"2021-10-11T17:08:34.000Z","updated_at":"2023-03-18T07:29:37.000Z","dependencies_parsed_at":"2023-01-23T02:00:27.643Z","dependency_job_id":"e3365ca3-dcf7-4e25-a95b-f56d14348c8c","html_url":"https://github.com/AlenVelocity/Aureolin","commit_stats":{"total_commits":229,"total_committers":5,"mean_commits":45.8,"dds":"0.23144104803493448","last_synced_commit":"5018f8dbcb59eebe747fbd6c534d0ec0f7016573"},"previous_names":["alensaito1/aureolin"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2FAureolin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2FAureolin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2FAureolin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2FAureolin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlenVelocity","download_url":"https://codeload.github.com/AlenVelocity/Aureolin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248597081,"owners_count":21130807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","backend","decorators","esnext","koa","node","preact","rest","server","ssr"],"created_at":"2024-10-01T08:00:36.750Z","updated_at":"2025-10-09T03:11:50.270Z","avatar_url":"https://github.com/AlenVelocity.png","language":"TypeScript","funding_links":["https://ko-fi.com/alen01"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=center\u003e\n\n# Aureolin\n**Aureolin** is a simple, fast, and powerful MVC framework for Node.js with a focus on simplicity and performance. Built With [Koa](https://github.com/koajs/koa)\n\n[![NPM](https://img.shields.io/badge/Available%20On-NPM-lightgrey.svg?logo=npm\u0026logoColor=339933\u0026labelColor=white\u0026style=flat-square)](https://npmjs.com/package/aureolin)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FAlenSaito1%2FAureolin.svg?type=small)](https://app.fossa.com/projects/git%2Bgithub.com%2FAlenSaito1%2FAureolin?ref=badge_small)\n\n[![NPM](https://img.shields.io/npm/l/aureolin?style=flat-square\u0026label=License)](https://github.com/AlenSaito1/Aureolin/blob/master/LICENSE) [![Discord](https://img.shields.io/discord/898177582829285387?label=Discord\u0026style=flat-square)](https://discord.gg/3Pg2Nw2vjn) [![CodeFactor](https://img.shields.io/codefactor/grade/github/alensaito1/aureolin?style=flat-square\u0026label=Code%20Quality)](https://www.codefactor.io/repository/github/alensaito1/aureolin) [![NPM](https://img.shields.io/npm/dw/aureolin?style=flat-square\u0026label=Downloads)](https://npmjs.com/package/aureolin)[![Prettier](https://img.shields.io/badge/Code_Style-Prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\n\n\u003c/div\u003e\n\n----\n\n## Installation\n\n```sh\nnpm install aureolin\n```\n\n## Getting Started\n\nTo get started with Aureolin, you need to create a config file named `aureolin.config.js` in the root of your project.\n\n```js\n/** @filename aureolin.config.js */\n\nconst { join } = require('path')\n\n/** @type {import('aureolin').Config} */\nmodule.exports = {\n    root: join(process.cwd(), process.env.NODE_ENV === 'production' ? 'dist' : 'src'),\n    port: 4000,\n    public: {\n        path: '/public',\n        dir: './public',\n        index: 'index.html'\n    },\n    views: {\n        path: 'views',\n        extension: 'hbs',\n        map: { \n            hbs: 'handlebars' \n        }\n    }\n}\n```\n\nThen, use the `create` function to create the app.\n\n\n```TS\n/** @filename src/main.ts */\n\nimport { create } from 'aureolin'\n// import create from 'aureolin'\n// const { create } from require('aureolin')\n\nconst main = async () =\u003e {\n    const app = await create()\n}\n```\n\n### Controllers\n\nTo create a controller you need to import the `Controller` decorator from Aureolin. \n\nDecorators for all Http methods are provided\n\nThe return value of the methods prefixed with an Http Decorator in a controller are sent as the response\nResponse can be a string, number, object, array, or even a JSX Element (YES! JSX See [Here](https://github.com/alensaito1/aureolin/blob/master/docs/Using-JSX.md))\n\nUse the provided Parameter Decorators to let Aureolin to know what parameters pass to the to the controller methods.\n\n```TSX\n/** @filename src/controllers/hello.tsx */\nimport { Controller, Context, Get, Ctx, Param } from 'aureolin'\n\n@Controller('/hello')\nexport class HelloController {\n    @Get('/')\n    async hello() {\n        return (\n            \u003cdiv\u003e\n                \u003ch1\u003eHello World!\u003c/h1\u003e\n                \u003cp\u003eThis is a simple example of Aureolin\u003c/p\u003e\n            \u003c/div\u003e\n        )\n    }\n\n    @Get('/:name')\n    async helloName(@Ctx() { params: { name } }: Context) {\n        return `Hello ${name}!`\n    }\n\n    @Get('/:name/:age')\n    async helloNameAge(@Param('name') name: string, @Param('age') age: string) {\n        return `Hello ${name}! You are Probably ${age} years old.`\n    }    \n}\n```\n\n## Providers\n\nProviders are a way to inject dependencies into your controllers.\nUse the `provider` decorator to decalre a class as a provider.\nUse the `inject` decorator to inject provider into your controllers.\n\n`@Provider(provide: string)`\n```TS\n/** @filename src/providers/time.ts */\nimport { Provider } from 'aureolin'\n\n@Provider('time')\nexport default class TimeProvider {\n    async getTime() {\n        return new Date().toLocaleTimeString()\n    }\n}\n```\n`@Inject(provide: string)`\n```TS\n/** @filename src/controllers/time.ts */\nimport { Controller, Context, Get, Inject } from 'aureolin'\nimport type TimeProvider from 'providers/time.ts'\n\n@Controller('/time')\nexport class TimeController {\n\n    constructor(@Inject('time') private timeProvider: TimeProvider) {}\n\n    @Get('/')\n    async getTime() {\n        return timeProvider.getTime()\n    }\n}\n```\n\n## Middlewares\n\nUse the `@Middleware` and `@ControllerMiddleware` Decorator factories\n\n```TS\nimport { Middleware, Controller, ControllerMiddleware, Context, Get, Ctx, Param, NextFunction } from 'aureolin'\n\n@Contoller('cakes')\n@ContollerMiddleware([\n    (ctx: Context, next: Next) =\u003e {\n        console.log('Controller Middleware 1')\n        return next()\n    }\n])\nexport default class CakesController {\n\n    @Get('/cheesecake')\n    @Middleware([cheesecakemiddleware])\n    public cheesecake() {\n        return {\n            name: 'Cheesecake',\n            ingredients: ['cheese', 'flour', 'sugar']\n        }\n    }\n\n    @Get('/redvelvet')\n    @Middleware([redvelvetmiddleware])\n    public redvelvel() {\n        return {\n            name: 'Red Velvet',\n            ingredients: ['cheese', 'flour', 'sugar', 'red stuff']\n        }\n    }\n}\n```\n\n## Error Handling\n\nAureolin takes care of error handling for you.\nUse the exported `Exception` or Prebuilt classes to throw error dircetly in your code and aureolin will handle it.\n\n```ts\n/** @filename src/controllers/error.ts */\nimport { Controller, Context, Get, Exception, BadRequestException } from 'aureolin'\n\n@Controller('/error')\nexport class ErrorController {\n    @Get('/')\n    async error(): never {\n        throw new Exception('Something went wrong!', 500)\n    }\n\n    @Get('/:name')\n    async errorName(@Ctx() { params: { name } }: Context): never {\n        if (!name) throw new BadRequestException(`${name} is not a valid name!`)\n    }\n}\n```\n----\n\nAnd finally you can call `create()` to start your app.\n\n```TS\n/** @filename src/main.ts */\n\nimport { create } from 'aureolin'\nconst main = async () =\u003e {\n    const app = await create()\n}\n\nmain()\n```\n\nAfter you have created the application, Visit ```http://localhost:3000/hello``` to see the output of the `hello` controller.\n\nCheck out the [Docs Folder](https://github.com/alensaito1/aureolin/tree/master/docs) for more information.\n\n\n## Key Features\n\n- Decorator based routing\n- Highly configurable \u0026 scalable\n- Server Side Rendering\n- Strongly Typed\n\n## Contributing \n\n- See [Contributing Section](https://github.com/alensaito1/aureolin/blob/master/CONTRIBUTING.md)\n\n\n\n---\nThank you for using Aureolin!\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## License\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FAlenSaito1%2FAureolin.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FAlenSaito1%2FAureolin?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falenvelocity%2Faureolin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falenvelocity%2Faureolin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falenvelocity%2Faureolin/lists"}