mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-04 22:21:21 +09:00
You could not install a database from ServerKit. The tree's four roots were literals, only MySQL and PostgreSQL reported real state, and no install path existed anywhere in the backend. Rather than add one, this makes a database engine an ordinary app template that declares a top-level `engine:` block — family, wire protocol, admin user, which variable holds the password, what it calls a "table". Presence of that block is the only thing that lists a template in the Databases catalog, and installing it is the template pipeline that already existed: same deployment job, same streaming console. The consequence is the point. Adding CockroachDB is adding a YAML file. So is adding something we have never heard of — author it locally or sync a template repo — and the install form still works, because it is generated from the template's own `variables[]` rather than hand-written per engine. There is no engine model, no engine table, no engine install mechanism to keep in step. `test_dropping_a_new_engine_yaml_lists_it` is the design; if it ever needs code to pass, this went wrong. Twelve engines ship: postgresql, mysql, mariadb, mongodb, redis, valkey, cockroachdb, clickhouse, influxdb, neo4j, meilisearch, couchdb. Each pins its image, binds to loopback, names a data volume, and was checked against the upstream image's actual environment contract — a wrong variable name is a container that boots with authentication silently disabled. Two safety notes worth reading. Engines bind 127.0.0.1 unless explicitly exposed, and the flag is applied after caller variables so a handcrafted payload cannot quietly publish one. And CockroachDB single-node runs `--insecure` because password auth needs a certificate-backed cluster: for engines with no credentials at all the loopback bind is the only control, so public exposure is refused outright rather than warned about. A test pins the passwordless list to exactly cockroachdb, so a future template that drops its password variable fails loudly instead of opening a hole. Also surfaced at last: `ManagedDatabase.owner_application_id` has been accepted by the create endpoints for ages with no UI to set it. Creating a database now offers "Attach to application". Deferred deliberately: new-table builder, SQL dump import, engine extensions (pgvector, TimescaleDB) — each a data-mutation surface deserving its own round. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
React Dashboard Template
A modern React dashboard application boilerplate built with Vite, featuring routing, charts, and a sidebar layout for building data-driven web interfaces.
Features
- React 18 with functional components and hooks
- Vite for fast development and building
- React Router for client-side routing
- Recharts for data visualization
- Lucide React for icons
- ESLint for code linting
- Responsive sidebar layout
- Dashboard page with sample components
Getting Started
Prerequisites
- Node.js 16+ and npm
Installation
- Clone or download this template
- Install dependencies:
npm install
Development
Start the development server:
npm run dev
The app will be available at http://localhost:41921.
Building for Production
Build the app for deployment:
npm run build
The output will be in the dist/ directory.
Preview Production Build
npm run preview
Project Structure
src/
├── App.jsx # Main app with routing
├── main.jsx # Entry point
├── index.css # Global styles
├── components/
│ └── Sidebar.jsx # Navigation sidebar
├── layouts/
│ └── DashboardLayout.jsx # Main layout wrapper
└── pages/
└── Dashboard.jsx # Main dashboard page
Customization
- Modify components in
src/components/ - Add new pages in
src/pages/ - Update routes in
App.jsx - Customize styles in
index.cssor component files
Environment Variables
Create a .env file in the root for environment variables:
VITE_API_URL=https://api.example.com
Access them in code via import.meta.env.VITE_API_URL.
Contributing
See the documentation files for AI agent permissions and guidelines.