Skip to content

riod94/hihono

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hono Microservice Starter

Hono Vinejs Knex.js ObjectionJs

Microservice starter using Hono framework and Vine.js validator and Knex.js database driver and Objection.js as ORM.

Quick Start

To install dependencies:

bun install

Then copy .env.example to .env

cp .env.example .env

Note: You need to copy oauth-private.key and oauth-public.key to src/storage, this is used to sign and verify JWT.

To run:

bun dev

open http://localhost:8989

To run commands:

bun shin
$ bun scripts/index.ts
Available Commands:
make:controller     Create a new controller class
make:middleware     Create a new middleware class
make:model          Create a new Eloquent model class
make:request        Create a new form request class
make:resource       Create a new resource

To make a new controller:

bun shin make:controller UserController

To make a compiled file: Note: .env must be set first before compiling, if any change in src/ you will need to run bun compile again

bun compile AppName

Folder Structure

├── src                                   // Root Directory
│   ├── app                               // Application Directory
│   │   ├── Controllers                     // Controller Directory
│   │   │   ├── index.ts                        // All Controller export here. auto export using command
│   │   │   └── UserController.ts
│   │   ├── Middleware                      // Middleware Directory
│   │   │   ├── index.ts                        // All Middleware export here. auto export using command
│   │   │   └── AuthMiddleware.ts
│   │   │   └── InitMiddleware.ts
│   │   ├── Models                          // Model Directory
│   │   │   └── index.ts                       // All Model export here. auto export using command
│   │   │   └── User.ts
│   │   ├── Requests                        // Request Directory
│   │   │   └── index.ts                        // All Request export here. auto export using command
│   │   │   └── UserRequest.ts
│   │   ├── Resources                       // Resource Directory
│   │   │   └── index.ts                        // All Resource export here. auto export using command
│   │   │   └── BaseResource.ts                 // Base Resource Class. use for all resource class to parse data
│   │   │   └── UserResource.ts
│   │   └── Services                        // Service Directory
│   │   │   └── index.ts                        // All Service export here no command to make services
│   │   └── Types                           // Types Directory. All Interface is here
│   │
│   └── config                           // Configuration Directory
│   │   └── database.ts                    // Database Configuration. use for knex and objection setting
│   │   └── index.ts                       // All Configuration export here
│   │   └── ErrorHandler.ts                // Error Handler. use for exception error handling
│   │   └── RateLimiter.ts                // Rate Limiter. use for rate limiting
│   │
│   └── Lang                             // Language Directory
│   │   └── index.ts                       // This is use for translation eg: t("Hi :name, Welcome back", {name: "Hono"})
│   │   └── messages.ts                    // This is library for translation
│   │   └── validation.ts                  // This is library for validation
│   │
│   └── routes                           // Routing Directory
│   │   └── index.ts                       // All Route export here
│   │   └── api                            // API Route Directory
│   │       └── index.ts                   // All API Route export here
│   │
│   └── storage                          // Storage Directory
│   │   └── database-config.json          // Database Configuration. use for knex and objection connections
│   │   └── oauth-private.key
│   │   └── oauth-public.key
│   │
│   └── utils                            // Utility Directory
│       └── index.ts                       // All Utility export here
│       └── Mail.ts                        // Mail Utility. use for sending email

Documentation

For more information about Hono see docs

For more information about Objection.js see docs

For more information about Vine.js see docs

Contributing

For more details, see CONTRIBUTING.md

License

Distributed under the MIT License.

About

Hono boilerplate for microservices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published