A modern, responsive Contact Management Web Application built with the MERN stack (MongoDB, Express.js, React.js, Node.js). Perfect for internships, portfolios, or production-ready contact forms.
Live Preview: click here
| Desktop View | Mobile View |
|---|---|
![]() |
![]() |
Replace placeholders with actual screenshots (e.g., from npm run build or tools like Vercel).
- β Contact Form: Client + server-side validation (name, email, phone required; email format check)
- π Contact List: Real-time fetch, optimistic updates
- π Search & Filter: Search by name/email/phone; Sort (newest/oldest/A-Z/Z-A)
- π¨ Dual Views: Toggle between Table & Card layouts
- ποΈ Delete Contacts: Confirmation modal + optimistic UI
- π± Fully Responsive: Mobile-first design (Tailwind CSS)
- π Modern UI/UX:
- Toast notifications
- Skeleton loaders
- Smooth animations & transitions
- Empty states with illustrations
- Gradient backgrounds & shadows
- β‘ Performance: useState/useEffect only (no Redux), instant UI updates
- π Secure: Backend validation, CORS, proper error handling
- βοΈ Cloud-Ready: MongoDB Atlas support (no local MongoDB needed)
| Frontend | Backend | Database | Styling | Other |
|---|---|---|---|---|
| React 18+ (Vite) | Node.js + Express | MongoDB (Mongoose) | Tailwind CSS | CORS, dotenv, nodemon |
No TypeScript, Redux, Next.js, Firebase β Pure MERN fundamentals as per requirements.
contact-manager/
βββ backend/
β βββ config/ # DB connection
β βββ models/ # Mongoose schemas
β βββ controllers/ # Business logic
β βββ routes/ # API routes
β βββ server.js # Entry point
β βββ .env # Environment vars
βββ frontend/
βββ src/
β βββ components/ # Reusable UI (Form, List, Toast, Modal)
β βββ api.js # API calls
β βββ App.jsx # Main app
β βββ main.jsx # Entry
βββ index.html
βββ vite.config.js
βββ tailwind.config.js
βββ package.json
- Node.js (v18+)
- MongoDB Atlas account (free tier)
- Git
# Clone the repo
git clone <https://github.com/owsam22/contact-management-system>
cd contact-manager
# Backend setup
cd backend
npm install
# Frontend setup
cd ../frontend
npm installPORT=5000
MONGO_URI=mongodb+srv://<user>:<password>@cluster0.abcde.mongodb.net/contact_manager?retryWrites=true&w=majority
CLIENT_ORIGIN=http://localhost:5173Get MONGO_URI: MongoDB Atlas β Connect β Drivers β Copy & replace credentials.
VITE_API_BASE_URL=http://localhost:5000-
Start Backend (Terminal 1):
cd backend npm run devServer running on port 5000+MongoDB connected -
Start Frontend (Terminal 2):
cd frontend npm run devOpens
http://localhost:5173 -
Open Browser:
http://localhost:5173
Production Build:
cd frontend
npm run build # Creates /dist folder| Method | Endpoint | Description |
|---|---|---|
POST |
/api/contacts |
Create new contact |
GET |
/api/contacts |
Get all contacts (sorted newest first) |
DELETE |
/api/contacts/:id |
Delete contact by ID |
Example Request (POST):
{
"name": "John Doe",
"email": "john@example.com",
"phone": "9876543210",
"message": "Hello!"
}{
name: { type: String, required: true, trim: true },
email: { type: String, required: true, trim: true },
phone: { type: String, required: true, trim: true },
message: { type: String, default: "", trim: true },
createdAt: { type: Date, default: Date.now },
updatedAt: { type: Date, default: Date.now }
}- Desktop: Side-by-side form + list (3-col grid)
- Tablet: Stacked with responsive tables
- Mobile: Full-width cards, touch-friendly buttons
| Issue | Solution |
|---|---|
querySrv ENOTFOUND |
URL-encode password (@ β %40), check Atlas IP whitelist |
| CORS error | Verify CLIENT_ORIGIN in .env |
| Form not submitting | Check browser console + backend logs |
| No data in Atlas | Verify MONGO_URI + create /contact_manager DB |
| Tailwind not working | npm install + restart dev server |
Logs: Check browser DevTools (F12) & backend terminal.
- Push to GitHub.
- Set
MONGO_URI+PORTin env vars. npm start.
npm run build
# Deploy /dist folderSet VITE_API_BASE_URL=https://your-backend.com.
- Fork the repo.
- Create a feature branch (
git checkout -b feature/AmazingFeature). - Commit changes (
git commit -m 'Add some AmazingFeature'). - Push & PR.
This project is MIT licensed.
Your Name
LinkedIn | Portfolio | GitHub
Built for MERN Stack Internship Assessment β

