A modern monorepo built with Turborepo, Bun, and Biome for managing Docker container statistics and monitoring.
- Monorepo: Turborepo
- Runtime: Bun
- Linting & Formatting: Biome
- TypeScript: Strict configuration
- Apps: React Router, Node.js applications
- Packages: Shared utilities, database layer, and types
dockstat/
βββ apps/
β βββ dockstat/ # Frontend (React Router)
β βββ dockstore/ # Community made themes, stacks and plugins
β βββ docs/ # Documentation sync with Outline Wiki
βββ packages/
β βββ db/ # Database layer and models
β βββ outline-sync/ # Bi-directional sync between Git and Outline Wiki
β βββ sqlite-wrapper/ # Type-safe SQLite wrapper
β βββ typings/ # Shared TypeScript types
βββ turbo.json # Turborepo configuration
- Bun >= 1.2.17
- Node.js >= 18 (for some tooling)
-
Clone the repository
git clone https://github.com/Its4Nik/DockStat.git cd DockStat
-
Install dependencies
bun install
-
Set up development environment
# Build all packages bun run build # Start development servers bun run dev
# Development
bun run dev # Start all apps in development mode
bun run build # Build all apps and packages
bun run lint # Lint all packages and apps
bun run lint:fix # Fix linting issues
bun run format # Format all code
bun run format:check # Check formatting
bun run check-types # Type check all packages
bun run clean # Clean all build artifacts
bun run test # Run tests across all packages
Each package and app supports these scripts:
bun run build # Build the package
bun run dev # Start development server
bun run lint # Lint the package
bun run lint:fix # Fix linting issues
bun run check-types # Type check the package
bun run clean # Clean build artifacts
The monorepo uses Turborepo for build orchestration. Configuration is in turbo.json
:
- Build: Dependencies are automatically resolved
- Dev: Persistent development servers
- Lint: No outputs (stateless)
- Test: Depends on build, outputs coverage
Code formatting and linting is handled by Biome. Configuration in biome.json
:
- Formatting: 2-space indentation, 80 character line width
- Linting: Recommended rules with custom overrides
- JavaScript: Single quotes, trailing commas, semicolons
Shared TypeScript configuration in tsconfig.base.json
:
- Module: ESNext
- Target: ESNext
- Strict: Enabled
- Paths: Configured for monorepo packages
- Create a new directory in
apps/
- Add
package.json
with required scripts - Add
tsconfig.json
extending the base config - Update root
package.json
workspaces if needed
- Create a new directory in
packages/
- Add
package.json
with required scripts - Add
tsconfig.json
extending the base config - Update root
package.json
workspaces if needed
Use the @dockstat/
prefix for internal packages:
import { BaseConfig } from '@dockstat/typings';
import { Database } from '@dockstat/db';
import { SQLiteWrapper } from '@dockstat/sqlite-wrapper';
Database layer with models and data access patterns for Docker container statistics.
A TypeScript wrapper around bun:sqlite
with type-safe query building capabilities.
A Bun CLI tool for bi-directional synchronization between Git-backed Markdown files and Outline Wiki collections.
Shared TypeScript type definitions used across all applications and packages.
The project uses Outline Wiki for documentation with bi-directional sync:
- Documentation files are stored in
apps/docs/docs/
- Use
@dockstat/outline-sync
package to sync with Outline Wiki - See
packages/outline-sync/README.md
for sync setup and usage
# Run all tests
bun run test
# Run tests for a specific package
cd apps/dockstat && bun run test
# Build all packages and apps
bun run build
# Build a specific package
cd packages/db && bun run build
Each app can be built and deployed independently:
# Build for production
bun run build
# The built artifacts will be in:
# - apps/dockstat/build/
# - packages/db/dist/
# - packages/outline-sync/dist/
# - packages/sqlite-wrapper/dist/
# - packages/typings/dist/
- Fork the repository
- Create a feature branch
- Make your changes
- Run linting and type checking:
bun run lint && bun run check-types
- Commit your changes
- Push to your branch
- Create a pull request
This project is licensed under the MPL 2.0 License.