Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetAdmin Pro

Lightweight Network Management web application (local development)

Overview

NetAdmin Pro provides inventory management, IPAM, topology, incident tracking, reports, and user/role management for network operations teams.

Quick start (local)

  1. Start PHP built-in server from project root:
php -S localhost:8000 -t public
  1. Open http://localhost:8000/login.php and sign in (default admin created during setup):
  • Username: admin
  • Password: 12345 (change immediately)
  1. Import schema / create admin (if needed):
php scripts/import_schema.php
php scripts/create_admin.php --password='YourStrongPassword'

Notes

  • Update database credentials in config/database.php or use environment variables DB_HOST, DB_NAME, DB_USER, DB_PASS.
  • Change the admin password after first login.

GitHub

To create a remote repository and push from this folder:

git remote add origin git@github.com:<your_user>/<repo>.git
git branch -M main
git push -u origin main
```# NetAdmin Pro

NetAdmin Pro is an enterprise-style network management system built with PHP, MySQL, Bootstrap 5, and modern frontend patterns.

## Overview

This project is designed for network administrators, NOC engineers, and system administrators to manage network devices, IP address assignments, topology, incidents, reports, and user roles in a central dashboard.

## Structure

- `assets/` — frontend assets: CSS and JavaScript
- `config/` — database and configuration files
- `includes/` — shared PHP templates and helper functions
- `modules/` — feature modules for future expansion
- `public/` — web entry points and dashboard pages
- `sql/` — database schema and setup scripts

## Setup

1. Install XAMPP or another PHP/MySQL environment.
2. Place the `NetAdmin` folder in your Apache web root or configure your virtual host.
3. Create the database:
   - Import `sql/schema.sql` into MySQL.
4. Add an admin user manually using a secure password hash.
5. Open `public/login.php` in your browser.

## Notes

- The project uses prepared statements and session-based authentication.
- The UI is designed for professional network operations dashboards.
- Device Management is implemented with inventory listing and add-device support.
- IP Address Management is implemented with subnet inventory and subnet creation.
- Subnet Calculator is implemented for network planning and mask calculations.
- Network Topology is implemented with a visual topology map and link inventory.
- Alerts & Incident Management is implemented with incident logging, severity tracking, and status reporting.
- Reports module is implemented with executive summaries, device and incident dashboards, and IPAM utilization metrics.
- Next development steps: add role-based user administration and advanced report export options.

## Deployment & Admin Setup

1. Import the database schema found in `sql/schema.sql` into MySQL/MariaDB.
2. Create an initial administrator account using the included CLI helper:

```bash
php scripts/create_admin.php --password="YourSecurePassword"
  1. Place the NetAdmin folder in your web server document root or configure a virtual host pointing to public/.
  2. Ensure config/database.php contains correct DB credentials and that PHP sessions are writable.

Local setup helper commands

  1. Copy .env.example to .env and update values.
  2. Install PHP dependencies:
composer install
  1. Import the database schema (either with mysql or the provided CLI helper):
# Using mysql CLI
mysql -u root -p netadmin_pro < sql/schema.sql

# Or using the project's PHP helper (reads DB config from environment or config)
php scripts/import_schema.php
  1. Create an initial administrator account:
php scripts/create_admin.php --password="YourSecurePassword"

Production hardening checklist

  • Use HTTPS: configure TLS on your web server and set SESSION_SECURE=1 in .env to force secure session cookies.
  • Secure cookies: includes/auth.php applies HttpOnly and configurable SameSite (Lax default). Set SESSION_SAMESITE=Strict if appropriate.
  • Environment variables: move DB and SMTP credentials into .env or your host's secret store; do not commit secrets.
  • PHP settings: disable display_errors and enable log_errors in php.ini for production.
  • File permissions: ensure exports/ is writable by the scheduled user, but not world-writable.
  • Email credentials: configure SMTP in .env and verify phpmailer is working.

Quick Windows setup

Use the included helper to automate install, import, admin creation, and QA checks:

.\setup.bat

Linux / macOS setup

Use the included setup.sh helper (make it executable first):

chmod +x setup.sh
./setup.sh

Environment validation

Before running install helpers you can validate your system with:

php scripts/check_env.php

Security notes:

  • CSRF protection is implemented for all POST forms via helpers in includes/functions.php.
  • Role-based access control (RBAC) is enforced on management pages using require_role() in includes/auth.php.

Next recommended steps to harden before production:

  • Configure HTTPS and secure cookies in php.ini / web server.
  • Use environment variables for DB credentials instead of committing them to config files.
  • Review and enable appropriate PHP hardening options (disable display_errors, enable strict types where feasible).

Exports and QA

Reports can be exported from the UI on the Reports page. Supported modes:

  • Printable / PDF: click "Printable / PDF" then use the browser Print -> Save as PDF flow.
  • CSV export: click "Export CSV" to download a CSV summary of device, incident, IPAM and topology metrics.

Server-side CSV export endpoint: public/reports_export.php?mode=csv

Automated QA helper:

Run the included QA script to scan public/ pages for missing CSRF tokens, RBAC checks, and basic PHP lint errors:

php scripts/qa_check.php

If the script reports missing CSRF or RBAC entries, review the indicated files and ensure forms include <?php echo csrf_input_field(); ?> and pages enforce require_role() or require_login().

Scheduled Exports (automation)

A simple scheduler script is provided at scripts/reports_cron.php. It writes timestamped CSV reports into the exports/ folder and can optionally email the CSV.

Basic usage (generate and save CSV):

php scripts/reports_cron.php --dir=exports

Email the generated CSV (best-effort; requires a working PHP mail setup):

php scripts/reports_cron.php --dir=exports --email=ops@example.com

Cron example (Linux): run daily at 02:00

0 2 * * * /usr/bin/php /path/to/NetAdmin/scripts/reports_cron.php --dir=/path/to/NetAdmin/exports

Task Scheduler example (Windows): create a basic task that runs php.exe with argument C:\path\to\NetAdmin\scripts\reports_cron.php --dir=C:\path\to\NetAdmin\exports.

Files are written to the exports/ directory by default. Ensure the web server or scheduled user has write permission to that folder.

SMTP / PHPMailer setup

For reliable email delivery install Composer dependencies and configure SMTP credentials as environment variables or in your system's service configuration:

  1. Install Composer dependencies (run in project root):
composer install
  1. Configure environment variables (example):
export SMTP_HOST=smtp.example.com
export SMTP_PORT=587
export SMTP_USER=smtp-user
export SMTP_PASS='smtp-password'
export SMTP_SECURE=tls
export MAIL_FROM=no-reply@example.com
export MAIL_FROM_NAME="NetAdmin Pro"

On Windows Task Scheduler, set these as environment variables or include them in the scheduled task command.

Admin settings are also available through the app UI at Settings once you are logged in as an administrator. SMTP values entered there will be used if no environment variable override is present.

About

Enterprise Network Management System built using PHP, MySQL, Bootstrap, and JavaScript featuring device management, IP Address Management (IPAM), subnet calculator, network topology, alerts, and reporting.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages