How vwzn/contact-management works
Project Type & Purpose
• This is a full-stack contact management web application.
• Frontend: React + Vite + Tailwind CSS.
• Backend: Node.js + Express + Prisma ORM + MySQL.
• Purpose: CRUD operations on contacts and addresses, user authentication, search/filter, bulk operations.
File Structure
• Top-level: /frontend and /backend.
• Frontend:
• src/components/… holds UI components (forms, cards, lists).
• src/lib/api/*Api.js encapsulates REST calls to backend.
• main.jsx is the React entry point; vite.config.js and tailwind.config.js are build/styling setups.
• Backend (implied by README):
• src/main.js — Express server setup.
• src/route/… — route definitions.
• src/controller/… — route handlers.
• src/service/… — business logic.
• src/validation/… and src/middleware/… — input validation and cross-cutting concerns.
• prisma/schema.prisma + migrations — DB schema.
README for Additional Insights
• MERN stack, RESTful API at /api, running on port 3000.
• MySQL database via Prisma.
• React client runs on Vite dev server (port 5173).
• Features: user auth (login/register), contacts + addresses CRUD, smart search, theming.
a. Main Components:
1. Browser (User’s UI)
2. React Single-Page App (Vite Dev Server / Static Host)
3. REST API Layer (Express.js)
4. Business Logic Layer (Services, Validation, Middleware)
5. Data Access Layer (Prisma ORM)
6. MySQL Database
7. Optional External Services (e.g., email service or analytics)
b. Relationships & Data Flows:
• Browser ↔ React SPA (HTTP)
• React SPA ↔ Express API (HTTP calls via AddressApi, ContactApi, UserApi)
• Express API invokes middleware → controllers → services → Prisma → MySQL
• Prisma ↔ MySQL (SQL connection over network)
• Environment (ENV variables) feeding into server startup
c. Architectural Patterns & Principles:
• Layered architecture (Presentation → API → Service → Data Access → Database)
• Separation of concerns (UI vs. API vs. DB)
• RESTful design (resource-based endpoints)
• Client-side routing (React Router)
• ORM abstraction (Prisma)
d. Key Technologies & Frameworks:
• Frontend: React, React Router, Vite, Tailwind CSS
• Backend: Node.js, Express.js, Prisma
• Database: MySQL
Essential Elements
Browser → React → API → Controllers → Services → Prisma → MySQL, and backflow for responses.