Skip to main content

Welcome

Get started with Vastly in less than 5 minutes.

Vastly is a prebuilt Node.js backend that is designed to power any type of software application, having in it a REST API with essential production-ready features such as authentication, role management, payment webhooks, and unit tests, it allows a developer to build on top of the system and to instead focus on the development of their business logic. The API contains fundamental CRUD operations and supports integration with any frontend library. Simply call it a feature-rich API template.

What you'll need

  • Node.js version 14 or above:
    • We suggest installing node with its default settings
  • Mongo DB
    • You can either use a local or hosted database
  • Postman
    • Or any other API testing tool
  • Nodejs skills

Getting Started

Get started by Purchasing a license .

Once you acquire your license, we shall email you the stable version of the code and add you as a contributor to the GitHub repo.

The license is lifetime, it also includes free updates and support for upto 6 months.

Installation

Dependencies

Installation is quite straightforward, just open the project root folder and run the command below.

npm install --save --legacy-peer-deps

This command installs all necessary dependencies you need to run Vastly, thus ensure you have a stable internet connection.

You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.

.env

Rename the .env-example located in the project root directory to be .env

Vastly Setup

The setup process of Vastly is crucial and should be followed keenly.

Info

The setup is done thorugh Techkey CLI controller.

  • We recommend opening the project in a code editor such as Visual Studio Code.

From the root directory navigate to a folder called setup/

In the setup folder you should find atleast 3 files class.js index.js and setup.js.

While in the directory run the installer through the command

node setup.js --techkey --install VASTLY
  • Note your path in the terminal should be YOUR_VASTLY_LOCATION\vastly-backend-api\setup>
  • Where YOUR_VASTLY_LOCATION is the directory in which you have placed vastly in your device

You shall then follow a 8 step wizard for the Installation

#1. Provide a MongoDB connection string

Question: Provide a MongoDB  connection string.

Paste into the terminal a MongoDB connection string, for documentation purposes we shall be using a local database instance,

mongodb://localhost:27017/vastly
  • The API shall validate the connection string and if the operation is successful then you shall be prompted to confirm you want to run the installer

Press Enter to continue

#2. Installation prompt

Question: Would you like to run the installer (Y/n)

To continue with the installer type Y into the terminal, to cancel the Installation process type any other character

Y

Press Enter to continue

#3. Resubmit your MongoDB connection string

Question: Enter a Mongo DB connection string

For documentation purposes we shall be using a local database instance,

mongodb://localhost:27017/vastly

Press Enter to continue

#4. Database user

Question: Enter the database user

Provide your database user

techkey

Press Enter to continue

#5. Database Password

Question: Enter the database Password

Provide your database user

xxxxxxxxxxxx

Press Enter to continue

#6. JSON Web Token Secret

Question: Enter a  token secret

Provide a unique string that shall be used to sign the API's JWT( JSON Web Tokens )

managed-by-the-techkey

Press Enter to continue

#7. Web Token Validity

Question: Enter valid token duration (ex: 5d)

Duration of how long a signed token should remain valid

5d

Press Enter to continue

Question: Enter valid cookie duration (ex: 7)

Duration of how long a signed cookie should remain valid

7

Press Enter to continue

Seeding

Once the installation wizard steps are completed, the API shall seed role data into the database.

Read about the default roles and their importance here

You should have the following logs in your terminal

seeding role data
seeding role COMPLETED

The installation process can be spotlighted as

? Provide a mongoDB connection string mongodb://localhost:27017/vastly
? Would you like to run the installer Yes
? Enter a Mongo DB connection string mongodb://localhost:27017/vastly
? Enter the database user techkey
? Enter the database password xxxxxxxxxxxx
? Enter a token secret managed-by-the-techkey
? Enter valid token duration (ex: 5d) 5d
? Enter valid cookie duration (ex: 7) 7


Configurations

Whats next

Configure basic api settings here.