|
1 | 1 | # Stack Craft |
2 | 2 |
|
3 | | -Example web app with common type API definitions, a FuryStack-based backend service and a Shades-based single page application. |
| 3 | +A web application for managing development stacks, services, prerequisites, and repositories. Built with a [FuryStack](https://github.com/furystack/furystack) backend and a [Shades](https://github.com/furystack/furystack/tree/develop/packages/shades)-based single page application. |
4 | 4 |
|
5 | | -# Usage |
| 5 | +## Features |
6 | 6 |
|
7 | | -1. Clone the repository |
8 | | -1. Install the dependencies with `yarn` |
9 | | -1. Start PostgreSQL (e.g. `docker compose up -d`) |
10 | | -1. Copy `.env.example` to `.env` and adjust if needed |
11 | | -1. Start the frontend and the backend service with `yarn start` (you can stop / start them individually, check the NPM scripts for further details) |
| 7 | +- **Stack management** -- group related services, repositories, and prerequisites into stacks |
| 8 | +- **Service lifecycle** -- start, stop, restart, build, and install services with real-time log streaming |
| 9 | +- **Prerequisite checks** -- define and evaluate system prerequisites before running services |
| 10 | +- **Repository integration** -- clone and manage GitHub repositories with branch switching |
| 11 | +- **Environment variables** -- manage per-stack and per-service environment configuration with encrypted secrets |
| 12 | +- **Import / Export** -- share stack configurations across environments |
| 13 | +- **MCP server** -- interact with Stack Craft via [Model Context Protocol](https://modelcontextprotocol.io/) for AI assistant integration |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +- [Node.js](https://nodejs.org/) >= 22 |
| 18 | +- [Yarn](https://yarnpkg.com/) 4 (included via `packageManager` in `package.json`) |
| 19 | +- [Docker](https://www.docker.com/) (for PostgreSQL, or provide your own instance) |
| 20 | + |
| 21 | +## Getting Started |
| 22 | + |
| 23 | +```bash |
| 24 | +# Clone and install |
| 25 | +git clone https://github.com/furystack/stack-craft.git |
| 26 | +cd stack-craft |
| 27 | +yarn |
| 28 | + |
| 29 | +# Start PostgreSQL |
| 30 | +docker compose up -d |
| 31 | + |
| 32 | +# Create your environment file |
| 33 | +cp .env.example .env |
| 34 | + |
| 35 | +# Start the backend and frontend |
| 36 | +yarn start:service # Backend on http://localhost:9090 |
| 37 | +yarn start:frontend # Frontend on http://localhost:8080 |
| 38 | +``` |
| 39 | + |
| 40 | +Open http://localhost:8080 in your browser. On first launch, the installer wizard will guide you through creating an admin account. |
| 41 | + |
| 42 | +## Configuration |
| 43 | + |
| 44 | +Environment variables can be set in the `.env` file at the project root. |
| 45 | + |
| 46 | +| Variable | Default | Description | |
| 47 | +| ---------------------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- | |
| 48 | +| `DATABASE_URL` | `postgres://stackcraft:stackcraft@localhost:5433/stackcraft` | PostgreSQL connection string | |
| 49 | +| `APP_SERVICE_PORT` | `9090` | Backend HTTP server port | |
| 50 | +| `MCP_PORT` | `9091` | MCP server port | |
| 51 | +| `STACK_CRAFT_ENCRYPTION_KEY` | *(auto-generated)* | Base64-encoded 256-bit key for encrypting sensitive values. If unset, a key file is created in `~/.stack-craft/` | |
12 | 52 |
|
13 | 53 | ## Docker |
14 | 54 |
|
15 | | -When running the Docker image, pass the `DATABASE_URL` environment variable: |
| 55 | +Build and run the Docker image: |
16 | 56 |
|
17 | 57 | ```bash |
18 | | -docker run -e DATABASE_URL=postgres://user:password@host:5433/stackcraft furystack/stack-craft |
| 58 | +docker build -t stack-craft . |
| 59 | + |
| 60 | +docker run -p 9090:9090 \ |
| 61 | + -e DATABASE_URL=postgres://user:password@host:5432/stackcraft \ |
| 62 | + stack-craft |
19 | 63 | ``` |
20 | 64 |
|
21 | | -# Testing |
| 65 | +The pre-built image is also available on Docker Hub: |
| 66 | + |
| 67 | +```bash |
| 68 | +docker run -p 9090:9090 \ |
| 69 | + -e DATABASE_URL=postgres://user:password@host:5432/stackcraft \ |
| 70 | + furystack/stack-craft |
| 71 | +``` |
| 72 | + |
| 73 | +## Project Structure |
| 74 | + |
| 75 | +``` |
| 76 | +stack-craft/ |
| 77 | +├── common/ # Shared API type definitions and models |
| 78 | +├── frontend/ # Shades-based SPA (Vite) |
| 79 | +├── service/ # FuryStack REST backend (Node.js) |
| 80 | +└── e2e/ # Playwright end-to-end tests |
| 81 | +``` |
| 82 | + |
| 83 | +## Testing |
| 84 | + |
| 85 | +```bash |
| 86 | +# Unit tests (Vitest) |
| 87 | +yarn test |
| 88 | + |
| 89 | +# End-to-end tests (requires running PostgreSQL + DATABASE_URL) |
| 90 | +yarn test:e2e |
| 91 | +``` |
| 92 | + |
| 93 | +## Available Scripts |
| 94 | + |
| 95 | +| Script | Description | |
| 96 | +| --------------------- | --------------------------------------------- | |
| 97 | +| `yarn start:service` | Start the backend service | |
| 98 | +| `yarn start:frontend` | Start the Vite dev server for the frontend | |
| 99 | +| `yarn build` | Build all packages | |
| 100 | +| `yarn test` | Run Vitest unit tests | |
| 101 | +| `yarn test:e2e` | Run Playwright E2E tests | |
| 102 | +| `yarn lint` | Run ESLint | |
| 103 | +| `yarn format` | Format code with Prettier | |
| 104 | +| `yarn create-schemas` | Regenerate JSON schemas from TypeScript types | |
| 105 | + |
| 106 | +## License |
22 | 107 |
|
23 | | -- You can execute the example Vitest tests with `yarn test` |
24 | | -- You can execute E2E tests with `yarn test:e2e` (requires a running PostgreSQL instance and `DATABASE_URL` set) |
| 108 | +[GPL-2.0-only](LICENSE) |
0 commit comments