How amitdas4321/indian-card-generator works
Indian Card Generator creates novelty identity-style cards in the browser, registers them through a signed server API, and supports later online verification and administration. The primary flow runs from card details and photo input through validation and canvas rendering to certificate registration and download; verification retrieves registered records and can render them again. Separate branches cover admin login and record management, plus selectable Firebase, MySQL, and MongoDB persistence. The graph follows sampled calls and documented capabilities; some component internals and route wiring were not sampled.
Main entry points: App.tsx Application routes · index.ts Database selector · certificateService.ts Certificate API client · CardForm.tsx Card details form
Components 21
Card Creation
- Application routes
src/App.tsx - Card details form
src/components/CardForm.tsx - Input validation
src/utils/validation.ts - Photo upload
src/components/PhotoUploader.tsx - Canvas preview
src/components/CardPreview.tsx - Card and QR renderer
src/utils/cardRenderer.ts - Card download
src/components/DownloadButton.tsx
API and Security
- Certificate API client
src/services/certificateService.ts - Request signer
src/utils/apiSigner.ts - Express API
server.ts
Verification
- Verification portal
src/components/VerificationPage.tsx
Administration
- Admin routes
src/components/admin/AdminPage.tsx - Admin login
src/components/admin/AdminLogin.tsx - Admin dashboard
src/components/admin/AdminDashboard.tsx - Admin API client
src/services/adminService.ts
Persistence
- Database selector
src/services/database/index.ts - Firebase adapter
src/services/database/firebase.ts - MySQL adapter
src/services/database/mysql.ts - MongoDB adapter
src/services/database/mongodb.ts - Configured database
Other components
- Card creator
Connections 26
- Card creator → Application routes: opens
- Application routes → Card details form: renders
- Application routes → Canvas preview: renders
- Application routes → Card download: renders
- Application routes → Verification portal: routes to
- Application routes → Admin routes: routes to
- Card details form → Input validation: validates with
- Card details form → Photo upload: accepts photo
- Canvas preview → Card and QR renderer: renders via
- Card download → Certificate API client: registers card
- Certificate API client → Request signer: signs requests
- Certificate API client → Express API: calls API
- Verification portal → Certificate API client: looks up card
- Verification portal → Card and QR renderer: renders card
- Admin routes → Admin login: presents login
- Admin routes → Admin dashboard: presents dashboard
- Admin login → Admin API client: authenticates through
- Admin dashboard → Admin API client: manages records via
- Admin API client → Express API: calls admin API
- Express API → Database selector: queries and updates
- Database selector → Firebase adapter: selects provider
- Database selector → MySQL adapter: selects provider
- Database selector → MongoDB adapter: selects provider
- Firebase adapter → Configured database: reads and writes
- MySQL adapter → Configured database: reads and writes
- MongoDB adapter → Configured database: reads and writes