How ndzuma/auctionwebapp works
Project type and purpose
• This is a full-stack auction web application:
• Frontend: a React single-page application (SPA) in the auction-app folder.
• Backend: a Node.js + Express REST API in the auction-api folder.
• Purpose: allow users to register, log in, browse items, place bids, and process payments against an SQLite database.
File structure
• Top-level:
• auction-api/ (backend)
• auction-app/ (frontend)
• Root readme.md describing how to run both.
• auction-api:
• app.js – Express app entry point.
• routes/ – defines REST endpoints (users.js, items.js, payments.js).
• controllers/ – implements business logic per route.
• models/ – data-layer abstractions (e.g., item.js, user.js).
• dataBase/db.js & auction.db – SQLite connection and database file.
• auction-app:
• public/ – static HTML, manifest.
• src/ – React components and pages (LoginPage.js, Home.js, register.js, etc.), Redux store (store.js), actions (actions.js), plus CSS/tests.
README for additional insights
• Backend runs on Node/Express and exposes HTTP routes.
• Frontend runs on React and communicates via HTTP to localhost:PORT.
• No external services beyond the SQLite file and potential payment provider placeholder.
a. Main components
• Frontend SPA (React + Redux)
• Backend API server (Express)
• Database (SQLite file)
• Optional external payment gateway (placeholder for real payment service)
b. Relationships & interactions
• React UI issues HTTP requests (GET/POST/PUT) → Express routes
• Express routes call controllers → controllers call models → models query SQLite
• Controllers return JSON to frontend
• Frontend updates Redux store and re-renders UI
c. Architectural patterns & principles
• Separation of Concerns: UI vs. API vs. Data
• MVC-style on backend:
• Routes (routing)
• Controllers (business logic)
• Models (data access)
• Unidirectional data flow on frontend: React components ← Redux store ← actions
d. Key technologies/frameworks
• Frontend: React, Redux, React Router (if used), Webpack/CRA
• Backend: Node.js, Express, sqlite3
• Data persistence: SQLite