How santoshsomu/legend-carpet works
Project Type & Purpose
• This is a small full-stack web application built on Python (app.py) using Flask (Jinja2 templates).
• It serves marketing content: service pages, portfolio, contact form, interactive UI elements, and integrates with external services (Google Maps, Analytics, reCAPTCHA).
Main Components
a. Client Layer
– Web Browser (Desktop, Tablet, Mobile)
– UI: HTML templates (templates/*.html), CSS (static/css/*.css), JavaScript (static/js/*.js), Images & Videos (static/images, static/videos)
b. Web & Application Layer
– Flask Application (app.py) running under a WSGI server (Gunicorn, uWSGI, or Flask’s built-in server)
– Jinja2 Template Engine
– (Optional) Reverse proxy / Load balancer (Nginx or Apache) for production
c. Data & Storage Layer
– Static Assets Storage (served directly by web server or via CDN)
– (Future/Optional) Backend datastore or email service for contact-form submissions
d. External Services
– Google Maps (iframe embed)
– Google Analytics (gtag.js)
– reCAPTCHA API (spam protection)
– SMTP or third-party email service (for “Contact Us” form)
Relationships & Data Flow
1. Client → HTTP/HTTPS → Load Balancer (if any) → Web Server
2. Web Server → Flask App →
• Renders Jinja2 templates (templates/)
• Serves static assets (static/ and style.css)
3. Client performs interactive actions:
• Requests CSS/JS for animations, sliders, form validation
• Loads portfolio images via lightbox component
• Submits contact form → POST to Flask endpoint → server-side validation → (reCAPTCHA verification → email service or datastore) → returns success/failure JSON or redirects
4. Client side analytics events → Google Analytics
5. Page embed → Google Maps iframe
Architectural Patterns & Principles
• MVC-style separation:
– Views: Jinja2 templates under /templates
– Static “Controller” logic: app.py routes
– Models (optional/future): form data mapping, datastore
• Static asset caching & CDN offload for performance
• Progressive enhancement: client-side JS for animations & validation
• Security: CSP headers, HTTPS, XSS protection, reCAPTCHA