Files
2026-02-19 16:39:21 +03:30

99 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 🚀 Robin Network Server Setup
Follow these steps to run the project locally.
---
## 1⃣ Install Dependencies
```bash
npm install
```
---
## 2⃣ Run PostgreSQL
Make sure PostgreSQL is installed and running on your system.
Create the database if it does not exist:
```sql
CREATE DATABASE robin_network;
```
Default database configuration used in this project:
- Host: localhost
- Port: 5432
- User: postgres
- Password: 1234
- Database: robin_network
---
## 3⃣ Create .env File
Create a `.env` file in the root directory and add:
```env
PORT=4000
# Database
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USER=postgres
DATABASE_PASSWORD=1234
DATABASE_NAME=robin_network
OTP_EXPIRE_TIME_MINUTES=5
JWT_SECRET=IOnf9828bcoeiwfnoUTFDIUWNDOINiuesvfc7632biUBEC&OInuy2vciabkjmcpqocuyBIUBFUEYVXUWVD
JWT_EXPIRATION=10d
JWT_EXPIRATION_IN_HOUR=240
```
---
## 4⃣ Run Database Migrations
```bash
npm run migration:run
```
---
## 5⃣ Create Admin User Manually
After migrations are completed, create an admin user manually in PostgreSQL.
Example:
```sql
INSERT INTO users (id, username, email, role)
VALUES (
'a random uuid',
'your_username',
'your_email@example.com',
'admin'
);
```
---
## 6⃣ Start the Application
```bash
npm start
```
---
## ✅ Application URL
If everything is configured correctly, the server will run at:
```
http://localhost:4000
```