How alexandrabaran/web2_carrefy works
Project type and purpose
• From the README, this is a small e-commerce website (“Sitio Web de un supermercado”) that uses a SQL database with two tables (products and categories) in a 1:N relationship.
• Although only the database schema (carrefy.sql) and the README are shown, the intended system will include at least a frontend (web UI) and a backend (application/API) talking to this database.
File structure
• Top-level files:
• carrefy.sql — DDL to create products and categories tables and seed data
• No code for UI or server is present, but we know from the README that the site will query those tables.
Using the README’s hints
• The tables store product metadata (name, stock, price) and category labels.
a. Main components to include:
• Web Browser (Client)
• Frontend Web App (HTML/CSS/JS or framework like React/Vue/Angular)
• Backend (REST API or MVC server in your chosen stack—e.g. Node.js/Express, Django, Rails)
• SQL Database Server (MySQL/PostgreSQL/SQL Server)
• (Optionally) External services such as a Payment Gateway or CDN for static assets
b. Relationships and data flows:
1. User (Browser) sends HTTP(S) requests (GET product listings, POST orders) to the Backend API.
2. Backend processes requests, executes SQL queries against the Database.
3. Database returns rows (products joined with categories) to the Backend.
4. Backend returns JSON/HTML to the Frontend.
5. Frontend renders product pages, category filters, shopping cart.
c. Architectural patterns/design principles:
• Clearly separate concerns: Presentation layer (frontend), Business logic/API layer (backend), Data layer (database).
• Use MVC or similar pattern on the backend.
• The relational DB implements a 1:N relationship via foreign keys.
d. Key technologies and libraries (customize to your stack):
• Frontend: React or Vue or plain HTML/CSS/JS
• Backend: Express.js / Django / Laravel / Rails
• Database: MySQL or PostgreSQL (as defined by carrefy.sql)
• ORM or query builder (Sequelize, TypeORM, SQLAlchemy, ActiveRecord)