How subhankar-hub/professional-tax-portal works
Project Type & Purpose
• This is a full-stack, government-grade web application (“Professional Tax Portal”) that enables users to enroll, update, and view professional-tax details through an 8-step, OTP-protected wizard.
• The stack consists of:
• Frontend: React (TypeScript) with Vite, Tailwind CSS, Radix UI/shadcn/ui
• Backend A: Spring Boot (Java 17+) exposing RESTful APIs
• Backend B: Node.js/Express serverless functions (in the api/ folder), deployed to Vercel or similar
• Database: PostgreSQL (with automated schema + master-data initialization)
• External Service: Fast2SMS for OTP delivery
File Structure Highlights
• Root:
• api/ – serverless endpoints (health, master-data, OTP)
• backend-professional-tax-portal/ – Spring Boot application (MVC layers, DTOs, repos, services, controllers, SQL scripts)
• frontend-professional-tax-portal/ – Vite/React app (pages, components, hooks, API client, shared schema)
• DB setup & helper scripts (setup_postgres.sh, new_db_schema.sql, etc.)
• Deployment configurations (docker-compose, Vercel config, Maven wrapper, etc.)
Architectural Patterns & Design Principles
• Frontend/Backend separation: SPA communicating over HTTP to API layers
• MVC in Spring Boot: controllers → services → repositories → database
• Serverless micro-APIs (api/) for edge-deployed functions (low-latency around OTP and master-data queries)
• Database initialization service to auto-seed master tables on startup
• 8-step wizard UI with state management (React hooks + TanStack Query)
a. Main Components
• Web Client (React SPA)
• Serverless API Layer (Node/Express in api/)
• Monolith Backend (Spring Boot app)
• PostgreSQL Database
• External SMS Gateway (Fast2SMS)
• DevOps/Deployment (Docker, Vercel, CI/CD pipeline)
b. Relationships & Data Flow
1. User interacts with React wizard →
2. React uses lib/api.ts to call either Serverless functions (for master-data & OTP) or Spring Boot endpoints (for enrollment CRUD) →
3. Serverless functions or Spring Boot controllers validate input →
4. Spring Boot services persist or query Postgres (via JPA repos) →
5. OTPService in Spring Boot calls Fast2SMS API → back to user →
6. Admin endpoints in Spring Boot manage DB initialization/reset →
7. DevOps deploys frontend to Vercel, backend + DB in Docker containers or cloud.
c. Core Patterns
• Layered architecture in Spring Boot (Config, Controller, Service, Repository, Entity)
• Micro-edge functions for high-volume or low-latency endpoints
• Client-side state + query caching (React Query)
• Infrastructure as code (shell scripts, Docker Compose, Vercel config)
d. Key Technologies
• React/TypeScript, Vite, Tailwind CSS, shadcn/ui
• Spring Boot, Maven, Java 17, ModelMapper, CORS config
• Node.js, Express, Vercel serverless
• PostgreSQL, schema.sql, data.sql
• Fast2SMS API