cubic

3.0.3Ā ā€¢Ā PublicĀ ā€¢Ā Published

cubic

npm Node version dependencies build


Cubic is a simple wrapper that integrates node.js frameworks into one platform that's easy to scale in docker or kubernetes.

This project is still very much in development and lacks documentation in some places, but you can already check out how we've built NexusHub with the help of Cubic.


Features

Cubic comes with everything needed to create a full-size web application for modern standards:

  • Automatically routed API endpoints to HTTP and WebSockets
  • Webpack for optimal dev & prod bundling
  • Full OAuth2 integration
  • Pub/Sub model for real-time data
  • Rate limits and caching on a per-endpoint basis
  • Clear endpoint schema for automated unit tests

We provide all of these features regardless of which http/ws server you choose to use under the hood.


Usage

To install cubic to your project:

npmĀ init
npmĀ installĀ cubicĀ cubic-apiĀ cubic-authĀ cubic-uiĀ cubic-clientĀ cubic-defaults

This looks like a lot of things, but that's because you don't actually need more than cubic and cubic-api for a minimal API server. Everything else only extends the base functionality for the sake of showing you a fully working web-app.

Entrypoint

Next we'll create index.js as our entrypoint to the server

//Ā index.js
constĀ CubicĀ =Ā require('cubic')
constĀ cubicĀ =Ā newĀ Cubic()
Ā 
//Ā LoadĀ auth,Ā viewĀ andĀ apiĀ nodesĀ neededĀ forĀ aĀ basicĀ setup
cubic.bootstrap()

Ready to go

Now all we need to do is run

nodeĀ index.js

And Cubic will automatically create some default API endpoints and views that you can learn the basics from.
You'll now find your web-app on localhost:3000 šŸŽ‰


License

MIT

Dependentsā€‚(0)

Package Sidebar

Install

npm i cubic

Weekly Downloads

3

Version

3.0.3

License

MIT

Unpacked Size

17.5 kB

Total Files

12

Last publish

Collaborators

  • kaptard
  • nexus-ci