Coder Social home page Coder Social logo

chisel / steroids Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 194 KB

Framework for building Node.js servers with Express on steroids!

TypeScript 94.97% JavaScript 2.50% HTML 2.53%
steroid typescript express backend framework services routers infrastructure fast-develop

steroids's Introduction

Express on Steroids!

Steroids helps building backend solutions with Node.js, Express, and TypeScript by introducing new components that are easy and fast to develop.

Here's a quick list of features Steroids provides:

  • TypeScript enabled
  • Powered by Express
  • Automatic code minification
  • Logic is encapsulated into "Services" and router middlewares are grouped as "Routers"
  • Routes are easily defined using the Router decorator
  • Built-in input validation mechanism with routers (request body, headers, query parameters, etc.)
  • Ability to extend the validation logic with custom validators
  • Dynamic route and service installation
  • Dynamic service injection without circular dependency issues
  • Path alias support for easier imports
  • Unit testing with Mocha and Chai
  • TypeDoc ready

Installation

npm install @chisel/steroids -g

Steroids Framework

You can read the official documentation to learn how to use Steroids to develop backend solutions.

CLI Usage

After installing Steroids globally, the sd command will be available with the following options:

  • sd new <name> [options]: Creates a new Steroids project. The project name should be in kebab case.
    Options:
    • -m, --minimal: Skips setting up tests and examples.
    • --skip-examples: Skips setting up examples.
    • --skip-tests: Skips setting up tests.
    • --skip-npm-install: Skips installing dependencies.
    • --skip-git: Skips initializing git repository.
    • -v, --verbose: Verbose logging.
  • sd add router <name> [options]: Generates a router component under src/routers.
    Options:
    • -d, --directory <path>: A path to override the default location the router is generated at.
    • --skip-tests: Skips generating the unit test for router.
  • sd add service <name> [options]: Generates a service component under src/services.
    Options:
    • -d, --directory <path>: A path to override the default location the service is generated at.
    • --skip-tests: Skips generating the unit test for service.
  • sd path list: Displays a list of all existing paths.
  • sd path new <alias> <target>: Creates a new path (target must be relative to src).
  • sd path delete <alias>: Deletes a path.
  • sd build [options]: Builds the source into dist.
    Options:
    • -v, --verbose: Displays all logs.
  • sd run [options]: Builds and runs the server.
    Options:
    • -p, --port <port_number>: Overrides the port number.
    • -w, --watch: Enables live reloading by watching the source files for changes.
    • --skip-build: Skips building the source code before running the server.
    • -v, --verbose: Displays all logs.
  • sd test [options]: Builds and runs the tests against the last server build.
    Options:
    • -v, --verbose: Displays all logs.
  • sd docs [options]: Generates the documentation using TypeDoc inside docs directory.
    Options:
    • -s, --serve: Serves the documentation on port 7000.
    • -p, --port: Overrides the port number the documentation is being served on.
    • -d, --directory <path>: A path relative to project root to override the default documentation directory.
    • -v, --verbose: Displays all logs.
  • sd --version: Displays Steroids version.
  • sd --help: Displays Steroids help. You can also use this option with any commands to view detailed usage information.

Examples

Creating a new project

Create a new project called My Project:

sd new my-project

Adding a router

Add a new router called UserAuth at src/routers/user-auth.router.ts:

sd add router user-auth

Adding a service

Add a new service called Firebase at src/services/firebase.service.ts:

sd add service firebase

Managing paths

List all TypeScript paths:

sd path list

Add a new path for modular validators at src/validators:

sd path new "@steroids/validator/*" "validators/*.validator"

Delete the validators path:

sd path delete "@steroids/validator/*"

Building the source code

Build the source into dist:

sd build

Running the server

Run the server on default port 5000:

sd run

Run the server on port 5003 with live reloading and skip building for the first time:

sd run --port 5003 --watch --skip-build

Running the tests

Build and run the tests:

sd test

Generating the documentation

Generate the documentation at docs and serve on port 5004:

sd docs -s -p 5004

steroids's People

Contributors

ramtinsoltani avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.