How peedro10/projet_myski works
Project type and purpose
• This is a full-stack web application (“Projet Station de Ski”) comprising:
• A React-based Single Page Application (frontend)
• A Node.js/Express REST API (backend)
• A MySQL database storing pistes, remontées, users, comments, itineraires, chats
• Purpose: allow authenticated users to view and modify ski-lift and piste states, post comments, plan itineraries, and chat in real time.
File structure
• Top-level separation:
• api/ – backend code
• frontend/ – React SPA
• Backend (api/): follows an MVC-style layout
• index.cjs – Express app bootstrap
• routes/ – Express route definitions per resource
• controllers/ – business logic for auth, chats, commentaires, itineraires, pistes, remontées
• models/ – data schemas and queries against MySQL
• middleware/ – auth checks, error handling
• .cjs + .env – database connection
• Frontend (frontend/): React application
• src/components – UI building blocks (Navbar, Footer, Sections)
• src/pages – page views (Home, Login, Chats, Comments, Itineraires, etc.)
• src/context – React Contexts (auth, darkMode, PrivateRoute)
• public/index.html – SPA entry point
• Deployment and CI:
• .github/workflows/main.yml – CI pipeline
• 2024ski.sql – initial database schema
Key insights from the README
• Lists features: authentication, CRUD on pistes/remontées, comments, itineraries, internal chat
• Tech stack: Node.js, Express, MySQL, React
• Run steps: separate npm scripts for api and frontend
Detail and essential elements
• Even small pieces (e.g., connect.cjs for DB connection, .env)
• REST endpoint class (auth, users, pistes, remontees, commentaires, chats, itineraires)
• Flow of authentication token from frontend to middleware to controllers
• Optional: show sequence of a typical user action (e.g., “Change Piste State”)