How anuj-gill/eventspro works
Main Components
• Frontend (Client):
• Contains UI components (organized into folders such as components, pages, hooks, store, etc.).
• Implements features like user authentication (Google OAuth), event registration, committee management, and visual effects (custom UI components, animated testimonials, backgrounds, etc.).
• Uses Recoil for state management.
• Backend (Server):
• Implements core business logic and APIs divided into controllers, services, and routes (e.g., auth, events, committee, QR code functionalities).
• Includes middleware for error handling, JWT authentication, and role-based access.
• Uses Prisma for ORM to interact with a PostgreSQL database.
• Database:
• PostgreSQL, accessible via Prisma. Represented by the Prisma schema and connected to via the provided DATABASE_URL.
• External Services:
• Google OAuth for authentication.
• Email service (mail utility in the backend) for sending event tickets/notifications.
• Docker is optionally used for containerizing PostgreSQL.
Relationships and Interactions
• Frontend and Backend:
• Frontend makes API calls (using Axios defined in the client/api directory) to the backend.
• Backend and Database:
• External Integrations:
• Integration with Google OAuth: The frontend initiates OAuth flows, and the backend validates tokens and manages user sessions.
• Integration with the email service (backend utility for sending emails).
Architectural Patterns and Design Principles
• Separation of Concerns:
• The code is clearly separated by responsibilities (UI components, API routes, controllers, services, middleware).
• MVC-like Structure on the Backend:
• Routes, controllers, and services illustrate a modular design.
• Layered Architecture on the Frontend:
• Components, hooks, and state management (Recoil) show thoughtful separation and reusability.
Relevant Technologies and Frameworks
• Frontend: React, TypeScript, Tailwind CSS, Vite (as the build tool), Recoil for state management.
• Backend: Node.js, Express.js, TypeScript, Prisma ORM.
• Database: PostgreSQL.
• Other: Docker (for containerized deployment), Google OAuth (for authentication), and additional libraries for QR code generation, mailing, etc.
Essential Elements
• Clear Component Labels:
• Components as “Frontend (Client)”, “Backend (Server)”, “Database (PostgreSQL)”, “Google OAuth”, “Email Service”, etc.
• Data flow from the Frontend to API endpoints in the Backend.
• Distinguishing Visuals:
Putting It All Together
1. The Presentation Layer (Frontend):
• Displays components, pages, and state management.
2. The Application/Business Logic Layer (Backend):
• Includes grouped functionalities such as authentication, event management, committee management, QR code generation, and error handling middleware.
3. The Data Layer:
• Represents the PostgreSQL database managed via Prisma.
• Communication protocols (HTTP/HTTPS API calls) between the client and server, and note any middleware handling (authentication, authorization via JWT, etc.) on the server.