How rifflere/opencourt works
Project type and purpose
• This is a full-stack web application (“OpenCourt”) that helps users find, create, join, and manage open‐play sports events.
• Frontend: React app built with Vite under src/frontend/opencourt
• Backend: Node.js/Express server under src/server
• Persistence: A database layer in src/database (db.js)
File structure
• Top-level src folder splits into database, frontend, and server.
• src/frontend/opencourt contains standard Vite/React structure (public, src, index.html, package.json).
• src/server follows an MVC‐ish layout:
• server.js (entry point)
• routers/router.js (defines REST endpoints)
• controllers/controller.js (business logic)
• model/db.js (database connection & queries)
• src/database may hold migrations or seed scripts (verify README in that folder).
Extract architectural hints from README
• CRUD operations on Users, Events, Locations
• Entities and relationships:
• User ↔ Event (many‐to‐many via participation)
• Event → Location (one‐to‐one)
• Location → Event (one‐to‐many)
• Future extensions: user profiles, payment integration
Main components and interactions
a. Components
• Client (Browser)
– React/Vite single-page app
• API Layer
– Express Server (REST endpoints)
– Routers & Controllers
• Database
– Relational or NoSQL DB (e.g., PostgreSQL, MongoDB)
• (Optionally) Authentication Service or Payment Service (future)
b. Relationships & Data Flows
1. User loads React app → makes HTTP(S) calls to REST API
2. Router dispatches to Controller
3. Controller calls model/db to query or mutate data
4. DB returns results → Controller formats JSON → Router responds to client
c. Architectural patterns
• Three‐tier architecture (Client, Server, Data)
• MVC-style separation in the backend
• Componentized React front end
d. Key technologies
• React, Vite, JSX, CSS
• Node.js, Express.js
• Database driver (e.g., pg or mongoose)
• ESLint config for code quality