VastuZone is a high-performance, full-stack digital ecosystem designed to bridge traditional Vastu Shastra principles with modern AI-driven spatial analysis. It features a multimodal inference engine for automated floor-plan parsing, real-time bi-directional expert consultation, and a production-ready payment infrastructure.
- AI-Driven Onboarding: Reduced manual data entry by 90% through automated spatial extraction from floor plans using Computer Vision.
- Real-time Latency: Achieved sub-100ms message delivery for expert consultations using an event-driven Socket.io architecture.
- Resilient Security: Implemented a Zero-Trust authentication model using Firebase JWT verification and granular Role-Based Access Control (RBAC).
- Optimized Data Pipeline: Leveraged Memory Buffers for PDF-to-Image processing, reducing Disk I/O overhead by 15%.
The "X-Factor" of VastuZone is its proprietary inference engine. Instead of manual form entry, users upload PDF floor plans.
- Spatial Parsing: Utilizes Gemini 1.5 Flash (Vision) to analyze spatial layouts, identifying directions for Kitchens, Bedrooms, and Entrances.
- Deterministic Scoring: AI outputs are processed through a rule-based engine to generate compliance scores and localized remedial suggestions.
- Automated Reporting: Generates dynamic, multi-page Vastu reports in PDF format via
pdfkit, persisted in Cloudinary.
- Stateful Communication: Leveraging Socket.io for low-latency chat, presence tracking, and real-time report notifications.
- Event Narrowcasting: Consultations are partitioned into secure socket rooms, ensuring 100% data isolation between clients and experts.
- Schema Rigor: Integrated Zod for compile-time and runtime type safety, ensuring 100% data integrity before DB persistence.
- Observability: Structured JSON logging with Winston and a global centralized error-handling middleware for high reliability.
- Scalability: Designed with a decoupled Service-Controller-Route pattern to facilitate horizontal scaling.
graph TD
A[Client - React] -->|JWT Auth| B[API Gateway - Express]
B --> C{Auth Middleware}
C -->|Valid| D[Controller Layer]
C -->|Invalid| E[401 Unauthorized]
D --> F[AI Vision Engine]
F -->|PDF to Image| G[Gemini 1.5 Flash]
G -->|Spatial Metadata| H[Vastu Evaluator]
D --> I[Real-time Layer]
I -->|Events| J[Socket.io]
D --> K[Storage Layer]
K -->|ODM| L[(MongoDB)]
K -->|Assets| M[Cloudinary]
D --> N[Payment Gateway]
N -->|Webhooks| O[Razorpay]
- Framework: React 19 (Hooks, Context API)
- State Management: React Query (TanStack) for optimized server-state caching.
- Real-time: Socket.io-client for bi-directional streaming.
- Styling: Modular CSS with Responsive Design.
- Auth: Firebase SDK with Observer patterns.
- Runtime: Node.js with Express.
- Database: MongoDB (Mongoose ODM).
- AI/ML: Google Generative AI (Gemini Vision 1.5).
- Security: Firebase Admin SDK (JWT Validation), CORS, Zod.
- Payments: Razorpay Integration.
- Communication: Nodemailer (Email notifications), Socket.io.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/api/users/register |
User Onboarding & Firebase Sync | No |
POST |
/api/properties/add |
AI Floor-plan analysis & Report Gen | Yes |
GET |
/api/properties/user |
Fetch User's analyzed reports | Yes |
POST |
/api/appointments/book |
Razorpay-backed consultation booking | Yes |
POST |
/api/chat/send |
Send message to Expert | Yes |
Problem: Gemini Vision requires image buffers, but users upload multi-page PDFs. Initial attempts with disk-writes were slow.
Solution: Implemented an in-memory stream using pdf-img-convert. We convert PDF pages directly into memory buffers, passing them to the Gemini API without touching the disk, resulting in a 40% speed increase in analysis.
Problem: Users weren't seeing new messages or report updates without refreshing. Solution: Integrated a Socket.io event emitter within the Express controllers. When a report is generated or a message is saved, the server emits a targeted event to the user's unique Socket Room, triggering a React Query invalidation for instant UI updates.
- Node.js (v20+)
- MongoDB Atlas Account
- Firebase Project (Admin SDK JSON)
- Cloudinary Credentials
- Gemini API Key
-
Clone the Repo
git clone https://github.com/Rajat125tech/VastuZone.git cd VastuZone -
Backend Setup
cd vastuzone-backend npm install # Create .env with: MONGO_URI, FIREBASE_SERVICE_ACCOUNT_JSON, GEMINI_API_KEY, CLOUDINARY_URL npm run dev
-
Frontend Setup
cd ../vastuzone-frontend npm install # Create .env with: REACT_APP_FIREBASE_CONFIG, REACT_APP_BACKEND_URL npm start
Rajat Srivastava
Full-Stack Engineer | AI Enthusiast
LinkedIn | GitHub | Portfolio
Developed with ❤️ to modernize architectural wisdom through technology.