How ezedealla/pi-dogs works
Project type and purpose
• This is a full-stack “Henry Dogs” application.
• Frontend: React (CRA) + Redux for state management.
• Backend: Node.js + Express, using Sequelize to connect to a Postgres database.
• Purpose: Display dog breeds from an external Dog API, allow searching/filtering/ordering on the frontend, and enable users to create new breeds stored in the local database.
File structure
• Top-level folders:
• api/ → Express server
• client/ → React app (Create React App structure)
• In api/:
• src/app.js → Express app initialization
• src/routes/ → route definitions for /dogs and /temperaments
• src/controllers/ → business logic for each route
• src/models/ → Sequelize models (Dog.js, Temperament.js)
• src/db.js → Sequelize setup and model associations (many-to-many)
• .env file (not committed) holds DB credentials and Dog API key
• In client/:
• public/ → static HTML, manifest, robots.txt
• src/index.js → React entry point
• src/components/ → UI components by feature (Card, Home, DogDetail, Formulario, etc.)
• src/Redux/ → actions, reducers, store configuration
• CSS modules for component styling
• setupTests.js and App.test.js for frontend tests
Key insights from README
• External Dog API used only to fetch breed data; no filtering/pagination handled there.
• Local DB only stores user-created breeds; external breeds are never persisted.
• Required endpoints: GET /dogs, GET /dogs?name=, GET /dogs/:id, POST /dogs, GET /temperaments.
• Tests: at least one model test, one route test, one component test.
Detail without overthinking
• Express folder as a component.
• Redux’s 3 pieces (actions, reducers, store) distinctly.
• Config (.env loading) feeding both server (DB creds, API key) and client (if any).
• Don’t omit the many-to-many join table for Temperaments.