Sankar Construction Company — Technical Architecture & Documentation
A comprehensive technical guide covering architecture, technology stack, database schema, API routes, deployment, modules, benefits, and business pricing for the Sankar Construction Company platform.
System Overview
High-level architecture of the Sankar Construction Company platform — a dual-frontend system combining Laravel Blade with Astro SSG.
The platform uses a hybrid approach: Laravel Blade serves the admin panel and primary frontend, while Astro 4 generates a static site for the public-facing website consuming the Laravel REST API.
Client Browser
Desktop / Mobile
Astro SSG
Static Frontend
REST API
/api/v1/
Laravel 11
MVC Backend
MySQL 8
Database
Laravel Blade Backend
Primary server-rendered frontend. 24 admin controllers, 40+ Blade templates, Eloquent ORM, middleware pipeline, and session management.
Astro Static Frontend
Blazing-fast SSG consuming Laravel API. TypeScript client, SEO components, structured data, RSS feed, optimized build output.
REST API Layer
14+ versioned endpoints at /api/v1/. Sanctum authentication, rate limiting, form validation, JSON responses.
Technology Stack
Enterprise-grade technologies powering the platform — selected for performance, scalability, and developer experience.
Laravel
Enterprise MVC framework with Eloquent ORM and Artisan CLI
v11.9+PHP
Server-side language with type hints and modern syntax
v8.2+MySQL
Relational DB with 41 migrations and JSON columns
v8.0+Astro
Static site generator for blazing-fast frontend
v4.16Bootstrap
Responsive CSS framework for UI components
v5.3Vite
Asset bundling with HMR and code splitting
v5.0TailwindCSS
Utility-first CSS for admin panel
v3.1Nginx
High-performance web server with SSL/TLS
ProductionAlpine.js
Lightweight JS for interactive components
v3.xSanctum
API token authentication for SPA/mobile
LatestRedis
In-memory caching for session/query optimization
OptionalFont Awesome
Comprehensive icon library v6
v6.5Prerequisites
| Requirement | Minimum Version | Purpose |
|---|---|---|
| PHP | 8.2+ | Server-side runtime |
| Composer | 2.6+ | PHP dependency manager |
| Node.js | 18+ | Frontend build tools |
| npm | 9+ | JS package manager |
| MySQL | 8.0+ | Database server |
| Nginx | 1.24+ | Web server (production) |
| Redis | 7.0+ | Caching (optional) |
File Structure
Project directory organization following Laravel conventions with Astro frontend separation.
sankarconstructioncompany/ ├── app/ │ ├── Console/ # Artisan commands │ ├── Http/Controllers/ │ │ ├── Admin/ # 24 admin controllers │ │ ├── Api/V1/ # 14 API controllers │ │ ├── Auth/ # 9 Breeze auth controllers │ │ └── HomeController.php # Public-facing controller │ ├── Http/Middleware/ # Admin, Role, Security │ ├── Models/ # 25 Eloquent models │ ├── Providers/ # Service providers │ └── View/ │ ├── Components/ # Blade UI components │ └── Composers/ # LayoutComposer ├── database/ │ ├── migrations/ # 41 migration files │ ├── seeders/ # 12 seeder files │ └── factories/ ├── frontend/ # Astro 4 static frontend │ └── src/ │ ├── components/ # Navbar, Footer, SEO │ ├── layouts/ # BaseLayout.astro │ ├── lib/ # api.ts (TypeScript) │ ├── pages/ # 11+ Astro pages │ └── styles/ # global.css ├── public/ │ ├── css/ # admin.css, style.css │ ├── js/ # main.js, jQuery, Chart.js │ ├── img/ # 28+ images │ ├── site/ # Built Astro output │ └── uploads/ # User uploads ├── resources/views/ │ ├── admin/ # 40+ admin Blade views │ ├── auth/ # Login, Register, etc. │ ├── pages/ # Public Blade templates │ └── partials/ # navbar, footer, etc. ├── routes/ │ ├── web.php # Public routes │ ├── admin.php # Admin routes (/caption) │ ├── auth.php # Auth routes │ └── api.php # REST API routes ├── .env # Environment config ├── composer.json # PHP dependencies ├── package.json # JS dependencies ├── vite.config.js # Vite bundler config └── deploy.sh # Deployment script
Configuration Guide
Environment setup, application configuration, and build tool configuration for the platform.
Environment Variables
The .env file contains all environment-specific configuration. Here are the critical variables:
# Application APP_NAME="Sankar Construction Company" APP_ENV=production APP_KEY=base64:xxxxx APP_DEBUG=false APP_URL=https://www.sankarconstructioncompany.com # Database DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=sankarconstructioncompany DB_USERNAME=root DB_PASSWORD="" # Mail (Gmail SMTP) MAIL_MAILER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=sankarconstructioncompany@gmail.com MAIL_ENCRYPTION=tls # Session & Cache SESSION_DRIVER=file CACHE_DRIVER=file QUEUE_CONNECTION=database # Sanctum SANCTUM_STATEFUL_DOMAINS=sankarconstructioncompany.com
| Variable | Default | Description |
|---|---|---|
APP_URL | localhost | Application base URL |
DB_HOST | 127.0.0.1 | Database server host |
DB_PORT | 3306 | MySQL port |
MAIL_MAILER | smtp | Mail transport driver |
SESSION_DRIVER | file | Session storage (file/database/redis) |
CACHE_DRIVER | file | Cache backend (file/redis) |
QUEUE_CONNECTION | database | Queue driver for jobs |
App Configuration
Laravel configuration files in config/ directory:
Site Settings (DB)
Key-value store in site_settings table. Cached for 1 hour. Managed via admin panel at /caption/settings.
Email Settings (DB)
SMTP configuration stored in database. Test email functionality. Managed via /caption/email-settings.
TypeScript & Vite
Frontend build pipeline configuration for both Laravel (Vite) and Astro frontend.
import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; export default defineConfig({ plugins: [ laravel({ input: [ 'resources/css/app.css', 'resources/js/app.js', ], refresh: true, }), ], });
import { defineConfig } from 'astro/config'; export default defineConfig({ output: 'static', site: 'https://www.sankarconstructioncompany.com', server: { port: 4321 }, });
Database Schema
41 migration files powering 30+ database tables with soft deletes, JSON columns, and polymorphic relationships.
| Table | Purpose | Key Columns | Soft Delete |
|---|---|---|---|
users | Admin accounts | name, email, role, avatar, status | No |
projects | Construction projects | title, slug, cost, status, lat/lng, specs JSON | Yes |
services | Service catalog | title, slug, features JSON, benefits JSON | Yes |
blog_posts | Blog articles | title, slug, content, views_count, reading_time | Yes |
team_members | Team profiles | name, designation, role_type, qualifications | Yes |
testimonials | Client reviews | client_name, rating, review, project_id | No |
job_listings | Career listings | title, department, type, salary_range | No |
job_applications | Applications | name, email, resume_path, status | No |
contact_messages | Contact forms | type, name, email, message, is_read | No |
newsletter_subscribers | Subscribers | email, token, status | No |
client_logos | Client logos | name, image, industry, projects_completed | Yes |
partners | Business partners | name, image, category | No |
awards | Company awards | title, year, issuing_body | No |
faqs | FAQ items | question, answer, category | No |
media | Media library | filename, path, mime_type, size, folder | No |
pages_content | CMS sections | page_slug, section, title, content | No |
site_settings | Key-value config | key (unique), value | No |
carousel_slides | Hero banners | title, image, button_text, button_url | No |
activity_logs | Audit trail | user_id, action, subject_type/id, old/new JSON | No |
menus | Navigation | label, url, parent_id, position | No |
Relationships
Project Relations
Project belongsTo ProjectCategory, hasMany Testimonials. Project has JSON columns for specifications, features, amenities, gallery, and video_gallery.
Blog Relations
BlogPost belongsTo BlogCategory, belongsToMany BlogTag (pivot: blog_post_tag). Includes views counter and reading_time.
Career Relations
JobListing hasMany JobApplication. Applications include resume_path, cover_letter, and status tracking.
Activity Log (Polymorphic)
ActivityLog uses polymorphic subject_type/subject_id to track changes across all models with old/new values JSON.
API Routes
Versioned RESTful API at /api/v1/ with throttling, validation, and Sanctum authentication.
| Method | Endpoint | Description | Rate Limit |
|---|---|---|---|
| GET | /v1/homepage | Aggregated homepage data | — |
| GET | /v1/services | All active services | — |
| GET | /v1/services/{slug} | Service detail by slug | — |
| GET | /v1/projects | All active projects | — |
| GET | /v1/projects/{slug} | Project detail by slug | — |
| GET | /v1/blog | Blog posts with filtering | — |
| GET | /v1/blog/categories | Blog categories | — |
| GET | /v1/blog/{slug} | Blog post detail | — |
| GET | /v1/team | Team members | — |
| GET | /v1/testimonials | Client testimonials | — |
| GET | /v1/faqs | FAQs grouped by category | — |
| GET | /v1/careers | Job listings | — |
| GET | /v1/careers/{slug} | Job detail | — |
| GET | /v1/partners | Partners | — |
| GET | /v1/client-logos | Client logos | — |
| GET | /v1/sitemap-data | XML sitemap data | — |
| GET | /v1/site-settings | Public settings | — |
| GET | /v1/pages/{slug} | CMS page content | — |
| POST | /v1/contact | Submit contact form | 10/min |
| POST | /v1/subscribe | Newsletter subscribe | 5/min |
| POST | /v1/careers/{slug}/apply | Job application | 5/min |
Data Flow Architecture
Astro Build
SSG at build time
API Fetch
TypeScript client
Controller
Business logic
Eloquent ORM
Query builder
MySQL
Persistent storage
Analytics Engine
The platform includes a built-in analytics system tracking:
Content Analytics
Blog post views counter, reading time calculation, sharing statistics. Each BlogPost tracks views_count, shares, and comments_count.
Activity Logging
Polymorphic activity_logs table tracks user actions with old/new values, IP address, and user agent for audit compliance.
AI Integration
The platform is designed for future AI integration with these prepared hooks:
Content Generation
Blog content and service descriptions can be AI-enhanced. Schema markup auto-generation ready for AI APIs.
Smart Chatbot
Contact form types (callback, project enquiry) are structured for AI chatbot integration to qualify leads automatically.
Predictive Analytics
Project cost, duration, and area data structured for ML-based cost estimation and timeline prediction models.
UI Modules Explanation
Detailed breakdown of every module in the admin panel and public-facing website.
Admin Panel Modules (24+)
| Module | Route | Operations | Description |
|---|---|---|---|
| Dashboard | /caption/dashboard | Read | KPIs, stats, recent messages, project charts |
| Banner Slides | /caption/banners | Full CRUD | Hero carousel management with image upload |
| Projects | /caption/projects | Full CRUD | Status, cost, gallery, brochure, geo-coordinates |
| Project Categories | /caption/project-categories | Full CRUD | Category management with icons |
| Services | /caption/services | Full CRUD | Features, benefits, gallery JSON |
| Blog Posts | /caption/blog | Full CRUD | Rich editor, categories, tags, SEO |
| Blog Categories | /caption/blog-categories | Full CRUD | Blog category management |
| Team Members | /caption/team | Full CRUD | Role types, qualifications, social links |
| Testimonials | /caption/testimonials | Full CRUD | Ratings, project association |
| Careers | /caption/jobs | Full CRUD | Job listings with applications |
| Job Applications | /caption/applications | Read/Update | Resume download, status tracking |
| Clients | /caption/clients | Full CRUD | Client logos with industry info |
| Awards | /caption/awards | Full CRUD | Company awards with year/body |
| FAQs | /caption/faqs | Full CRUD | Categorized FAQ management |
| Partners | /caption/partners | Full CRUD | Partner management with categories |
| Contact Messages | /caption/messages | Read/Reply | Multi-type forms, reply, mark read |
| Newsletter | /caption/newsletter | Read/Export | CSV export, token unsubscribe |
| Media Library | /caption/media | Upload/Delete | Centralized file management |
| CMS Pages | /caption/pages | Full CRUD | Dynamic pages with SEO fields |
| About Page | /caption/about | Edit | Section-based about page editor |
| Site Settings | /caption/settings | Edit | Global config key-value store |
| Email Settings | /caption/email-settings | Edit/Test | SMTP configuration with test |
| Users | /caption/users | Full CRUD | Role assignment (admin/editor/viewer) |
| Rebuild Storefront | /caption/rebuild | Action | One-click cache clear |
Platform Features
Security
Sanctum tokens, CSRF, bcrypt (12 rounds), RBAC middleware, HSTS, X-XSS-Protection, rate limiting.
Performance
Astro SSG, Vite splitting, DB caching (1hr TTL), Redis, lazy loading, Nginx gzip, 30-day asset cache.
SEO
Schema.org JSON-LD, Open Graph, Twitter Cards, XML sitemap, RSS, canonical URLs, slug routing.
Responsive
Mobile-first Bootstrap 5.3, touch-friendly, keyboard navigation, cross-browser compatible.
Document Generation
DomPDF for PDFs, php-qrcode for QR codes, brochure downloads, resume uploads.
RBAC
Admin/Editor/Viewer roles, dedicated middleware, granular permissions, activity logging.
Installation & Deployment
Step-by-step setup and production deployment guide.
Installation Steps
# 1. Clone repository git clone https://github.com/your-repo/sankarconstructioncompany.git cd sankarconstructioncompany # 2. Install PHP dependencies composer install # 3. Install JS dependencies npm install # 4. Environment setup cp .env.example .env php artisan key:generate # 5. Database migration & seed php artisan migrate php artisan db:seed # 6. Build frontend assets npm run build # 7. Build Astro frontend cd frontend npm install npm run build cd .. # 8. Start development server php artisan serve
Production Deployment
#!/bin/bash # Production deployment script git pull origin main composer install --no-dev --optimize-autoloader npm install && npm run build # Build Astro frontend cd frontend && npm run build && cd .. php artisan migrate --force php artisan config:cache php artisan route:cache php artisan view:cache php artisan optimize # Restart queue workers php artisan queue:restart
The platform includes a production Nginx config with SSL/TLS, gzip compression, security headers (HSTS, X-Frame-Options, X-XSS-Protection), hidden sensitive directories, and 30-day static asset caching.
Pricing & Plans
Flexible pricing tiers for construction companies of different sizes.
Starter
For small builders starting digital journey
- Up to 10 projects
- 5 service listings
- Basic admin panel
- Contact form
- Mobile responsive
- 1 year support
Professional
For growing construction companies
- Unlimited projects
- Unlimited services
- Blog & CMS
- Career portal
- SEO optimization
- Analytics dashboard
- 2 year support
Enterprise
For large construction enterprises
- Everything in Professional
- REST API access
- AI integration
- Custom modules
- Multi-location
- Priority support
- SLA guarantee
Benefits & Why Required
Why every construction company needs this platform — and how it transforms their business.
Key Benefits
Professional Online Presence
SEO-optimized website ranking on Google. Attracts 3.2x more organic leads. Showcases projects, services, and team professionally.
Project Portfolio
Display completed projects with galleries, specs, costs, and timelines. Builds instant credibility and trust with potential clients.
Automated Communication
Clients self-serve project status online. Multi-type contact forms capture leads. Reduces follow-up calls by 65%.
Data-Driven Decisions
Real-time dashboard with KPIs. Track project performance, team productivity, and business growth metrics.
Why It's Required for Builders
Without a digital presence, construction companies lose projects to competitors who can be found on Google. This platform is not optional — it's essential for survival in today's market.
No Visibility = Lost Projects
Clients can't find you. Competitors with websites win your potential projects. 80% of builders still lack proper online presence.
Cost Efficiency
One platform replaces website, CRM, lead tracker, and portfolio. Saves lakhs annually compared to separate tools.
Future-Proof
Built on modern tech that scales. Add features, integrations, and modules as your business grows from 1 to 100+ projects.