Skip to content

ialopezg/CoreJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoreJS Logo
Custom tools for NodeJS 🚀

Modern, powerful web application framework for Node.js.

NPM Version GitHub Release Version NPM Downloads Build Coverage Status
Patreon donate button Open Collective donate button Open Collective donate button

Description

CoreJS is a toolset that helps you to develop and debug modern applications. This tool is made to be used in Node.js, which allows you to easily build efficient, scalable applications. It uses modern JavaScript, is built with TypeScript and bring best JavaScript concepts.

Installation

npm install @ialopezg/corejs

Quick Start

Basic App Setup

app.ts

import { Application as ApplicationFactory } from '@ialopezg/corejs';
import * as express from 'express'

export class Application implements ApplicationFactory {
    constructor(private application: express.Application) {
      // do something
    }
  
    start() {
      // do something before server starts
      
      const port = process.env.APP_PORT || 3000;
      this.application.listen(port, () => {
        console.log(`Application listen on port: ${port}`);
      });
    }
}

app.socket.module.ts

import { Module } from '@ialopezg/corejs';

@Module({})
export class AppModule {}

main.ts

import { AppRunner } from '@ialopezg/corejs';
import { AppModule } from './app.module';
import { Application } from './app';

AppRunner.run(Application, AppModule);

Setup first controller

Controllers layer is responsible for handling HTTP requests. This is how we create controller in Nest application:

import { Controller } from '@ialopezg/corejs';
import { NextFunction, Request, Response } from 'express';

@Controller({ path: 'users' })
class UsersController {
  @RequestMapping({ path: '/' })
  getAllUsers(request: Request, response: Response, next: NextFunction) {
    response.status(201).json({});
  }
}

Features

  • Compatible with both TypeScript and ES6 (Recommend to use TypeScript
  • Based on well-known libraries (Express / socket.io) so you could easily use your experience
  • Easy to learn - syntax is really similar to Angular / Spring (Java)
  • Dependency Injection, Inversion of Control Container
  • Exceptions handler layer (helps to focus on logic)
  • Own modularity system
  • Sockets module (based on socket.io)

Documentation & Quick Start

Documentation & Tutorial - Coming soon

Starter repositories

Future

CoreJS is very much still a work in progress. There is still some things to finish:

  • Better test utilities
  • Exception filters
  • Validation helpers
  • Starter repos
  • Increase test coverage
  • Gateway middlewares
  • and more...

People

Author - Isidro A. Lopez G.

License

CoreJS is licensed under MIT license.


© Copyright 1995-present - Isidro A. Lopez G.