A modern homeserver application with Go backend and SvelteKit fro cd frontend && pnpm dev # or npm run dev
## API Endpointsroject Structure
├── backend/ # Go API server │ ├── main.go # Main server file │ ├── go.mod # Go dependencies │ └── go.sum # Go dependency checksums ├── frontend/ # SvelteKit web application │ ├── src/ # Source files │ │ ├── routes/ # SvelteKit routes │ │ ├── lib/ # Components and utilities │ │ │ └── components/ # Svelte components │ │ └── app.html # HTML template │ ├── package.json # Node dependencies │ ├── pnpm-lock.yaml # Package lock file │ ├── svelte.config.js # SvelteKit configuration │ ├── tsconfig.json # TypeScript configuration │ └── vite.config.ts # Vite configuration ├── .env.example # Environment variables template ├── .gitignore # Git ignore rules ├── CONTRIBUTING.md # Development guidelines ├── LICENSE # MIT License ├── Makefile # Development automation └── README.md # This file
## Features
- 🏠 **System Monitoring Dashboard** - Real-time system information
- 📊 **Resource Usage Statistics** - CPU, memory, and disk usage
- 🔧 **Service Management** - View running services and their status
- 📁 **File Browser** - Navigate your server's file system
- 🌐 **Network Monitoring** - Track network usage and connections
- 🔒 **Secure API** - CORS-enabled REST API
- 📱 **Responsive Design** - Works on desktop and mobile
- 🌙 **Dark Mode Support** - Automatic dark/light theme switching
## Quick Start
### Option 1: Using Make (Recommended)
1. **Setup the project**:
```bash
make setup
Start development servers:
make dev
Access the application:
Install dependencies:
# Backend
cd backend && go mod tidy
# Frontend
cd frontend && pnpm install # or npm install
Start the Backend:
cd backend
go run main.go
Start the Frontend (in a new terminal):
cd frontend
pnpm dev # or npm run dev
make docker-up
# or manually:
# docker-compose up
Endpoint | Method | Description |
---|---|---|
/api/health |
GET | Health check and server status |
/api/system |
GET | Complete system information |
/api/services |
GET | List of running services |
/api/files |
GET | File browser (supports ?path= parameter) |
/api/network |
GET | Network usage statistics |
// GET /api/system
{
"hostname": "homeserver",
"platform": "linux",
"os": "Ubuntu 22.04",
"architecture": "amd64",
"cpu_count": 4,
"memory": {
"total": 8589934592,
"used": 2147483648,
"used_percent": 25.0
},
"cpu": {
"usage_percent": [15.2, 18.7, 12.1, 20.3],
"cores": 4
}
}
make help # Show all available commands
make dev # Start both backend and frontend
make install # Install all dependencies
make build # Build for production
make test # Run tests
make lint # Run linters
make clean # Clean build artifacts
backend/main.go
frontend/src/lib/components/
See CONTRIBUTING.md for detailed development guidelines.
make build
Build the frontend:
cd frontend && pnpm build
Build the backend:
cd backend && go build -o homeserver main.go
Copy .env.example
to .env
and configure:
PORT
: Backend server port (default: 8080)GIN_MODE
: Gin framework mode (debug/release)CORS_ORIGINS
: Allowed CORS originsVITE_API_URL
: Frontend API endpointENABLE_FILE_BROWSER
: Enable/disable file browserSee .env.example
for all available options.
The backend is configured to allow requests from:
http://localhost:5173
(Vite dev server)http://localhost:3000
(Alternative dev port)go mod tidy
pnpm install
We welcome contributions! Please see CONTRIBUTING.md for development guidelines, setup instructions, and coding standards.
This project is licensed under the MIT License - see the LICENSE file for details.