How gopikapamisetty/mini-ecommerce works
Project type and purpose
• This is a full-stack “Mini Commerce” web application.
• Frontend: React + Vite + Tailwind (components, Redux store).
• Backend: Express.js REST API + PostgreSQL (via a .env-configured connection).
• Purpose: Allow users to view, create, and edit products.
File structure
• Top-level “Backend” and “Frontend” directories indicate a clear separation of concerns.
• Backend:
• server.js: entry point, sets up Express, middleware, routes.
• controllers/: business logic for products.
• models/: product schema and ORM/mapping.
• db/index.js: database connection setup.
• routes/: URL endpoints mapping to controllers.
• .env: holds DB credentials and port.
• Frontend:
• src/: React app source.
• components/: UI components (ProductList, ProductForm, EditProduct, Navbar, etc.).
• components/ui/: design system primitives (button, input, table, etc.).
• redux/store.js: global state management, API slice.
• public/dist & Vite config: build output and bundler settings.
• .env: holds REACT_APP_API_URL.
README for additional insights
• Express server runs on port 5000 by default.
• Frontend dev server runs on port 3000 (default Vite) and proxies to the backend via REACT_APP_API_URL.
• No extra microservices or external integrations—just one Postgres instance.
Detail
• Environment variables feeding into each side.
• Data flow for key use cases (e.g., Add Product, Edit Product, List Products).