Skip to main content

Installation

What you'll need

  • Node.js version 16.14 or above:
    • When installing Node.js, you are recommended to check all checkboxes related to dependencies.

yarn:

bash
yarn add @kult/core @kult/cli

NPM:

bash
npm i @kult/core @kult/cli

Create a application:

src/index.ts
import { Application } from '@kult/core';

const app = new Application();
app.start();

Project folder structure

  • src/app
    • /models
    • /controllers
  • src/config
    • server.ts
    • database.ts
    • plugins.ts
  • src/plugins
  • src/index.ts

Environment Variables

Server:

.env
PORT=3000

Database:

.env
DATABASE_TYPE='postgres'
DATABASE_HOST='localhost'
DATABASE_PORT=5444
DATABASE_USERNAME='admin'
DATABASE_PASSWORD='admin'
DATABASE_DATABASE='development'

Running

yarn:

bash
yarn dev

NPM:

bash
npm run dev

If the application started successfully you should see:

Terminal Output

API is now available at http://localhost:3000.

Building

yarn:

bash
yarn build

NPM:

bash
npm run build

Examples