1. Overview
Chalukya Tiles is a full-stack showroom website for floor tiles and interior tiles. It is designed to feel premium and minimal while remaining fast, maintainable, and free of heavy frontend frameworks.
The backend (FastAPI) renders HTML with Jinja2 and exposes JSON APIs for contact and product enquiries. The frontend is modular CSS and vanilla JavaScript — ideal for a brochure-style business site with light interactivity.
Permanent memory: every development session should update
PROJECT_MEMORY.md in the project root so context survives new chats and handoffs.
2. Why this project is useful
For the business
Presents collections, builds trust with reviews, captures leads in SQLite, and supports WhatsApp/phone conversion paths.
For developers
Clean modular files, no SPA build step, easy deploy with Uvicorn, and a clear path from SQLite to MySQL later.
For performance
Minimal JS, lazy media, CSS variables, and no framework runtime keep pages light on mobile networks.
For SEO & a11y
Semantic HTML, meta tags, sitemap/robots, JSON-LD, ARIA, keyboard navigation, and reduced-motion support.
Compared with a generic page builder site, this codebase is transparent: every animation, form field, and API route is owned by you and can be audited or customized without fighting a theme marketplace.
3. Tech stack
| Layer | Technology | Role |
|---|---|---|
| Backend | Python 3.10+, FastAPI, Uvicorn | Routes, validation, static + HTML serving |
| Templates | Jinja2 | Server-rendered HTML pages |
| Frontend | HTML5, CSS3, Vanilla JS (ES6+) | UI, filters, lightbox, forms |
| Database | SQLite via stdlib + helpers | Contact & enquiry storage |
| Validation | Pydantic v2 | API request models |
| Fonts | Inter + Poppins (Google Fonts) | Premium typography |
Not used (by design): React, Vue, Angular, Bootstrap, jQuery, or heavy UI kits.
4. Architecture
Request flow at a high level:
Design principles
- Server-rendered pages for SEO and first paint simplicity.
- Modular assets — one CSS/JS concern per file.
- Isolated data layer — swap SQLite connection later without rewriting routes.
- Progressive enhancement — content works without heavy JS; JS adds polish and forms.
- Security defaults — nosniff, frame options, referrer and permissions policies.
5. Folder structure
website_tiles1/
├── PROJECT_MEMORY.md # Permanent session memory
├── app.py # FastAPI app, pages, SEO, 404
├── requirements.txt
├── README.md
├── templates/ # HTML (Jinja2)
├── static/css|js|images|videos|icons
├── api/enquiry.py # JSON API routers
├── database/db.py # SQLite schema & helpers
└── assets/ # Non-public brand sources
Public URLs under /static/… map to the static/ folder.
Source design files (logo masters, raw video) belong in assets/, not in the public web root.
6. Features
- Mobile-first responsive layout (Flexbox + CSS Grid)
- Premium theme: white, charcoal, stone grey, warm gold
- Sticky navbar — transparent over hero, solid on scroll / inner pages
- Hamburger drawer with keyboard Escape and focus handling
- Hero video (optional) + typing headline + parallax layer
- Animated counters, scroll reveals, button ripples, loading screen
- Product catalogue with 9 category filters + deep links
- Masonry gallery, lightbox (image/video), keyboard navigation
- Testimonials with star ratings and animated cards
- Contact form + product enquiry with client validation and Fetch API
- SQLite persistence of leads
- Floating WhatsApp + scroll-to-top
- Newsletter UI (client-side thank-you feedback)
- Branded 404 page
robots.txt,sitemap.xml, home JSON-LD
7. Website pages
| URL | Template | Purpose |
|---|---|---|
/ | index.html | Hero, featured products, why us, collections, gallery preview, reviews, location, CTA |
/about | about.html | Story, mission, vision, timeline, achievements |
/products | products.html | 18 products across 9 categories with filters |
/gallery | gallery.html | Masonry media + lightbox + videos |
/testimonials | testimonials.html | Ratings summary + review cards |
/contact | contact.html | Map, hours, social, validated form |
/docs | docs.html | This documentation |
Product enquire buttons navigate to
/contact?product=Name&category=Category,
which switches the form to POST /api/enquiry.
8. Frontend system
CSS modules
main.css— design tokens, reset, buttons, cards, forms, about/testimonials, utilitiesnavbar.css/footer.css— site chromehero.css— homepage hero and home sectionsproducts.css,gallery.css,contact.css— page featuresanimations.css— scroll reveals, image wipe, typing caret
JavaScript modules
main.js— loader, scroll-top, ripple, Intersection Observer, counters, typing, parallax, product filters, newsletter, yearnavbar.js— scroll solid state, mobile drawerslider.js— reviews carousel + hero video bootgallery.js— gallery filters + accessible lightboxcontact.js— validation + submitapi.js—window.ChalukyaAPIFetch helpers
Scripts load with defer. Prefer data-attributes (e.g. data-animate, data-slider) over hard-coded IDs for reuse.
9. Backend system
app.py is the single process entry:
- Lifespan hook runs
init_db() - Mounts
/static - Registers HTML page routes via
render_page() - Includes
enquiry_routerfromapi/enquiry.py - Serves
/robots.txt,/sitemap.xml - Custom HTML 404 for non-API paths
- Security headers middleware
Shared template context includes brand_name, brand_tagline, page_title,
active_page, and site_url (from SITE_URL constant).
10. API reference
| Method | Path | Body | Success |
|---|---|---|---|
| POST | /api/contact |
name, phone, email, message |
201 + JSON |
| POST | /api/enquiry |
Same + optional product_name, product_category |
201 + JSON |
| GET | /api/health |
— | 200 JSON |
| GET | /api/docs |
— | Swagger UI |
Example contact payload
{
"name": "Jane Doe",
"phone": "99407 18307",
"email": "jane@example.com",
"message": "Looking for bathroom tiles for a renovation."
}
Example success response
{
"success": true,
"message": "Thank you! Your message has been received. We will contact you shortly.",
"id": 1
}
Invalid bodies return 422 with FastAPI validation details. Client form maps field errors when possible.
11. Database
File: database/showroom.db (created automatically; gitignored).
Tables
- contact_messages — general form submissions
- enquiries — product/showroom enquiries with optional product fields
Both store ISO-8601 UTC created_at and a status defaulting to new
for future admin workflows. List helpers exist in database/db.py but no admin UI yet.
MySQL later
- Recreate tables with MySQL types (
DATETIME,AUTO_INCREMENT). - Replace
get_connection()only. - Keep insert column names stable so routes stay unchanged.
12. SEO & accessibility
SEO
- Per-page
<title>and meta description - Open Graph basics on main pages
- Home JSON-LD (
HomeAndConstructionBusiness) /robots.txtand/sitemap.xml(set realSITE_URL)- Semantic landmarks and heading hierarchy
Accessibility
- Skip link to
#main - ARIA labels on icon buttons and drawers
- Focus-visible outlines
- Lightbox focus trap + Escape / arrows
- Form errors with
aria-invalidand live status prefers-reduced-motiondisables non-essential motion
13. Admin panel (v1.5.0)
Private operations console at /admin (login at /admin/login).
Default credentials: admin / chalukya@2026
(override with env ADMIN_USERNAME, ADMIN_PASSWORD, ADMIN_SECRET).
- Dashboard — sales totals, leads, queries, customers, media counts
- Tile Media — upload image + name, model number, colour, material category (optional size/finish/description). Shown on Products, Gallery, and Home featured.
- Collection Videos — upload MP4/WebM (+ optional poster). Active videos render mid-down on the homepage (below trust strip).
- Sales / Leads / Customers — CRUD tables for analytics and CRM-lite data
- Queries — contact form messages + product enquiries with status updates
Uploads land in static/uploads/{tiles,videos,posters}/. Schema lives in database/db.py; API in api/admin.py.
14. Setup & run (Windows)
cd C:\Users\Admin\Downloads\ChalukyaTiles_website\website_tiles1
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
uvicorn app:app --reload --host 127.0.0.1 --port 8000
Open http://127.0.0.1:8000 — admin at http://127.0.0.1:8000/admin — documentation at http://127.0.0.1:8000/docs. Interactive API docs at /api/docs.
15. Customize & launch checklist
- Change admin password (env vars or re-seed after deleting admin row).
- Update phone, email, WhatsApp links, address, map embeds.
- Set
SITE_URL/ADMIN_SECRETfor production. - Upload real tile photos and collection videos via Admin → Tile Media / Videos.
- Back up
database/showroom.dbandstatic/uploads/on a schedule. - Serve behind HTTPS reverse proxy in production.
16. Recommended next extensions
- Email notify — send mail on new submission.
- MySQL — production multi-instance DB.
- Role-based admin — multiple staff accounts with permissions.
- i18n — language switch if needed for bilingual markets.
17. Project memory workflow
File: PROJECT_MEMORY.md (project root). After every module or coding session:
- Create the file if missing; otherwise update it.
- Record overview, stack, structure, architecture, completed/pending work, files, APIs, DB changes, TODO, next task, version.
- Never wipe useful history — append session notes.
- Refresh the CONTINUE PROMPT section so a new chat can resume instantly.
- Keep this
/docspage aligned when architecture changes.
Tip: Treat PROJECT_MEMORY.md as the single source of continuity across tools and conversations.
This HTML page is the human-friendly handbook for stakeholders and new developers.