How ieee-student-branch-emsi-marrakesh/ieee-website works
1. High-level shape
- This repo is a React 19 + Vite 7 website for the IEEE Student Branch EMSI Marrakesh.
- It is primarily a content-driven front end with a small serverless backend for form submissions.
- The architecture splits cleanly into:
- reusable UI and page composition in src/
- static media in public/assets/
- email/contact endpoints in api/
- deployment/runtime configuration for Vercel.
2. Frontend shell and composition
- src/main.tsx boots the app, and src/App.tsx is the top-level composition/routing layer.
- The app is built from reusable site sections such as:
- Hero, About, Cells, Events, Achievements, Team, Supervisors, Contact
- Shared chrome is handled by Navbar and Footer.
- This suggests a single-site experience where the homepage is assembled from sections, while some content also gets its own pages.
3. Page-level structure
- Dedicated page components exist for:
- AchievementsPage
- EventsPage
- TeamPage
- NotFound
- The presence of these files indicates a multi-page SPA-style experience or route-based rendering within the React app.
- The homepage likely highlights summaries, while the dedicated pages provide fuller galleries/lists.
4. Content is data-driven, not hard-coded
- Core site content lives in src/data/:
- events.ts
- achievements.ts
- team.ts
- supervisors.ts
- cells.ts
- institutions.ts
- socials.ts
- These files act as the main content source of truth for the UI.
- This is important architecturally: the UI reads from typed data modules rather than embedding content directly in components.
5. Reusable interaction components
- The site uses a set of focused components for user interactions:
- EventModal for event details
- AchievementCard for achievement presentation
- MediaCarousel for image/video browsing
- JoinUsDialog for membership/contact flow
- PolicyDialogs for policy/legal content
- These components sit between raw data and the page shells, which keeps the sections simple and consistent.
6. UI system and design primitives
- src/components/ui/ contains shadcn-style primitives:
- button, card, dialog, form, input, label, textarea
- These are the low-level building blocks used across the site.
- Styling is handled with Tailwind CSS, and src/lib/utils.ts likely contains small composition helpers used by these primitives.
7. Media and asset strategy
- Static assets live in public/assets/ and are organized by domain:
- achievements
- cells
- events
- supervisors
- team
- Event media is subdivided by academic year and event name, including video files.
- This structure supports a content gallery architecture where event cards/modal/carousel components resolve media directly from predictable paths.
8. Backend boundary: serverless contact/join requests
- The api/ directory contains:
- contact.ts
- send.ts
- contact-template.ts
- joinus-template.ts
- This indicates a small serverless API layer responsible for sending messages, likely via email.
- The front end’s contact/join-us dialogs submit to these endpoints instead of embedding email logic in the browser.
- The environment setup in .env.example and the README’s vercel dev guidance confirm that these functions depend on runtime secrets.
9. Data flow for user actions
- Typical flows are:
- visitor opens a section/page
- component reads structured data from src/data/*
- UI renders cards, dialogs, and media
- form submissions from contact/join-us dialogs call api/*
- the serverless layer formats output using the template files and sends the request onward
- So the site is mostly read-only content, with a narrow write path for communication.
10. Performance and asset handling
- The README mentions lazy loading and automated asset optimization.
- scripts/optimize.sh suggests a build-time/media optimization step outside the React app itself.
- This is a meaningful architectural concern because the site carries a large amount of event/video media, so performance depends on both frontend lazy loading and asset preparation.
11. Deployment/runtime
- vercel.json shows the site is intended to run on Vercel.
- The README explicitly recommends vercel dev so that both the frontend and serverless functions run together with environment variables.
- That means the production boundary is:
- static React app
- Vercel-hosted serverless functions
- environment-driven configuration for external services.
12. Overall diagram guidance
- A good architecture diagram would show three main layers:
- Presentation layer: React sections/pages/components
- Content/media layer: typed data files plus public/assets/
- Service layer: Vercel serverless API functions for contact/join requests
- The central dependency is from UI components to src/data/* and asset paths; the only significant outbound integration is through the api/ endpoints.
Main entry points: sections Sections · pages Pages · App.tsx App shell · api API functions
Components 21
Presentation
React app shell, pages, sections, and reusable UI
- main · Bootstraps the React app
src/main.tsx - App shell · Top-level composition and route selection
src/App.tsx - Navbar · Primary site navigation
src/components/Navbar.tsx - Footer · Site footer and closing chrome
src/components/Footer.tsx - Sections · Homepage content blocks like hero, about, events, team, and contact
src/sections - Pages · Dedicated pages for achievements, events, team, and not found
src/pages - Dialogs · Event details, membership, policy, and media interactions
src/components - UI kit · Reusable shadcn-style form and display components
src/components/ui - Utils · Shared component utility helpers
src/lib/utils.ts
Content
Typed site data and static media assets
- Events data · Structured event content and metadata
src/data/events.ts - Achievements data · Structured achievements content
src/data/achievements.ts - Team data · Structured team member content
src/data/team.ts - Support data · Supervisors, cells, institutions, and social links
src/data - Media assets · Images and videos for achievements, events, team, cells, and supervisors
public/assets
Service
Serverless request handling and email templates
- API functions · Contact and join-us request endpoints
api - Contact API · Receives contact form submissions
api/contact.ts - Send mail · Shared sending logic for outbound messages
api/send.ts - Templates · Message formatting for contact and join-us flows
api
Platform
Build, runtime, and deployment configuration
- Optimize script · Build-time asset optimization
scripts/optimize.sh - Vercel config · Deployment and runtime configuration
vercel.json - Vite config · Frontend build and dev server setup
vite.config.ts
Connections 26
- main → App shell: boots · Application startup enters the root composer
- App shell → Navbar: uses · Shared chrome appears across the site
- App shell → Footer: uses · Shared chrome appears across the site
- App shell → Sections: renders · Homepage and section-based content
- App shell → Pages: routes to · Dedicated page views for fuller content
- Sections → Events data: reads · Sections render from structured content
- Sections → Achievements data: reads · Sections render from structured content
- Sections → Team data: reads · Sections render from structured content
- Sections → Support data: reads · Sections render from structured content
- Pages → Events data: reads · Pages reuse the same content source of truth
- Pages → Achievements data: reads · Pages reuse the same content source of truth
- Pages → Team data: reads · Pages reuse the same content source of truth
- Sections → Dialogs: opens · Sections launch detail and form interactions
- Pages → Dialogs: opens · Pages launch detail and form interactions
- Dialogs → UI kit: builds on · Dialogs are composed from shared primitives
- UI kit → Utils: uses · Primitives share helper logic
- Dialogs → API functions: submits to · Contact and join-us actions call serverless endpoints
- API functions → Contact API: contains · Contact request handler
- API functions → Send mail: contains · Shared outbound send logic
- API functions → Templates: formats with · Email/body templates for outbound messages
- Sections → Media assets: loads media · Section components resolve images and videos from public assets
- Pages → Media assets: loads media · Page views reuse the same asset tree
- Optimize script → Media assets: optimizes · Build-time media preparation
- Vercel config → API functions: deploys · Serverless functions run on Vercel
- Vercel config → App shell: serves · Hosts the frontend application
- Vite config → main: bundles · Frontend build entry and dev workflow