All Projects → fauzan121002 → Denovel

fauzan121002 / Denovel

Licence: mit
A Deno Framework For Web Artisan - Inspired by Laravel

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Denovel

Iris
The fastest HTTP/2 Go Web Framework. AWS Lambda, gRPC, MVC, Unique Router, Websockets, Sessions, Test suite, Dependency Injection and more. A true successor of expressjs and laravel | 谢谢 https://github.com/kataras/iris/issues/1329 |
Stars: ✭ 21,587 (+16764.84%)
Mutual labels:  laravel, framework, web-framework, mvc
Toruk
Go web 开发脚手架
Stars: ✭ 78 (-39.06%)
Mutual labels:  framework, web-framework, web-development
Rocket
A web framework for Rust.
Stars: ✭ 15,760 (+12212.5%)
Mutual labels:  framework, web-framework, web-development
Thinkgo
A lightweight MVC framework written in Go (Golang).
Stars: ✭ 184 (+43.75%)
Mutual labels:  laravel, web-framework, mvc
Dreamfactory
DreamFactory API Management Platform
Stars: ✭ 1,148 (+796.88%)
Mutual labels:  laravel, framework
Ouzo
Ouzo Framework - PHP MVC ORM
Stars: ✭ 66 (-48.44%)
Mutual labels:  framework, mvc
Kales
Kotlin on Rails
Stars: ✭ 78 (-39.06%)
Mutual labels:  framework, mvc
Go Web
A new Golang MVC Framework. Like Laravel... but faster!
Stars: ✭ 79 (-38.28%)
Mutual labels:  laravel, framework
Butterfly
🔥 蝴蝶--【简单】【稳定】【好用】的 Python web 框架🦋 除 Python 2.7,无其他依赖; 🦋 butterfly 是一个 RPC 风格 web 框架,同时也是微服务框架,自带消息队列通信机制实现分布式
Stars: ✭ 82 (-35.94%)
Mutual labels:  web-framework, mvc
Jkmvc
Jkmvc is an elegant, powerful and lightweight MVC & ORM framework built using kotlin. It aims to be swift, secure, and small. It will turn java's heavy development into kotlin's simple pleasure. No spring.
Stars: ✭ 86 (-32.81%)
Mutual labels:  web-framework, mvc
Appier
Joyful Python Web App development
Stars: ✭ 92 (-28.12%)
Mutual labels:  framework, mvc
Cakephp
CakePHP: The Rapid Development Framework for PHP - Official Repository
Stars: ✭ 8,453 (+6503.91%)
Mutual labels:  web-framework, mvc
Php Mini Framework
PHP mini framework
Stars: ✭ 65 (-49.22%)
Mutual labels:  framework, mvc
Foal
Elegant and all-inclusive Node.Js web framework based on TypeScript. 🚀.
Stars: ✭ 1,176 (+818.75%)
Mutual labels:  framework, web-framework
Best Of Web Python
🏆 A ranked list of awesome python libraries for web development. Updated weekly.
Stars: ✭ 1,118 (+773.44%)
Mutual labels:  framework, web-development
Cuba
CUBA Platform is a high level framework for enterprise applications development
Stars: ✭ 1,114 (+770.31%)
Mutual labels:  framework, web-framework
Mini
Just an extremely simple naked PHP application, useful for small projects and quick prototypes. Some might call it a micro framework :)
Stars: ✭ 1,308 (+921.88%)
Mutual labels:  framework, mvc
Valval
The fastest web framework in V language (vlang)
Stars: ✭ 103 (-19.53%)
Mutual labels:  framework, web-framework
Rails
Ruby on Rails
Stars: ✭ 49,693 (+38722.66%)
Mutual labels:  framework, mvc
Framework
IONDV. Framework is a high level framework for enterprise web applications development.
Stars: ✭ 54 (-57.81%)
Mutual labels:  framework, web-framework

Project is archived during unmaintained, may be continue to maintained soon.

tag License: MIT tag

Denovel is Web Based Framework made by Muhammad Fauzan . Denovel is Inspired by Laravel.

Table of Contents

Installation

  1. Clone Repository
git clone https://github.com/fauzan121002/denovel.git
cd denovel
  1. Open .env then change it by your database information
PORT=3000
BASE_URL=http://localhost:3000

#only support mysql,mongo,sqlite, and postgres
#you may experience some trouble in mariaDB (mysql)
#see the problem here https://github.com/manyuanrong/deno_mysql/issues/29
DB_CONNECTION=postgres
DB_HOST=localhost
DB_NAME=denovel
DB_USER=username
DB_PASS=password
DB_PORT=5432
  1. Run the server
