Cline rules
.clinerules/project-overview.mdCline rules
Quality
73/100
Scores the file, not the repository.Length
679 words
11 headings · 1 code blocksRepository
0
— · pushed 24 days agoLast changed
2 days ago
First indexed 2 days ago.1## Brief overview2This file contains guidelines for developing on the **PureCore** project — a full-stack Go web framework using GoFiber v3 + PostgreSQL (backend) and Bun + Vite + Vue 3 + TailwindCSS + DaisyUI (frontend).34## Project architecture5- Backend entry: `main.go` → Cobra CLI (`cmd/`) → GoFiber v3 server6- Core layer (`core/`) provides: database singleton, request/response wrappers, router builder, JWT middleware helpers, language manager, migration runner7- Routes defined in `routes/api.go` using Laravel-style chaining: `Prefix → Middleware → Group`8- Models in `app/Models/` embed `core.Model` (ID, CreatedAt, UpdatedAt, DeletedAt)9- Controllers in `app/Http/Controllers/` use `core.H()` wrapper that auto-injects `*core.Request` and `*core.Response`10- Frontend entry: `web/` — Vite SSR with `server.js` as the Node/Bun SSR server11- Shared translations in `lang/` (used by both Go backend and Vue frontend)1213## Database and migrations14- All database schema changes MUST be done via migration files only15- Use `purecore make:migration <name>` to generate a new migration file in `database/migrations/`16- Never modify existing migration files — always create new ones17- Migrations are registered via `init()` and tracked in a `migrations` table in the database18- Models should extend `core.Model` for consistent base fields1920## Frontend layout rules21- All admin pages after login MUST use `AdminLayout`/`AdminNavbar` — never use the public-facing `Navbar.vue`22- Admin pages include: AdminDashboard, AdminSettings, and any future pages under the `/{admin}/` route prefix23- Public pages (HomePage, NotFound, etc.) use `Navbar.vue` + `Footer.vue`24- Login and Register pages use the public `Navbar.vue` + `Footer.vue` — they are NOT standalone pages2526## Frontend conventions27- Vue 3 with `<script setup>` syntax and Composition API28- Styling: TailwindCSS 4 utility classes + DaisyUI 5 component classes29- Routing: Vue Router 5 with SSR (memory history on server, web history on client)30- State management: Vue composables (`web/src/composables/`)31- API calls: proxy `/api` to backend (port 9002) via Vite dev server or SSR server32- Environment variables: `VITE_ADMIN_ROUTE_PREFIX` for admin route prefix3334## CLI commands (code generation)35- `purecore serve` — start the HTTP server36- `purecore migrate` — run pending migrations37- `purecore make:model <Name>` — create a GORM model38- `purecore make:controller <Name>` — scaffold a CRUD controller39- `purecore make:migration <name>` — create a timestamped migration file4041## Migration and model/controller synchronization42- When creating a new migration file, you MUST also create or update the corresponding model and controller43- Migration → Model → Controller should always stay in sync44- For example: creating a `create_web_options_table` migration means also creating `WebOption` model and `OptionController` with CRUD endpoints45- New models embed `core.Model` for consistent ID, timestamps, and soft delete fields4647## Response format48All API endpoints return JSON in this shape:49```json50{ "code": 0, "message": "success", "data": ... }51```52Error responses: `{ "code": 4xx/5xx, "message": "error description" }`53Paginated responses include: `total`, `page`, `per_page` alongside `data`5455## SEO (Search Engine Optimization)56- `web/src/composables/useSEO.js` provides a Vue composable for setting page-level SEO meta tags57- `useSEO({ title, description, keywords })` sets `<title>`, `<meta name="description">`, and `<meta name="keywords">` tags58- Title format: `"Page Title - Site Name"` or just `"Site Name"` if page title is empty59- Site name, description, and keywords are loaded from admin options (`site_name`, `site_description`, `site_keywords`) via `initSEO()`60- `initSEO()` is called in `web/src/main.js` at app startup alongside `initI18n()`61- SSR meta tags are injected in `web/server.js` using project info from `web/package.json` — placeholders `<!--seo-title-->`, `<!--seo-description-->`, `<!--seo-keywords-->` in `web/index.html` are replaced at render time62- Every page component should call `useSEO()` with page-specific title and description6364## Authentication65- Admin routes use JWT with access token (15 min) + refresh token (7 days)66- Admin route prefix is configurable via `ADMIN_ROUTE_PREFIX` env var67- `AdminAuth` middleware verifies the token and checks `token_version` for invalidation68- `useAuth.js` composable handles client-side token management and auto-refresh6970## Language / i18n71- Backend loads translations from `lang/` directory (JSON files, nested structure)72- Frontend i18n module loads translations via `/lang/{locale}.json` (proxied from `web/public/lang/`)73- Cookie `purecore-locale` persists user language choice across requests74- Both sides flatten nested JSON to `"group.key"` format75
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bashdeban/fastmind.clinerules/.project-consistency-keeper2.md · 5 | Cline rules | setupbuildtestlint-format+11 | 100/100 | 3 days ago | |
| JCodesMore/ai-website-cloner-template.clinerules · 31k | Cline rules | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| BryaanF/LiantPortfolio.clinerules/project-guidelines.md · 0 | Cline rules | buildstylearchgit+2 | 96/100 | 3 days ago | |
| VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1 | Cline rules | setuparchtypesdo-not | 93/100 | yesterday | |
| cline/cline.clinerules/general.md · 66k | Cline rules | setupbuildstylearch+2 | 86/100 | 3 days ago | |
| cline/cline.clinerules/debug-harness.md · 66k | Cline rules | buildtesttesting-strategysecurity+1 | 85/100 | 3 days ago | |
| blendsdk/appscaffold.clinerules/project.md · 1 | Cline rules | buildteststylearch+3 | 84/100 | 3 days ago | |
| KiralyAlparCsaba/Sapi3D.clinerules/common_tasks.md · 0 | Cline rules | setupbuildtestdatabase+3 | 82/100 | 2 days ago |
