A modern, full-stack contact management application built with Express.js, MongoDB, React, and Tailwind CSS. Features a beautiful, responsive UI with complete CRUD operations and user authentication.
- User registration and login
- JWT-based authentication
- Protected routes
- Secure password handling
- Create new contacts with name, email, and phone
- Read and view all contacts with search functionality
- Update existing contact information
- Delete contacts with confirmation modal
- Search contacts by name, email, or phone number
- Modern, dark-themed design with glassmorphism effects
- Fully responsive layout (mobile-first design)
- Beautiful gradient backgrounds and animations
- Toast notifications for user feedback
- Loading states and error handling
- Intuitive navigation with React Router
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM for MongoDB
- JWT - Authentication tokens
- bcrypt - Password hashing
- CORS - Cross-origin resource sharing
- Express Async Handler - Error handling
- React 18 - UI library
- Vite - Build tool and dev server
- React Router DOM - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- Axios - HTTP client
- Lucide React - Icon library
- React Hot Toast - Notifications
- Frontend: https://my-contact-cyan.vercel.app
- Backend API: https://mycontact-rltg.onrender.com
- Node.js (v16 or higher)
- MongoDB Atlas account or local MongoDB
- Git
git clone https://github.com/AaronKurian/MyContact
cd express-projectcd backend
npm installCreate .env file in the backend directory:
PORT=5001
CONNECTION_STRING=mongodb+srv://username:password@cluster.mongodb.net/mycontacts-backend?retryWrites=true&w=majority
ACCESS_TOKEN_SECRET=your-secret-key
FRONTEND_URL=http://localhost:5173Start the backend server:
npm start
# or for development
npm run devcd ../frontend
npm installCreate .env file in the frontend directory:
VITE_API_URL=http://localhost:5001Start the frontend development server:
npm run devMyContact/
βββ backend/
β βββ config/
β β βββ dbConnection.js
β βββ controllers/
β β βββ contactController.js
β β βββ userController.js
β βββ middleware/
β β βββ errorHandler.js
β β βββ validateTokenHandler.js
β βββ models/
β β βββ contactModel.js
β β βββ userModel.js
β βββ routes/
β β βββ contactRoutes.js
β β βββ userRoutes.js
β βββ constants.js
β βββ server.js
β βββ package.json
β βββ .env
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ LoadingSpinner.jsx
β β β βββ Navbar.jsx
β β β βββ ProtectedRoute.jsx
β β βββ context/
β β β βββ AuthContext.jsx
β β βββ pages/
β β β βββ ContactDetails.jsx
β β β βββ ContactForm.jsx
β β β βββ Contacts.jsx
β β β βββ Dashboard.jsx
β β β βββ Login.jsx
β β β βββ Register.jsx
β β βββ services/
β β β βββ api.js
β β βββ App.jsx
β β βββ index.css
β β βββ main.jsx
β βββ index.html
β βββ package.json
β βββ tailwind.config.js
β βββ vite.config.js
β βββ .env
βββ README.md
POST /api/users/register- Register new userPOST /api/users/login- User loginGET /api/users/current- Get current user info
GET /api/contacts- Get all contactsPOST /api/contacts- Create new contactGET /api/contacts/:id- Get contact by IDPUT /api/contacts/:id- Update contactDELETE /api/contacts/:id- Delete contact
- Desktop: Full layout with sidebar navigation and detailed views
- Tablet: Optimized spacing and button sizes
- Mobile: Compact design with collapsible elements and touch-friendly interface
- Real-time search across contact names, emails, and phone numbers
- Debounced input for optimal performance
- Clear visual feedback for search results
- JWT tokens stored in localStorage
- Automatic token validation and refresh
- Protected routes redirect to login when unauthenticated
- Context-based user state management
- Glassmorphism design with backdrop blur effects
- Smooth animations and transitions
- Consistent color scheme and typography
- Interactive hover states and micro-animations
- Password hashing with bcrypt
- JWT token-based authentication
- CORS configuration for secure cross-origin requests
- Input validation and sanitization
- Protected API routes with middleware
- Environment variable usage for sensitive data
- Global error handler middleware
- Try-catch blocks for async operations
- User-friendly error messages
- Toast notifications for user feedback
- Loading states for better UX
- Touch-friendly interface design
- Responsive grid layouts
- Optimized button sizes for mobile
- Collapsible navigation elements
- Fast loading and smooth scrolling
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ by Aaron Kurian Abraham