π Live Demo: https://contact-manager-chethan-2025-c4aef6398bf1.herokuapp.com/
π± Features Available:
- β Modern Dark UI - Beautiful minimalistic design with glassmorphism effects
- β User Authentication - Secure JWT-based login/registration
- β Contact Management - Full CRUD operations with real-time updates
- β Responsive Design - Works seamlessly on desktop, tablet, and mobile
- β 15-70-15 Layout - Optimized spacing for better user experience
- β Auto-Sleep Optimization - Cost-effective hosting with 30-min auto-sleep
- Visit: Contact Manager App
- Register: Create your account with username, email, and password
- Login: Access your personal contact dashboard
- Manage Contacts: Add, edit, search, and organize your contacts
A comprehensive full-stack Contact Manager application with modern dark UI and secure user authentication, built with Node.js, Express.js, MongoDB, and vanilla JavaScript.
- π¨ Modern Dark Theme: Minimalistic design with glassmorphism effects
- π± Responsive Layout: 15-70-15 optimized layout for all devices
- π Secure Authentication: JWT-based user registration and login
- π Contact Management: Intuitive CRUD operations with real-time feedback
- π Search Functionality: Real-time contact search and filtering
- π« Smooth Animations: Professional transitions and hover effects
- π€ User Dashboard: Personalized welcome with contact statistics
- User Authentication: Secure user registration and login with JWT tokens
- Contact Management: Full CRUD operations for contacts
- User-Specific Data: Each user can only access their own contacts
- Password Security: Passwords are hashed using bcrypt
- MongoDB Integration: Persistent data storage with Mongoose ODM
- Error Handling: Comprehensive error handling with custom middleware
- Input Validation: Server-side validation for all endpoints
- Environment Configuration: Secure configuration management with dotenv
- π Live on Heroku: Professional hosting with auto-sleep for cost optimization
- π HTTPS Secured: Free SSL certificate for secure connections
- ποΈ Cloud Database: MongoDB Atlas integration for reliable data storage
- π Monitoring: Real-time logs and performance tracking
- HTML5: Semantic markup with modern structure
- CSS3: Custom dark theme with glassmorphism effects and responsive design
- JavaScript (ES6+): Vanilla JavaScript for API integration and DOM manipulation
- Bootstrap 5.3.2: Component framework for responsive UI
- Font Awesome: Professional icons for enhanced UX
- Backend: Node.js, Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JSON Web Tokens (JWT)
- Password Hashing: bcrypt
- Environment Management: dotenv
- Development: nodemon for auto-restart
- Frontend & Backend: Heroku (with auto-sleep optimization)
- Database: MongoDB Atlas (Free 512MB tier)
- SSL: Heroku automatic HTTPS
- Domain:
.herokuapp.comsubdomain
Before running this application, make sure you have the following installed:
git clone https://github.com/7Chethan007/ContactManagerApp.git
cd ContactManagerAppnpm installCreate a .env file in the root directory:
PORT=5000
CONNECTION_STRING=mongodb+srv://username:password@cluster.mongodb.net/mycontacts-backend?retryWrites=true&w=majority
ACCESS_TOKEN_SECRET=your_super_secret_jwt_key_hereRequired Environment Variables:
PORT: Server port (default: 5000)CONNECTION_STRING: MongoDB connection URIACCESS_TOKEN_SECRET: Secret key for JWT token generation
Development mode (with auto-restart):
npm run devProduction mode:
npm startThe server will start on http://localhost:5000
http://localhost:5000/api
- URL:
/users/register - Method:
POST - Access: Public
- Body:
{
"username": "johndoe",
"email": "john@example.com",
"password": "securepassword123"
}- Success Response:
201 Created
{
"_id": "user_id",
"username": "johndoe",
"email": "john@example.com"
}- URL:
/users/login - Method:
POST - Access: Public
- Body:
{
"email": "john@example.com",
"password": "securepassword123"
}- Success Response:
200 OK
{
"accessToken": "jwt_token_here"
}- URL:
/users/current - Method:
GET - Access: Private (requires Bearer token)
- Headers:
Authorization: Bearer <jwt_token> - Success Response:
200 OK
{
"_id": "user_id",
"username": "johndoe",
"email": "john@example.com"
}Note: All contact endpoints require authentication (Bearer token in Authorization header)
- URL:
/contacts - Method:
GET - Access: Private
- Success Response:
200 OK
[
{
"_id": "contact_id",
"name": "Jane Smith",
"email": "jane@example.com",
"phone": "123-456-7890",
"user_id": "user_id",
"createdAt": "2025-09-20T08:30:00Z",
"updatedAt": "2025-09-20T08:30:00Z"
}
]- URL:
/contacts - Method:
POST - Access: Private
- Body:
{
"name": "Jane Smith",
"email": "jane@example.com",
"phone": "123-456-7890"
}- Success Response:
201 Created
- URL:
/contacts/:id - Method:
GET - Access: Private
- Success Response:
200 OK
- URL:
/contacts/:id - Method:
PUT - Access: Private
- Body: (any combination of name, email, phone)
{
"name": "Jane Doe",
"email": "jane.doe@example.com"
}- Success Response:
200 OK
- URL:
/contacts/:id - Method:
DELETE - Access: Private
- Success Response:
200 OK
This API uses JWT (JSON Web Tokens) for authentication. After logging in, include the token in the Authorization header:
Authorization: Bearer <your_jwt_token>
ContactManagerApp/
βββ frontend/ # Frontend application
β βββ css/
β β βββ style.css # Dark theme with glassmorphism effects
β βββ js/
β β βββ app.js # Contact management logic
β βββ index.html # Single-page application
βββ config/
β βββ dbConnection.js # Database connection configuration
βββ controllers/
β βββ contactController.js # Contact CRUD operations
β βββ userController.js # User authentication logic
βββ middleware/
β βββ errorHandler.js # Global error handling
β βββ validateTokenHandler.js # JWT token validation
βββ models/
β βββ contactModel.js # Contact schema
β βββ userModel.js # User schema
βββ routes/
β βββ contactRoutes.js # Contact API routes
β βββ userRoutes.js # User API routes
βββ .env # Environment variables (not committed)
βββ .gitignore # Git ignore file
βββ netlify.toml # Netlify configuration (if needed)
βββ Procfile # Heroku process file
βββ constants.js # HTTP status constants
βββ package.json # Project dependencies
βββ server.js # Application entry point
βββ API_TESTING.md # Complete API testing documentation
βββ DEPLOYMENT.md # Deployment guide
βββ README.md # Project documentation
All API endpoints have been thoroughly tested using Thunder Client with comprehensive test cases covering:
- User Authentication (Register, Login, Current User)
- Contact CRUD Operations (Create, Read, Update, Delete)
- Error Handling (404, 400, 401 error scenarios)
- Authorization & Security (JWT token validation)
| Category | Tests | Status |
|---|---|---|
| User Management | 3 endpoints | β All Passing |
| Contact Operations | 5 endpoints | β All Passing |
| Error Scenarios | 4 test cases | β All Passing |
| Total | 12 test cases | β 100% Success |
For detailed API testing results with screenshots, request/response examples, and step-by-step testing guides:
π Complete API Testing Documentation
The testing documentation includes:
- Screenshot gallery of all test results
- Complete request/response examples
- Error handling demonstrations
- Thunder Client setup instructions
- cURL command examples
The API includes comprehensive error handling with appropriate HTTP status codes:
- 400 Bad Request: Missing required fields or validation errors
- 401 Unauthorized: Invalid or missing authentication token
- 403 Forbidden: Access denied to resource
- 404 Not Found: Resource not found
- 500 Internal Server Error: Server-side errors
Error responses follow this format:
{
"title": "Error Type",
"message": "Detailed error message",
"stackTrace": "Stack trace (in development)"
}| Variable | Description | Required | Default |
|---|---|---|---|
PORT |
Server port | No | 5000 |
CONNECTION_STRING |
MongoDB URI | Yes | - |
ACCESS_TOKEN_SECRET |
JWT secret key | Yes | - |
- Local MongoDB: Install MongoDB locally and use
mongodb://localhost:27017/contactmanager - MongoDB Atlas: Create a cluster and use the provided connection string
- Docker: Use MongoDB Docker container
- URL: https://contact-manager-chethan-2025-c4aef6398bf1.herokuapp.com/
- Status: β Live and Operational
- Hosting: Heroku with cost-effective auto-sleep
- Database: MongoDB Atlas (Free Tier)
- SSL: HTTPS enabled with free certificate
- Free Heroku Dynos: 550 hours/month (sufficient for personal projects)
- Auto-Sleep: App automatically sleeps after 30 minutes of inactivity
- Free MongoDB Atlas: 512MB storage with high availability
- Zero Monthly Cost: Perfect for portfolio and demo projects
# Login to Heroku
npx heroku login
# Create Heroku app
npx heroku create contact-manager-chethan-2025
# Set environment variables
npx heroku config:set CONNECTION_STRING="mongodb+srv://admin:admin@chethancluster.yedmyoh.mongodb.net/mycontacts-backend"
npx heroku config:set ACCESS_TOKEN_SECRET="chethan_contact_manager_jwt_secret_2025"
# Deploy application
git push heroku main
# Open live app
npx heroku open --app contact-manager-chethan-2025# Check app status
npx heroku ps --app contact-manager-chethan-2025
# View real-time logs
npx heroku logs --tail --app contact-manager-chethan-2025
# Check environment variables
npx heroku config --app contact-manager-chethan-2025- Create a Heroku app:
heroku create your-app-name- Set environment variables:
heroku config:set CONNECTION_STRING=your_mongodb_uri
heroku config:set ACCESS_TOKEN_SECRET=your_secret_key- Deploy:
git push heroku main- Connect your GitHub repository to Railway
- Add environment variables in Railway dashboard
- Deploy automatically
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Chethan M N
- π Live App: Contact Manager
- π GitHub: @7Chethan007
- πΌ LinkedIn: M N Chethan
- π§ Email: Contact
- ποΈ Repository: ContactManagerApp
- π¨ Full-Stack Development: Complete MERN-like application with modern UI
- π Security Implementation: JWT authentication with bcrypt password hashing
- π± Responsive Design: Mobile-first approach with 15-70-15 layout
- π Production Deployment: Live on Heroku with MongoDB Atlas
- π§ͺ Comprehensive Testing: 100% API endpoint coverage with documentation
- Express.js team for the amazing framework
- MongoDB team for the robust database
- JWT.io for authentication solution
- All contributors and supporters
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request successful |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request data |
| 401 | Unauthorized | Authentication required |
| 403 | Forbidden | Access denied |
| 404 | Not Found | Resource not found |
| 500 | Internal Server Error | Server error |
What you can do:
- Register your account in seconds
- Login and explore the beautiful dark UI
- Add contacts with name, email, and phone
- Search and manage your contact list
- Experience responsive design on any device
- π Live Demo: Contact Manager App
- π API Docs: Complete API Testing Guide
- π Deploy Guide: Deployment Documentation
- π Source Code: GitHub Repository
β If you found this project helpful, please give it a star! β
Made with β€οΈ by Chethan M N