VitNode

Installation

How to get started to create a new VitNode app.

Video

Guide

Pre-installation

Before you start, make sure you have the following software installed on your machine:

  • Node.js (version 20 or higher) - for running JavaScript code,
  • Docker or PostgreSQL (version 14 or higher) - for running the database.

CLI

To create a new app with VitNode use create-vitnode-app CLI.

pnpm create vitnode-app@latest

Options

You can pass options to the CLI to customize the app creation process.

OptionDescription
--package-managerSpecify the package manager to use. Support npm, pnpm.
--eslintInitialize with eslint config.
--dockerInitialize with Dockerfile & Docker Compose.
--no-eslintSkip initializing with eslint config.
--skip-installSkip installing packages after initializing the project.

Database setup

VitNode requires to have a database to run the app. We created 2 ways to setup the database:

1. Using Docker

Docker is the fastest way to setup the database. Our pre-configuration allows you to start the database with a single command.

pnpm docker:dev

2. Manual Setup

If you don't want to use Docker, you can setup the database manually. Install PostgreSQL and create a new database.

After that, go to .env file in the root of the project and fill the following variables:

.env
# ! Database
DB_USER=root
DB_PASSWORD=root
# DB_HOST=database
# DB_DATABASE=vitnode
# DB_PORT=5432
# DB_SSL=false

Optional Variables

Commented variables are optional, you can uncomment them if you want to use them.

Start Dev Server

To start the development server run the following command:

pnpm dev

Register Account

After starting the server, you need to register an account. Open the browser and go to http://localhost:3000/register to create a new account.

First user will be an admin.

On this page