Project Structure
DeploySolo starter projects (like examples/todo/) use a clean, modular layout to separate concerns: backend logic, frontend assets, and runtime files. This makes it easy to extend features while keeping the app lightweight.
Here’s the typical structure:
Key Folders and Files
- your_app_package/: Your custom backend code. Organize by feature (e.g., todo.go for routes, handlers, and models). Import DeploySolo packages here for middleware, rendering, etc. See Creating Pages and htmx Routes and Backend Handlers with Database.
- main.go: Initializes PocketBase, loads templates, registers routes and packages (e.g., payment, github). Customize to add more features. See main.go.
- migrations/: Auto-generated by PocketBase for DB setup. Add your own for schema changes.
- web/: Frontend files.
- public/: Static assets served at /public/. Symlinks in the repo point to shared/ for reuse; they become copies when you duplicate an example.
- templates/: Go HTML templates. Pages are full HTML; partials are reusable snippets. Use htmx attributes for interactivity. See Working with Templates and Web Templates, Assets, and Scripts.
To start your app, copy an example folder (e.g., examples/todo/) to a new directory. This resolves symlinks to actual files. Add your features by extending app/, templates/, and main.go.
This setup gets you coding fast—backend and frontend in one repo, no complex builds.