0.0.1-beta.0 • Published 4 years ago

curli-core v0.0.1-beta.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

curli-core

The core for a library to handle modules on the top of Express and build a complete custom framework.

Build Status Coverage Status

Motivation

  • Create a framework that doesn't want a wedding, just a hookup

  • Doesn't matter if you want MVC, Spaghetti Code or CQRS, you can do it.

  • Easy to extend

  • Build it using modules and modules definers.

Installation

Install by npm

npm install --save curli-core

Basic Usage

import {
  CurliApplication,
  BootersModulesDefiner,
  ServicesModulesDefiner,
  ConfigModulesDefiner
} from 'curli-core';

import {AppModule} from "./App/Infrastructure/AppModule";
import {UserModule} from "./Users/Infrastructure/UserModule";
import {ListModule} from "./Lists/Infrastructure/ListModule";

  const app = new CurliApplication({
    port: 3000,
    environment: 'local'
  });

  app.addModulesDefiner(new BootersModulesDefiner(app));
  app.addModulesDefiner(new ServicesModulesDefiner(app));
  app.addModulesDefiner(new ConfigModulesDefiner(app));

  app.addModule(new AppModule());
  app.addModule(new UserModule());
  app.addModule(new ListModule());

  app.startApp();
  app.initServer(function (url: string) {
    console.log(`Server is running at ${url}`);
  });

Commands

  • npm run build: Build the project (Curli framework).
  • npm run build:clean: Delete first the dist folder and build it.
  • npm run clean: Delete the dist folder.
  • npm run test: Execute the tests.
  • npm run test:coverage: Execute the tests and calculate the coverage.
  • npm run lint: Check the code using the rules in .eslintre.js
  • npm run lint:fix: Check the code and try to fix it.

License

MIT