How pralayeshmukherjee/firefly works
Project Type and Purpose
• Type: Full-stack web application
• Frontend: React (Vite) + Tailwind CSS
• Backend: Spring Boot (Java + Maven)
• Database: MySQL
• AI Layer / External APIs: Google APIs (for location/auth) and a future Generative AI API (“GeminiAPI” service)
• Purpose: An AI-powered healthcare assistant offering symptom checking, doctor/hospital finder, medicine suggestions, and (soon) a generative chatbot.
File Structure
• Top level: two folders—FireFlyBackend and Frontend—plus root README and LICENSE.
• FireFlyBackend: Maven wrapper, pom.xml, standard Spring Boot layout under src/main/java:
– Config (CORS, Security)
– Controller (APIController, GoogleController, UserController)
– Service (UserService, CustomOAuth2UserService, GeminiAPI)
– DTO (AddUser, ChatRequest)
– Entity (UserEntity)
– Repository (UserRepository)
– resources/static (images, static assets)
• Frontend: Vite setup (vite.config.js), React source under src/:
– Components (Chatbot, Landing pages, Login, OTP, SignUp, ThemeBtn)
– Context (Theme state)
– Layout.jsx, App.jsx, main.jsx
– public/index.html, assets, CSS files
Extract Additional Insights from README
• Clearly separated tech stack: frontend/backend/database/AI.
• External dependencies: MySQL, Generative AI API (upcoming), Google services.
• Running ports: FE (5173), BE (8080).
a. Main Components
1. User’s Browser / Mobile Device
2. Frontend Web App (React + Tailwind)
3. Backend REST API (Spring Boot)
4. MySQL Database
5. External Services:
• Google Maps / Places API (via GoogleController)
• OAuth2 Provider (via CustomOAuth2UserService)
• Generative AI API (via GeminiAPI service)
b. Relationships & Data Flows
• Browser ↔ Frontend: HTTP(S) calls, user interactions, static asset serving
• Frontend → Backend: REST calls (login/signup, symptom data, doctor requests)
• Backend (Controller → Service → Repository) → MySQL: CRUD operations
• Backend → External Services:
– GoogleController calls Google Maps/Places
– CustomOAuth2UserService handles OAuth flows
– GeminiAPI calls Generative AI endpoints
• Responses flow back upstream (service → controller → frontend → user).
c. Architectural Patterns & Principles
• Layered architecture (Controller → Service → Repository)
• Separation of concerns: configuration classes for security/CORS
• Stateless REST APIs
• Context/State management on the frontend (React Context)
• Future extensibility: generative AI integration as a separate service layer
d. Key Technologies / Frameworks
• React + Vite + Tailwind
• Spring Boot + Maven
• MySQL (via spring-data JPA)
• OAuth2 (Spring Security)
• Google API SDK
• Generative AI (external HTTP client)
Detail Without Overthinking
• Future points of extension: the generative AI service, health record storage, mobile clients.
• If room permits, annotate configuration classes (CORS/Security) as side-modules to the REST API.