Installation Guide - skydashnet/skydash-monitoring GitHub Wiki
Getting Started
This page will guide you through the process of installing and configuring a Skydash.NET project in your local environment, from start to finish until the application is ready to run.
1. Prerequisites
Before you begin, make sure your system has the following software installed:
- Node.js: Before you begin, make sure your system has the following software installed:
- pnpm: The package manager used in this project. If it is not installed, run
npm install -g pnpm
. - MySQL: The database server to store all application data. You can use XAMPP, Laragon, or a standalone MySQL installation.
- RouterOS v7.xx: for RestAPI connections
2. Project Installation
- Cloning a Repository Open a terminal or Git Bash, then clone this repository to your computer:
git clone https://github.com/skydashnet/skydash-monitoring.git
cd skydash-monitoring
- Dependency Installation
This project uses a monorepo managed by
pnpm
. Run the following command from the project root directory to install all dependencies for the backend and frontend at once:
pnpm install
3. Backend Configuration
- Create
.env
File Go to thebackend
directory, then make a copy of the.env.example
file and name it.env
.
backend cd
cp .env.example .env
- Environment Variables Fill
Open the
.env
file you just created with a text editor, then fill in the following variables according to your local configuration:
# Database Configuration
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=
DB_NAME=skydash_db
DB_PORT=3306
# Server Configuration
PORT=3000
NODE_ENV=development
# JWT Secret Key (Required to be filled with a random string)
JWT_SECRET=THIS_IS_VERY_SECRET_DO_NOT_LEAK_OUT
# WhatsApp Configuration (Baileys)
# Leave blank if not used
WA_DEVICE_ID=
WA_DEVICE_TOKEN=
Important:
JWT_SECRET
must be filled with a long and random string for user session security.
4. Database Setup
This application requires some tables in the database to function.
-
Create Database Create a new database in your MySQL with the same name as you defined in
DB_NAME
in the.env
file (example:skydash_db
). -
Import Tables The table structure and initial data required can be found on the following Wiki page. Copy and run the SQL commands from that page in your client database (e.g. phpMyAdmin or HeidiSQL).
5. Frontend Configuration
By default, the frontend is already configured to communicate with the backend. The main configuration file is located at frontend/vite.config.js
. You can see the proxy settings there which redirect all /api
requests to the backend server.
// frontend/vite.config.js
export default defineConfig({
// ...
server: {
proxy: {
'/api': {
target: 'http://localhost:3000', // Make sure this port is the same as the PORT in .env backend
changeOrigin: true,
},
'/ws': {
target: 'ws://localhost:3000',
ws: true,
},
},
},
});
Make sure the target points to the correct address and port where your backend is running.
6. Running the Application
Once all the configuration is done, go back to the project root directory, then run the application with a single command:
pnpm run dev
This command will run the backend server and the frontend development server simultaneously. If all goes well, you should see the output from both processes in the terminal.
Now, open your browser and access http://localhost:5173 (or another port displayed by Vite) to see the Skydash.NET application in action!