Nova Framework
📝 Table of Contents
🧐 About
Nova is a framework that is intended to help setup and maintain servers and integrations with ease. It allows you to setup and configure Graphql, Kafka, Redis, GRPC, Knex, and SocketIO and easily have access to them accross your application without installing any additional dependencies. Custom integrations of any other packages are super simple to do.
🏁 Getting Started
These instructions will get the project up and running on your local machine for development and testing purposes.
Prerequisites
Installing
npm i nova
End with an example of getting some data out of the system or using it for a little demo.
🎈 Usage
Creating a basic HTTP server:
import { Nova, LocalStorage } from "nova";
const novaServer = new Nova({
rootDir: __dirname, // root source directory
storage: new LocalStorage(),
services: [
// add services here...
],
});
novaServer.listen().then(() => {
console.log("Server Started!");
});
Adding and configuring services :
import { Nova, Graphql, WebSocket } from "nova";
const novaServer = new Nova({
services: [
new WebSocket(),
new Graphql({
typeDefs: `
type Query {
hello: String
}
`,
playground: true,
resolvers: {
Query: {
hello: () => {
return "hello";
},
},
},
}),
],
});
Creating HTTP controllers:
import { Controller } from "nova";
class Users extends Controller {
constructor() {
super();
this.endpoint = "/users";
this.router.get("/", this.home);
}
home(req: any, res: any) {
res.send("Hello");
}
}
Creating Custom Service:
import { Service } from "nova";
class CustomService extends Service {
constructor(config) {
super();
// configure service...
}
beforeStart(app: Express, server: Server) {
// Before server starts...
}
afterStart(app: Express, server: Server) {
// After server starts...
}
}
⛏️ Built Using
- Express - Server Framework
- NodeJs - Server Environment
- TypeScript - Programming Language
✍️ Authors
- @michael616kriel - Idea & Initial work
See also the list of contributors who participated in this project.