πŸš€Getting Started

Let's be productive!

To embark on your Node-Boot journey, the optimal starting point is to browse our marketplace and select a Software Template that aligns with your project needs.

Once chosen, you can then specify your preferred application server, enabling you to swiftly initiate your development journey with a fully functional sample application. By building and running this selected template, you'll seamlessly immerse yourself in exploring the comprehensive features offered by Node-Boot.

We firmly advocate for this approach as it establishes a standardised foundation from the outset, ensuring consistency and efficiency throughout your development process.

Highlight

Our Software Templates are crafted to swiftly generate sample applications equipped with all the essentials for a seamless start. However, we value transparency and encourage you to comprehend the underlying steps, as we firmly believe that knowledge forms the bedrock of success.

Let's assume you have a penchant for fast applications, and you've opted for Fastify as your chosen application server framework.

Alright, first things first: it's dependency installation time! Get ready to play "Fetch the Dependencies" - it's like a scavenger hunt, but for code!

  1. Install Node-Boot core dependencies

npm install @node-boot/core @node-boot/config @node-boot/context reflect-metadata winston 
  1. Install Server Layer: Fastify

npm install @node-boot/fastify-server fastify
  1. Setup Node-Boot Application

app.ts
import "reflect-metadata";
import {NodeBoot, NodeBootApp, NodeBootApplication, NodeBootAppView} from "@node-boot/core";
import {FastifyServer} from "@node-boot/fastify-server";

@NodeBootApplication()
export class SampleApp implements NodeBootApp {

    start(port?: number): Promise<NodeBootAppView> {
        return NodeBoot.run(FastifyServer, port);
    }
}
server.ts
import {SampleApp} from "./app";

// Starts the Node-Boot server with the application deployed
new SampleApp()
    .start()
    .then(app => {
        console.debug(`SampleApp started successfully at port ${app.appOptions.port}`);
    })
    .catch(reason => {
        console.error(`Error starting SampleApp: ${reason}`);
    });
  1. Add Application Configuration File

app-config.yaml
node-boot:
    # App configurations
    app:
        name: "sample-service"
        platform: "sample"
        environment: "development"
        defaultErrorHandler: false
        port: 3000

Application structure

A typical Node-Boot project has the following structure:

Last updated