mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-20 17:02:53 -04:00
ArtCraft Desktop (fresh start)
This is a fresh start for the `artcraft` repo. The old monorepo, which included our web API gateway, job services, SRE tools, various frontends, and more has moved to `artcraft-services` You can find the full git history here: https://github.com/storytold/artcraft-services This change was motivated by the fact that the entire git history was hundreds of gigabytes in size, which is unwieldy for anyone not in the core team that doesn't care about support services outside of the core artcraft app. We wanted to keep this repo in its well-known place since we already have users and activity here. Please update your remotes to either `artcraft-services` or make a fresh clone of this repo. History can be found at the artcraft-services repo.
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
# AGENTS.md
|
||||
|
||||
This file provides guidance for coding agents when working with the Artcraft monorepo.
|
||||
|
||||
## Project Overview
|
||||
|
||||
Artcraft is a public-facing Tauri desktop app for generating AI images and video.
|
||||
It uses Rust and TypeScript. Backend services, company tooling, and website builds
|
||||
live in the separate `artcraft-services` repository.
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
artcraft/
|
||||
├── _database/sql/artcraft_migrations/ # Embedded SQLite task database migrations
|
||||
├── .sqlx/ # SQLite query metadata for offline builds
|
||||
├── crates/
|
||||
│ ├── desktop/artcraft/ # Tauri app, configuration, capabilities, icons
|
||||
│ ├── api_clients/ # Desktop provider clients and shared API types
|
||||
│ ├── lib/ # Desktop support libraries
|
||||
│ ├── schema/database/sqlite_tasks/ # Desktop task persistence
|
||||
│ ├── schema/public/ # Shared wire-format enums and identifiers
|
||||
│ ├── testing/ # Shared test helpers
|
||||
│ └── vendor/tauri-plugin-http/ # HTTP plugin fork with cookie access
|
||||
├── frontend/
|
||||
│ ├── apps/artcraft/ # Tauri app frontend and public resources
|
||||
│ └── libs/ # Shared frontend libraries
|
||||
├── script/artcraft/ # Desktop development and build scripts
|
||||
├── test_data/ # Fixtures used by retained crate tests
|
||||
└── Cargo.toml # Desktop dependency workspace
|
||||
```
|
||||
|
||||
Keep `external/` and `secrets/` untouched. Repository pruning must preserve
|
||||
untracked and ignored local files; delete only Git-tracked paths unless the user
|
||||
explicitly authorizes a cache cleanup.
|
||||
|
||||
## Code Style
|
||||
|
||||
- Rust with no minimum supported version
|
||||
- SQLx for SQLite; prefer `sqlx::query!` / `sqlx::query_as!` compile-time checked macros over runtime `sqlx::query()` whenever possible
|
||||
- A mix of wreq and reqwest for Rust HTTP clients
|
||||
- Never use `println!` or `eprintln!` outside of tests; use `log` crate macros instead
|
||||
- When two crates export the same type name, alias imports with a suffix: `use foo::Bar as BarFoo;`
|
||||
- Prefer `use` imports over inline fully-qualified paths; only qualify inline for true one-offs or std collisions
|
||||
- TypeScript with Nx, React, Vite, Zustand, and Three.js
|
||||
- Use two spaces for indentation
|
||||
|
||||
### File Layout
|
||||
|
||||
Organize for top-to-bottom reading. Important things first, details later.
|
||||
|
||||
- **Constants** at the top (after imports)
|
||||
- **Structs/enums** next; outer structs above inner sub-structs
|
||||
- **API types** in order: Request, Response, Error
|
||||
- **In impl blocks**: constructors first, then public methods, then private helpers
|
||||
- Private helpers go *below* the methods that call them
|
||||
- Among helpers: meatier logic above leaf-level formatters
|
||||
- **In test modules**: constants first, then test cases (grouped into sub-modules when 2+), then helper functions last
|
||||
|
||||
## Markdown
|
||||
|
||||
- **Tables must be space-padded so columns align in plain text.** Markdown
|
||||
tables are read raw (terminals, diffs, editors) at least as often as
|
||||
rendered, and condensed tables are unreadable there. Pad every cell to its
|
||||
column width:
|
||||
|
||||
```markdown
|
||||
| Model | Configuration | Credits | Speed | Score |
|
||||
|--------------|---------------|--------------------|---------|
|
||||
| Meshy 6 | text or image | 104 | 80.0 | +24 |
|
||||
| Rodin 2.5 | text or image | 13 | 10.0 | +3 |
|
||||
```
|
||||
|
||||
Not: `| Model | Configuration | Credits | Speed | Score |` packed tight
|
||||
with varying widths per row.
|
||||
Reference in New Issue
Block a user