Skip to content

NolanBeaujault/server-playground

Repository files navigation

Server Playground

A lightweight API to monitor local or remote server metrics — built with Hono.js, Docker, and TypeScript.


What It Does

Minimal REST API exposing system metrics:

Endpoint Description
/ Health check (confirms server is up)
/metrics Returns uptime, memory usage, CPU load

Stack

  • Hono.js — minimalist web framework for building APIs
  • Node.js 20+ — JavaScript runtime
  • TypeScript — type-safe modern JavaScript
  • Docker — containerized local development
  • Docker Compose — orchestration of local services
  • Nodemon + ts-node — automatic reload on file change during development

Development Setup

Clone the repository

git clone https://github.com/NolanBeaujault/server-playground.git
cd server-playground

Install dependencies

npm install

Run locally without Docker

npm run dev

Run using Docker Compose

docker compose up --build

The application will be accessible on localhost:3000


File Structure (Current)

server-playground/
│
├── src/
│   └── index.ts           # API entrypoint
│
├── Dockerfile             # Dev-oriented Dockerfile
├── docker-compose.yml     # Container orchestration
├── .env                   # Local environment variables (e.g., port)
├── package.json           # Project metadata and scripts
├── tsconfig.json          # TypeScript configuration

Features to Build Next

This section tracks upcoming improvements.

  • Add persistent logging (e.g., Winston or Pino)
  • Export metrics in Prometheus-compatible format
  • Add authentication for /metrics endpoint
  • Add system details per endpoint (/cpu, /ram, etc.)
  • Add dashboard frontend to visualize metrics
  • Prepare production-ready Dockerfile and multi-stage build

Why This Exists

This project serves as a personal playground to:

  • Practice building minimal web APIs
  • Get familiar with Docker/Docker Compose workflows
  • Explore performance monitoring and containerized development
  • Iterate with clean, scalable architecture from day one

How to Contribute

You're welcome to fork the project, explore, or submit improvements:

  1. Fork this repo
  2. Create a new branch (git checkout -b feature/your-feature)
  3. Make your changes
  4. Push to your branch (git push origin feature/your-feature)
  5. Open a pull request

License

MIT — free to use, remix, and distribute.


Badges

Node.js Docker MIT License CI

About

Monitoring tool for local containers and services (CPU, RAM, uptime...) with REST API and optional web/CLI interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors