GithubHelp home page GithubHelp logo

zhangaz1 / alosaur Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alosaur/alosaur

0.0 1.0 0.0 151 KB

Alosaur - Deno web framework with many decorators

License: MIT License

TypeScript 99.96% Shell 0.04%

alosaur's Introduction

Alosaur ๐Ÿฆ–

Alosaur - Deno web framework ๐Ÿฆ–.

Build Status

  • Area - these are the modules of your application.
  • Controller - are responsible for controlling the flow of the application execution.
  • Middlware - provide a convenient mechanism for filtering HTTP requests entering your application.
  • Decorators - for query, cookie, parametrs, routes and etc.
  • Dependency Injection - for all controllers by default from microsoft/TSyringe (more about alosaur injection)

Documentation


Simple example:

Controller:

import { 
  Controller,
  Content,
  Get,
  Area,
  App,
} from 'https://deno.land/x/alosaur/src/mod.ts'

@Controller('/home')
export class HomeController {
  @Get('/text')
  text() {
    return Content("Hello world");
  }
  @Get('/json')
  json() {
    return Content({"text":"test"});
  }
}

// Declare module
@Area({
  controllers: [HomeController]
})
export class HomeArea {
}

// Create alosaur application
const app = new App({
  areas: [HomeArea]
});

app.listen();

tsconfig.app.json:

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true
  }
}

And run

deno run -A --config ./src/tsconfig.app.json app.ts


TODO

  • Add render views: dejs

  • Add return value JSON

  • Add decorators:

    • @Area
    • @QueryParam
    • @Param param from url: /:id
    • @Body
    • @Cookie
    • @Req
    • @Res
    • @Middleware with regex route
    • @Cache Cache to actions {duration: number} number in ms
  • Add middleware

  • Add static middleware (example: app.useStatic)

  • Add CORS middleware

  • Add DI

  • Add std exceptions

  • Add CI with minimal tests. (see this comment)

  • Add GraphQl

  • Add WebSocket

  • Add validators example class-validator

  • Add microservice connector with wasm

  • Add benchmarks

  • Transfer to Alosaur github organization

  • Add docs and more examples

Plugins & modules

Examples

  • Add basic example
  • Add di example
  • Add static serve example
  • Add dejs view render example
  • Add example with sql drivers (postgres)
  • Add basic example in Docker container
  • Add websockets example
  • Add example with wasm

alosaur's People

Contributors

irustm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.