47 lines
1.9 KiB
Markdown
47 lines
1.9 KiB
Markdown
|
|
# Spark Project Overview
|
||
|
|
|
||
|
|
## Project Purpose
|
||
|
|
Spark is a comprehensive tool for maintaining and configuring servers, integrating with Docker and supporting advanced task scheduling, targeted at the Servezone infrastructure and used by @serve.zone/cloudly as a cluster node server system manager.
|
||
|
|
|
||
|
|
## Tech Stack
|
||
|
|
- **Language**: TypeScript
|
||
|
|
- **Runtime**: Node.js (currently)
|
||
|
|
- **Package Manager**: pnpm
|
||
|
|
- **Build Tool**: @git.zone/tsbuild
|
||
|
|
- **Test Framework**: @git.zone/tstest with @push.rocks/tapbundle
|
||
|
|
- **CLI Framework**: @push.rocks/smartcli
|
||
|
|
- **Version**: 1.2.2
|
||
|
|
|
||
|
|
## Directory Structure
|
||
|
|
```
|
||
|
|
spark/
|
||
|
|
├── ts/ # TypeScript source files
|
||
|
|
├── test/ # Test files (single test.nonci.ts)
|
||
|
|
├── dist_ts/ # Compiled TypeScript output
|
||
|
|
├── cli.js # CLI entry point
|
||
|
|
├── cli.child.ts # Child process CLI
|
||
|
|
├── cli.ts.js # TypeScript CLI wrapper
|
||
|
|
└── package.json # Dependencies and scripts
|
||
|
|
```
|
||
|
|
|
||
|
|
## Key Dependencies
|
||
|
|
- **@serve.zone/api**: API client for Servezone
|
||
|
|
- **@serve.zone/interfaces**: Interface definitions
|
||
|
|
- **@apiclient.xyz/docker**: Docker API client
|
||
|
|
- **@push.rocks/*** packages: Various utilities (smartlog, smartfile, smartcli, smartdaemon, etc.)
|
||
|
|
|
||
|
|
## Main Components
|
||
|
|
1. **CLI** (spark.cli.ts): Command-line interface with commands like installdaemon, updatedaemon, asdaemon
|
||
|
|
2. **Spark** (spark.classes.spark.ts): Main application class
|
||
|
|
3. **TaskManager** (spark.classes.taskmanager.ts): Task scheduling
|
||
|
|
4. **UpdateManager** (spark.classes.updatemanager.ts): Service updates
|
||
|
|
5. **Config** (spark.classes.config.ts): Configuration management
|
||
|
|
|
||
|
|
## Commands
|
||
|
|
- `pnpm build`: Build the TypeScript code
|
||
|
|
- `pnpm test`: Run tests
|
||
|
|
- `spark installdaemon`: Install as system daemon
|
||
|
|
- `spark updatedaemon`: Update daemon service
|
||
|
|
- `spark asdaemon`: Run as daemon
|
||
|
|
- `spark logs`: View daemon logs
|
||
|
|
- `spark prune`: Clean up resources
|