Application Scaffolding - acdc-digital/soloist_pro GitHub Wiki
graph TD
root["soloist_pro-monorepo"]
root --> convex["convex/"]
root --> electron["electron/"]
root --> renderer["renderer/"]
root --> website["website/"]
-
Monorepo Root
-
Workspace Declaration
Hostspnpm-workspace.yaml
, which registers the four primary workspaces (convex
,electron
,renderer
,website
). -
Shared Scripts & Dependencies
The rootpackage.json
defines shared development scripts (dev:convex
,dev:renderer
,dev:electron
,dev:website
), hoists theconvex
SDK as a dependency, and centralizes linting via Trunk. -
Global Configuration
Files liketrunk.yaml
and.gitignore
live at the root to enforce consistent lint rules and ignore patterns across all sub-projects.
-
Workspace Declaration
-
convex/
-
Backend Definition
Contains Convex schema definitions (schema.ts
), and query/mutation handlers (logs.ts
,forecasts.ts
). -
Configuration
convex.json
points at"functions": "."
, and.env.local
holdsCONVEX_DEPLOYMENT
andCONVEX_URL
for seamless local development (pnpm run dev:convex
). -
Modern API
Upgraded to Convex v1.x, enabling streamlined imports (defineSchema
,defineTable
,v
).
-
Backend Definition
-
electron/
-
Desktop Shell
Housesmain.js
, which creates an ElectronBrowserWindow
pointing tohttp://localhost:3000
in development or bundled renderer assets in production. -
Dependency & Scripts
The workspace’spackage.json
declareselectron
as a dependency and provides thedev
script (electron .
) for rapid iteration.
-
Desktop Shell
-
renderer/
-
Next.js Application
A standalone Next.js 15 app that powers the core UI, rendered inside the Electron shell. Supports the App Router or Pages Router pattern as configured. -
Project Structure
Organized intosrc/app/
(orpages/
), with supporting directories forlib/
,hooks/
, andstore/
(Zustand). -
Data Integration
Imports Convex bindings fromconvex/_generated/api.ts
and leveragesuseQuery
/useMutation
for real-time data flows.
-
Next.js Application
-
website/
-
Marketing & Signup
A separate Next.js project dedicated to public-facing landing pages, pricing, and signup flows. -
Port Isolation
Runs on its own port (e.g.,3002
) to prevent conflicts with the renderer’s dev server. -
Content & Components
Static assets inpublic/
, marketing pages inpages/
, and reusable UI components undercomponents/
.
-
Marketing & Signup
-
Isolation & Sharing
Each workspace maintains its own dependencies, build scripts, and configuration, yet shares core libraries (e.g., the Convex SDK) through root-level hoisting. -
Consistent Tooling
Trunk enforces a unified linting strategy (pnpm run lint
), and TypeScript checks are centralized (pnpm run typecheck
). -
Streamlined Development
Four intuitive root commands (pnpm run dev:<workspace>
) spin up each service independently—no more context-switching or manual port management. -
Scalability & Maintenance
Adding features follows a repeatable pattern: introduce new files or folders in the appropriate workspace, update itspackage.json
if needed, and the monorepo tooling handles the rest.
This scaffolding strikes a balance between modularity and cohesion, enabling efficient development, smooth CI/CD pipelines, and simplified cross-workspace refactoring.
Directory | Purpose | Key Files & Configs | Root Dev Command |
---|---|---|---|
convex/ |
Convex DB backend: schema + function handlers |
convex.json , schema.ts , logs.ts , .env.local
|
pnpm --filter soloist_pro-convex dev |
electron/ |
Desktop shell: wraps the renderer in Electron |
main.js , preload.js (if used), package.json
|
pnpm --filter soloist_pro-electron dev |
renderer/ |
Next.js app rendered inside Electron |
next.config.js , src/app/ , lib/ , store/
|
pnpm --filter soloist_pro-renderer dev |
website/ |
Public-facing Next.js landing & marketing site |
next.config.js , public/ , pages/ , components/
|
pnpm --filter soloist_pro-website dev |
root | Monorepo orchestration & shared config |
pnpm-workspace.yaml , package.json , trunk.yaml , README.md
|
pnpm run dev:convex pnpm run dev:renderer pnpm run dev:electron pnpm run dev:website
|