deno run -A --unstable server.ts

or you can use denon (make sure you already install denon in your local computer , see the guide here)

denon run -A --unstable server.ts

Usage

Denomand

Denomand is official command-line interface for Denovel

Help

deno run -A --unstable denomand.ts help

Create a controller

deno run -A --unstable denomand.ts controller --name </YourControllerName>

Create a middleware

deno run -A --unstable denomand.ts middleware --name </YourMiddlewareName>

Create a model

deno run -A --unstable denomand.ts model --name </YourModelName>

Create a provider

deno run -A --unstable denomand.ts provider --name </YourProviderName>

Model

DenoDB is MySQL, SQLite, MariaDB, PostgreSQL and MongoDB ORM for Deno currently used by Denovel

Model Example

class User extends Model {
    static table = "users";
    static timestamps = false;

    static fields = {
        id: {
            primaryKey: true,
            autoIncrement: true
        },
        username: DataTypes.STRING,
        password: DataTypes.STRING
    };
}

Model Field Options

  static fields = {
    email: {
      type: DataTypes.STRING,
      unique: true,
      allowNull: false,
      length: 50,
    },
  };

Field Options : | Option | Usage | | ------------- | ------------- | | type | Datatypes List | | unique | boolean | | allowNull | boolean | | length | integer |

Model Datatypes

Example usage of boolean and integer:

class BlockedUsers extends Model {
    static table = "blocked_users";
    static timestamps = false;

    static fields = {
        id: {
            primaryKey: true,
            autoIncrement: true,
        },
        user_id: {
            type: DataTypes.INTEGER,
        },
        is_verified: {
            type: DataTypes.BOOLEAN,
        }
    };
}
Datatypes List

More datatypes: | Types | | ------------- | | BIG_INTEGER | | INTEGER | | DECIMAL | | FLOAT | | UUID | | BOOLEAN | | BINARY | | ENUM | | STRING | | TEXT | | DATE | | DATETIME | | TIME | | TIMESTAMP | | JSON | | JSONP |

Model Relationship

One to One :
import {db, DataTypes, Model} from "../../vendor/Denovel/Support/Facades/DB.ts";

import { Relationships } from 'https://deno.land/x/denodb/mod.ts';

class Owner extends Model {
  // ...

  // Fetch a business binded to this owner
  static business() {
    return this.hasOne(Business);
  }
}

class Business extends Model {
  // ...

  // Fetch an owner binded to this business
  static owner() {
    return this.hasOne(Owner);
  }
}

Relationships.oneToOne(Business, Owner);

db.link([Owner, Business]);
One to Many
import {db, DataTypes, Model} from "../../vendor/Denovel/Support/Facades/DB.ts";

import { Relationships } from 'https://deno.land/x/denodb/mod.ts';

class Owner extends Model {
  static table = 'owners';

  static fields = {
    id: {
      type: DataTypes.STRING,
      primaryKey: true,
    },
    name: DataTypes.STRING,
  };

  static businesses() {
    return this.hasMany(Business);
  }
}

class Business extends Model {
  static table = 'businesses';

  static fields = {
    id: {
      type: DataTypes.STRING,
      primaryKey: true,
    },
    name: DataTypes.STRING,
    ownerId: Relationships.belongsTo(Owner),
  };

  static owner() {
    return this.hasOne(Owner);
  }
}

db.link([Owner, Business]);

Many to Many
import {db, DataTypes, Model} from "../../vendor/Denovel/Support/Facades/DB.ts";

import { Relationships } from 'https://deno.land/x/denodb/mod.ts';

class Owner extends Model {
  static table = 'owners';

  static fields = {
    id: {
      type: DataTypes.STRING,
      primaryKey: true,
    },
    name: DataTypes.STRING,
  };

  static businesses() {
    return this.hasMany(Business);
  }
}

class Business extends Model {
  static table = 'businesses';

  static fields = {
    id: {
      type: DataTypes.STRING,
      primaryKey: true,
    },
    name: DataTypes.STRING,
  };

  static owners() {
    return this.hasMany(Owner);
  }
}

const BusinessOwner = Relationships.manyToMany(Business, Owner);

db.link([BusinessOwner, Business, Owner]);

Further informations :

Controller

Using Validation

async post({ request, response, params }: RouterContext) {
  const body = await request.body();
  const [passes,errors] = await super.validate(body.value,{
    todo: 'required|string'
  });

  //then you can do anything with passes , errors and body value
}

🤝 Contributing

Contributions, issues and feature requests are welcome, make sure to read the contribution guideline

📝 License

This project is licensed under the terms of the MIT license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].