A web-based management dashboard that organizes server tools and services in a customizable card layout with authentication.
- User Authentication System: Secure login with role-based access
- Customizable Dashboard: Organize services in sections and cards
- Card Management: Add, edit, and delete cards that link to various services
- Section Management: Group cards into logical sections
- Mobile Responsive: Works on desktop and mobile devices
- Dark Mode Support: Toggle between light and dark themes
- Node.js (v14 or later)
- MySQL Database
-
Clone the repository:
git clone <repository-url> cd Main-Page-Redirection -
Install dependencies:
npm install -
Set up environment variables by creating a
.envfile in the root directory (see Environment Variables section below) -
Start the server:
npm start -
Access the application at http://localhost:3002 (or your configured port)
Create a .env file in the root directory with the following variables:
# Server Configuration
PORT=3002
NODE_ENV=development
ENVIRONMENT=DEV
DEBUG=false
# Database Configuration
DB_HOST=localhost
DB_PORT=3306
DB_NAME=dashboard_db
DB_USER=your_database_user
DB_PASSWORD=your_database_password
DB_DIALECT=mysql
USE_MYSQL=true
# Session Secret (generate a strong random string)
SESSION_SECRET=your-secure-session-secret-key
| Variable | Description | Example |
|---|---|---|
| PORT | The port on which the server will run | 3002 |
| NODE_ENV | Node environment (development/production) | development |
| ENVIRONMENT | Application environment (DEV/PROD) | DEV |
| DEBUG | Enable debug logging | true/false |
| DB_HOST | MySQL database host | localhost |
| DB_PORT | MySQL database port | 3306 |
| DB_NAME | MySQL database name | dashboard_db |
| DB_USER | MySQL database username | dbuser |
| DB_PASSWORD | MySQL database password | dbpassword |
| DB_DIALECT | Database dialect (always mysql) | mysql |
| USE_MYSQL | Use MySQL for card storage | true |
| SESSION_SECRET | Secret for session encryption | random-string |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/cards | Retrieve all cards |
| POST | /api/cards | Create a new card |
| PUT | /api/cards/:id | Update a card by ID |
| DELETE | /api/cards/:id | Delete a card by ID |
| GET | /api/sections | Retrieve all sections |
| POST | /api/sections | Create a new section |
| PUT | /api/sections/:id | Update a section by ID |
| DELETE | /api/sections/:id | Delete a section by ID |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/debug | Retrieve debug information |
| POST | /api/debug | Create a new debug entry |
| PUT | /api/debug/:id | Update a debug entry by ID |
| DELETE | /api/debug/:id | Delete a debug entry by ID |
- Username: admin
- Password: admin123
- Log in with the default credentials
- Use the "Add New Section" button to create sections
- Use the "Add Card" button within each section to add tools or services
- Edit or delete existing cards and sections as needed
When adding a card, you can configure:
- Title: Name of the service
- Description: Brief description of the service
- URL: Link to the service
- Icon: Either an image URL or a Bootstrap icon
- Button Icon: Icon displayed on the action button
- Order: Position within its section
- The application uses secure session management
- Passwords are hashed using bcrypt
- Authentication is required for all routes
- Content Security Policy is implemented to prevent XSS attacks
- All API endpoints are protected against unauthorized access
You can run this application in a Docker container for easier deployment and isolation.
- Create a
docker-compose.ymlfile in the project root:
version: '3'
services:
dashboard:
build: .
ports:
- "3002:3002"
environment:
- PORT=3002
- NODE_ENV=production
- ENVIRONMENT=PROD
- DB_HOST=db
- DB_PORT=3306
- DB_NAME=dashboard_db
- DB_USER=dashuser
- DB_PASSWORD=your_secure_password
- SESSION_SECRET=your_secure_session_secret
depends_on:
- db
restart: unless-stopped
db:
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_ROOT_PASSWORD=root_password
- MYSQL_DATABASE=dashboard_db
- MYSQL_USER=dashuser
- MYSQL_PASSWORD=your_secure_password
volumes:
- db_data:/var/lib/mysql
restart: unless-stopped
volumes:
db_data:- Create a
Dockerfilein the project root:
FROM node:16-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
EXPOSE 3002
CMD ["npm", "start"]- Build and start the containers:
docker-compose up -d- Access the application at http://localhost:3002 (or your configured port)
-
Create the
Dockerfileas shown above -
Build the Docker image:
docker build -t server-dashboard .- Run the container:
docker run -p 3002:3002 \
-e PORT=3002 \
-e NODE_ENV=production \
-e ENVIRONMENT=PROD \
-e DB_HOST=your_db_host \
-e DB_PORT=3306 \
-e DB_NAME=dashboard_db \
-e DB_USER=your_db_user \
-e DB_PASSWORD=your_db_password \
-e SESSION_SECRET=your_session_secret \
--name server-dashboard \
-d server-dashboardYou can deploy this application on a Pterodactyl panel using a NodeJS server egg.
-
In your Pterodactyl panel, create a new server using a NodeJS egg
-
Server requirements:
- NodeJS 14+
- Minimum 512MB RAM
- 1GB disk space
-
Upload your application files to the server:
- Either using the file manager in the panel
- Or via SFTP
- Or by connecting your GitHub repository
-
Configure the following startup variables in the panel's Startup tab:
- Make sure the startup command is set to
npm start
- Make sure the startup command is set to
-
Configure environment variables:
- Add all required environment variables from the
.envfile in the Startup tab's Environment Variables section - Important: Make sure to set
DB_HOSTto point to your MySQL server's address
- Add all required environment variables from the
-
Start the server from the Pterodactyl panel
The application uses the port specified in your .env file (default: 3002). Make sure:
- This port is allocated in your Pterodactyl server configuration
- The port is forwarded through your router if you're hosting at home
- Any firewalls are configured to allow traffic on this port
Note: If you change the port in your .env file, you must make sure this new port:
- Is allocated in Pterodactyl
- Is not already in use by another application
- Is properly forwarded through any firewalls or routers
Using a reverse proxy like Nginx is recommended for exposing the application securely with SSL.
This project is licensed under the MIT License - a permissive open-source license developed at the Massachusetts Institute of Technology. This license allows you to:
- Use the software for commercial purposes
- Modify the software
- Distribute the software
- Use and modify the software in private
The main requirement is that the license and copyright notice must be included in all copies of the software.
Developed by FNB (F No Baby) as a centralized dashboard solution for server management and service organization.
© 2025 FNB - All Rights Reserved