https://github.com/justinmchase/grove
Grove is a Hybrid Microservice framework for Deno and Oak.
https://github.com/justinmchase/grove
deno grove hybrid-microservices microservices oak
Last synced: 3 months ago
JSON representation
Grove is a Hybrid Microservice framework for Deno and Oak.
- Host: GitHub
- URL: https://github.com/justinmchase/grove
- Owner: justinmchase
- License: isc
- Created: 2023-02-18T19:03:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-04T03:43:56.000Z (over 1 year ago)
- Last Synced: 2025-03-04T04:28:52.345Z (over 1 year ago)
- Topics: deno, grove, hybrid-microservices, microservices, oak
- Language: TypeScript
- Homepage: https://jsr.io/@justinmchase/grove
- Size: 195 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Grove 🌳
[](https://github.com/justinmchase/grove/actions/workflows/check.yml)
Grove is a
[Hybrid Microservice](https://justinmchase.com/2023/03/11/hybrid-microservice-architecture/)
framework for [Deno](https://deno.land) and [Oak](https://jsr.io/@oak/oak).
## Usage
#### main.ts
```ts
import { Context, JobContext, State } from "./context.ts";
import { initControllers } from "./controllers/mod.ts";
import { initServices } from "./services/mod.ts";
import { initRepositories } from "./repositories/mod.ts";
import { initManagers } from "./managers/mod.ts";
import { initJobs } from "./jobs/mod.ts";
import {
ConsoleLogger,
Grove,
JobMode,
WebMode,
} from "https://deno.land/x/grove/mod.ts";
async function initContext(): Promise {
const services = await initServices();
const repositories = await initRepositories(services);
const managers = await initManagers(repositories);
return {
logger: new ConsoleLogger(),
services,
repositories,
managers,
};
}
const grove = new Grove({
initContext,
modes: [
new WebMode({ initControllers }),
new JobMode({ initJobs }),
],
});
await grove.start(Deno.args);
```
#### run in web mode
```sh
deno run -A main.ts web
```
#### run the hello job
```sh
deno run -A main.ts job hello --name Justin
```
### Example
See the [example](./example/main.ts) application for more information.