A full-stack monorepo application for managing and monitoring network services built with TypeScript, Express, and React.
Server Manager is a powerful web application for monitoring and controlling essential network services like DNS (bind), DHCP, and HTTP servers. It features a robust TypeScript/Express backend API and a modern React UI with a clean, responsive dashboard.
The application allows you to:
- Monitor system metrics (CPU, memory, disk usage, uptime)
- Start, stop, and restart network services (named, dhcpd, httpd)
- Configure DNS zones and records with bind integration
-
View service status and logs
-
Manage user accounts with authentication
- Language: TypeScript
- Runtime: Node.js
- Framework: Express
- Database: SQLite with Drizzle ORM
- Validation: Zod (via shared package)
- Authentication: JWT tokens with bcrypt password hashing
- Development Tools: ESLint, Prettier, Nodemon, Jest
- Language: TypeScript
- Framework: React 18
- UI Components: Custom component library with shadcn/ui
- Styling: Tailwind CSS
- Icons: Lucide React
- Build Tool: Vite
- Testing: Vitest
- State Management: React Hook Form
- HTTP Client: Fetch API with custom wrapper
- Types: Shared TypeScript interfaces and types
- Validators: Zod schemas for data validation
- Transformers: Data transformation utilities
- Monorepo: Turborepo with pnpm workspaces
- Package Manager: pnpm
- Containerization: Docker support
ts-node-express/
βββ apps/
β βββ backend/ # Express API server
β β βββ src/
β β β βββ controllers/ # API route controllers
β β β β βββ authController.ts
β β β β βββ dnsController.ts
β β β β βββ httpController.ts
β β β β βββ servicesController.ts
β β β β βββ systemMetricsController.ts
β β β β βββ usersController.ts
β β β βββ db/ # Database configuration
β β β βββ lib/ # Utility libraries
β β β βββ middlewares/ # Express middlewares
β β β βββ models/ # Data models
β β β βββ routes/ # API route definitions
β β β βββ types/ # Type definitions
β β βββ drizzle/ # Database migrations
β β βββ test/ # API tests and config files
β βββ ui/ # React frontend application
β βββ src/
β βββ components/ # Reusable UI components
β βββ features/ # Feature-specific components
β β βββ configuration/
β β β βββ dns/
β β β βββ dhcp/
β β β βββ http/
β β βββ dashboard/
β β βββ services/
β βββ hooks/ # Custom React hooks
β βββ lib/ # Frontend utilities and API clients
β βββ pages/ # Page components
βββ packages/
β βββ shared/ # Shared code between apps
β βββ src/
β βββ types/ # TypeScript type definitions
β βββ validators/ # Zod validation schemas
βββ docs/ # Documentation
βββ Configuration files (package.json, turbo.json, etc.)
- Node.js 18+
- pnpm package manager
- Clone the repository:
git clone https://github.com/bernoussama/server-manager.git
cd server-manager- Install dependencies using pnpm workspaces:
pnpm install- Set up environment variables:
# Copy example environment file
cp apps/backend/.env.example apps/backend/.env
# Edit the .env file with your configuration- Set up the database:
# Generate and run database migrations
cd apps/backend
pnpm dlx drizzle-kit generate
pnpm dlx drizzle-kit pushStart all applications in development mode:
# From root directory
pnpm devOr start individual applications:
# Start backend only
cd apps/backend && pnpm dev
# Start frontend only (in a new terminal)
cd apps/ui && pnpm devYour backend API will run at http://localhost:3000 and the UI will be available at http://localhost:5173.
Build all applications:
pnpm buildRun in production mode:
# Start backend
cd apps/backend && pnpm start
# Serve frontend (after building)
cd apps/ui && pnpm previewPOST /api/auth/signup- Register a new userPOST /api/auth/login- Login user
GET /api/services- Get all services statusGET /api/services/:service- Get specific service statusPOST /api/services/:service/start- Start a servicePOST /api/services/:service/stop- Stop a servicePOST /api/services/:service/restart- Restart a service
GET /api/dns/config- Get DNS configurationPUT /api/dns/config- Update DNS configuration
GET /api/http/config- Get HTTP configurationPUT /api/http/config- Update HTTP configurationPOST /api/http/validate- Validate HTTP configurationGET /api/http/status- Get HTTP service statusPOST /api/http/service/:action- Control HTTP service
GET /api/system-metrics- Get system performance metrics
GET /api/users- Get all usersGET /api/users/:id- Get specific userPOST /api/users- Create a userPUT /api/users/:id- Update a userDELETE /api/users/:id- Delete a user
Run tests for the entire monorepo:
pnpm testRun tests for individual applications:
# Backend tests
cd apps/backend && pnpm test
# Frontend tests
cd apps/ui && pnpm test
# Shared package tests
cd packages/shared && pnpm testpnpm dev- Start all applications in development modepnpm build- Build all applicationspnpm test- Run tests for all packagespnpm lint- Lint all packagespnpm format- Format code in all packages
pnpm start- Run production buildpnpm dev- Run development server with hot reloadpnpm build- Build for productionpnpm lint- Run ESLintpnpm format- Format code with Prettierpnpm test- Run Jest tests
pnpm dev- Run development serverpnpm build- Build for productionpnpm preview- Preview production buildpnpm lint- Run ESLintpnpm test- Run Vitest tests
pnpm build- Build shared packagepnpm test- Run testspnpm lint- Run ESLint
The application follows a modern monorepo architecture:
- Turborepo: Manages the monorepo with optimized build caching and task orchestration
- Shared Package: Contains common types, validators, and utilities used by both frontend and backend
- Type Safety: End-to-end type safety with shared TypeScript interfaces
- API-First Design: RESTful API with comprehensive validation using Zod schemas
- Component-Based UI: Modular React components with feature-based organization
The backend includes Docker support:
# Build Docker image
cd apps/backend
docker build -t server-manager-backend .
# Run with Docker
docker run -p 3000:3000 server-manager-backendContributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the GPLv3 License.
Project Link: https://github.com/bernoussama/server-manager

