docs: update project structure and usage in docs

Revamps AGENTS.md and README.md to reflect the new Astro/Tailwind app
structure, replacing legacy Python generator references. Adds details on
locales, route manifest, build/test commands, and contributor
guidelines.
Clarifies folder usage, i18n, forms, analytics, and phase plan. Removes
obsolete instructions and aligns documentation with current development
practices.
This commit is contained in:
Ruidy 2025-09-05 14:35:35 -04:00
parent 38452ed5ca
commit 2e9aa1dc31
2 changed files with 54 additions and 66 deletions

View file

@ -2,56 +2,47 @@
## Project Structure & Modules
- `lib/`: static site generator code — `main.py` (entry point), `config.py`, `engine.py`.
- `pages/`: Jinja templates; layouts live in `pages/layouts/`.
- `data/`: page data in TOML; file name must match the template
(e.g., `index.toml``index.html`).
- `assets/`: static files copied asis (`css/`, `js/`, `images/`, `webfonts/`).
- `dist/`: build output (generated, can be deleted/rebuilt).
- `config.toml`: required; at minimum `name = "VillaFleurie"`.
- `src/`: Astro app — `pages/` (locale folders: `fr/`, `en/`), `layouts/`, `styles/`.
- `src/i18n/routes.ts`: central route manifest (`hrefFor`, `siblingPath`) for FR/EN slugs.
- `public/`: static assets and redirects (`_redirects`, `assets/images`, `webfonts`, etc.).
- `docs/spec/website-revamp-spec.md`: product/UX spec and release plan (source of truth).
- Legacy: `lib/`, `pages/`, `data/` (Python generator) — deprecated; do not modify.
## Build, Test, and Development
- `make build`: renders templates into `dist/` (`pipenv run python -m lib.main`).
- `make run`: builds then serves `dist/` via `http.server`.
- `make lint`: format (`black`), lint/fix (`ruff`), and typecheck (`mypy`).
- Direct run: `pipenv run python -m lib.main`.
- Setup: `pipenv install --dev` (Python 3.11).
- Setup: `corepack enable && pnpm i` (uses `pnpm@10`).
- Dev server: `pnpm dev` (Astro). Build: `pnpm build`. Preview: `pnpm preview`.
- Deploy: Netlify (static). Redirects in `public/_redirects` (root → `/fr/`).
- Analytics: Plausible (`plausible("event", {props})`).
## Coding Style & Naming
## Coding Style & Conventions
- Python: formatted by `black` (120 cols), imports via `isort` (black profile),
linted by `ruff`; type hints required (`mypy` with `disallow_untyped_defs`).
- Templates: Jinja; use inheritance with `pages/layouts/`. Prefer kebabcase
filenames (e.g., `t3-azur.html`).
- Data files: TOML mirroring template names (e.g., `t3-azur.toml`). Keep keys lower_snake_case.
- Modules: snake_case for Python files and identifiers.
- UI: Tailwind CSS v4 (brand tokens: `--color-brand`, `--color-brand-600`).
- Icons: `lucide-astro` inline SVGs; use `text-brand` for accent.
- JS: vanilla only (no jQuery). Prefer lightweight patterns (e.g., scrollBy carousels).
- i18n: use `hrefFor()` and `siblingPath()` for all internal links and language toggles.
- Content slugs differ by locale (e.g., FR `avis` ↔ EN `reviews`) — never hardcode.
## Testing Guidelines
- No formal test suite. Validate changes by:
- Running `make lint` and fixing all issues.
- Building with `make build` and visually checking pages in `dist/` (`make run`).
- Verifying the correct data file is picked up for each template.
- Sanity: `pnpm build` must succeed. Then `pnpm preview` for visual QA.
- Check: FR/EN toggles, redirects (`/ → /fr/`), forms (Netlify), and analytics events.
- Accessibility: keyboard nav for mobile menu; color contrast for brand accents.
## Commit & Pull Requests
- Use Conventional Commits (seen in history):
- Examples: `refactor(html): modernize header markup`,
`feat(engine): add file watching`.
- PRs must:
- Pass `make lint` and build cleanly.
- Include a clear description, linked issues, and affected pages/files.
- Add screenshots of visual changes (before/after) where relevant.
- Stay focused and small; avoid mixed concerns.
- Conventional Commits (examples): `feat(home): hero CTA`, `fix(i18n): toggle sibling path`.
- PRs should include: build passing, screenshots (FR/EN), and spec updates when needed.
- Keep focused and small; avoid mixing refactors with features.
## Revamp Spec & Branch
## Revamp Spec & Phases
- Active branch: `revamp/website-spec`.
- Source of truth: `docs/spec/website-revamp-spec.md` (keep updated in PRs).
- Align changes to the agreed sitemap and CTAs defined in the spec.
- Branch: `revamp/website-spec`. Spec: `docs/spec/website-revamp-spec.md`.
- Phase 1 (current): FR core pages, inquiry form, i18n scaffolding.
- Phase 2: EN pages + gallery, translated reviews.
- Phase 3: Policies, analytics KPIs, performance polish (WebP/srcset, Lighthouse).
## Configuration Tips
## Notes
- Ensure `config.toml` exists at repo root; build fails without it.
- Do not commit generated `dist/` output.
- Do not commit `dist/`. Assets live in `public/assets/...`.
- Use the route manifest for any new pages/links; add entries for new slugs.

View file

@ -1,42 +1,39 @@
# Astro Starter Kit: Minimal
# VillaFleurie Website (Astro + Tailwind)
```sh
npm create astro@latest -- --template minimal
```
This site is built with Astro and Tailwind, with FR/EN locales. The legacy Python generator remains for reference but is deprecated — new work happens in `src/`.
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
## Quick Start
## 🚀 Project Structure
- Requirements: Node 18+, Corepack enabled (`pnpm`). Then:
- `corepack enable`
- `pnpm install`
- Dev server: `pnpm dev` → open `http://localhost:4321/fr/` (root redirects to `/fr/`).
- Build: `pnpm build` → static output in `dist/`. Preview: `pnpm preview`.
Inside of your Astro project, you'll see the following folders and files:
## Structure
```text
/
├── public/
├── src/
│ └── pages/
│ └── index.astro
└── package.json
```
- `src/pages/fr|en/`: localized pages (Home, Apartments, Reviews, Rates, Contact, Policies).
- `src/layouts/`: shared layout with sticky header, language toggle, footer.
- `src/styles/global.css`: Tailwind v4 with brand tokens (`--color-brand`, `--color-brand-600`).
- `src/i18n/routes.ts`: route manifest (`hrefFor`, `siblingPath`, `navFor`).
- `public/`: static assets + `_redirects` (root → `/fr/`).
- Spec: `docs/spec/website-revamp-spec.md` (goals, sitemap, copy, release plan).
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
## i18n & Navigation
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
- Folder-based locales with different slugs (e.g., FR `avis` ↔ EN `reviews`).
- Always use the route helpers for links and the language toggle; dont hardcode crosslocale paths.
Any static assets, like images, can be placed in the `public/` directory.
## Forms & Analytics
## 🧞 Commands
- Netlify Forms on `/fr/contact/` and `/en/contact/`, with localized thankyou pages.
- Plausible events: `booking_request_submitted` (primary), `click_airbnb`, `click_booking`, etc.
All commands are run from the root of the project, from a terminal:
## Contributing
| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |
- Use Conventional Commits. Include screenshots (FR/EN) for UI changes.
- Keep the spec updated when requirements change.
- See `AGENTS.md` for contributor guidelines and the current phase plan.
## 👀 Want to learn more?