Contact List Client
Vue.js contact management application with RESTful API integration
Share this project:
Project Overview
Contact List Client
A modern contact management application built with Vue.js and Vite, featuring a clean interface for managing personal or professional contacts. This client-side application integrates seamlessly with a RESTful API backend for complete CRUD operations.
📋 Overview
Contact List Client is a frontend application that provides an intuitive interface for managing contacts. Built with Vue.js 3 and powered by Vite for lightning-fast development, this application demonstrates modern frontend development practices and API integration patterns.
✨ Features
-
Complete Contact Management
- Add new contacts with detailed information
- View all contacts in an organized list
- Update existing contact details
- Delete contacts with confirmation
-
Modern User Interface
- Clean and responsive design
- Smooth transitions and animations
- Mobile-friendly layout
- Intuitive user experience
-
Real-time Data
- Instant updates via API integration
- Optimistic UI updates
- Error handling and user feedback
-
Search and Filter
- Quick contact search functionality
- Filter contacts by categories
- Sort contacts alphabetically
🛠️ Technologies Used
- Vue.js 3: Progressive JavaScript framework
- Vite: Next-generation frontend tooling
- JavaScript (ES6+): Modern JavaScript features
- Axios/Fetch: HTTP client for API requests
- Vue Router: Client-side routing
- Composables: Vue 3 composition API patterns
📁 Project Structure
contact_list_client/
├── src/
│ ├── components/ # Vue components
│ │ ├── ContactList.vue
│ │ ├── ContactForm.vue
│ │ └── ContactItem.vue
│ ├── views/ # Page views
│ ├── router/ # Route configurations
│ ├── services/ # API service layer
│ ├── composables/ # Reusable composition functions
│ ├── assets/ # Static assets
│ ├── App.vue # Root component
│ └── main.js # Application entry point
├── public/ # Public static files
├── index.html # HTML template
├── package.json # Dependencies and scripts
└── vite.config.js # Vite configuration
🔗 Backend Requirements
Important: This client application requires a backend server to function properly.
The backend API server is available at: contact_list_server
Make sure the server is running before starting the client application.
🚀 Getting Started
Prerequisites
- Node.js 16.x or higher
- npm or yarn package manager
- Backend server running (see link above)
Installation Steps
-
Clone the repository
git clone <repository-url> cd contact_list_client -
Install dependencies
Standard installation:
npm installIf you encounter peer dependency issues:
npm install --legacy-peer-deps -
Configure API Endpoint
Create a
.envfile in the root directory:VITE_API_URL=http://localhost:3000/apiAdjust the URL to match your backend server address.
-
Start the backend server
Follow the instructions in the backend repository to start the API server.
-
Run the development server
npm run dev -
Access the application
Open your browser and navigate to:
http://localhost:5173(Port may vary - check the console output)
💻 Usage Guide
Adding a Contact
- Click the "Add Contact" button
- Fill in the contact form:
- Name (required)
- Phone number
- Address
- Additional notes
- Click "Save" to create the contact
Viewing Contacts
- All contacts are displayed in the main list view
- Each contact card shows essential information
- Click on a contact to view full details
Editing a Contact
- Click the "Edit" button on a contact card
- Modify the desired fields in the form
- Click "Update" to save changes
- Changes are immediately reflected in the list
Deleting a Contact
- Click the "Delete" button on a contact card
- Confirm the deletion in the popup dialog
- Contact is removed from the list
Searching Contacts
- Use the search bar at the top
- Type name, email, or phone number
- Results update in real-time as you type
🔧 Development
Available Scripts
# Start development server with hot-reload
npm run dev
# Build for production
npm run build
# Preview production build locally
npm run preview
# Run linter
npm run lint
# Fix linting issues
npm run lint:fix
Project Configuration
Edit vite.config.js to customize:
- Build options
- Development server settings
- Plugin configurations
- Path aliases
📡 API Integration
API Endpoints Used
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/contacts |
Fetch all contacts |
| GET | /api/contacts/:id |
Fetch single contact |
| POST | /api/contacts |
Create new contact |
| PUT | /api/contacts/:id |
Update contact |
| DELETE | /api/contacts/:id |
Delete contact |
Example API Service
// src/services/contactService.js
import axios from 'axios'
const API_URL = import.meta.env.VITE_API_URL
export const contactService = {
getAllContacts: () => axios.get(`${API_URL}/contacts`),
getContact: (id) => axios.get(`${API_URL}/contacts/${id}`),
createContact: (data) => axios.post(`${API_URL}/contacts`, data),
updateContact: (id, data) => axios.put(`${API_URL}/contacts/${id}`, data),
deleteContact: (id) => axios.delete(`${API_URL}/contacts/${id}`)
}
🎨 Customization
Styling
The application uses scoped styles in Vue components. To customize:
- Edit component-specific styles in
.vuefiles - Modify global styles in
src/assets/main.css - Configure theme variables
Adding Features
Popular extensions:
- Contact categories/groups
- Import/export contacts
- Contact avatars
- Advanced search filters
- Bulk operations
- Contact sharing
🐛 Troubleshooting
Common Issues
-
Cannot connect to API
- Verify backend server is running
- Check API URL in
.envfile - Ensure CORS is properly configured on backend
-
npm install errors
- Try
npm install --legacy-peer-deps - Clear npm cache:
npm cache clean --force - Delete
node_modulesandpackage-lock.json, then reinstall
- Try
-
Port already in use
- Change port in
vite.config.js:
export default { server: { port: 3001 } } - Change port in
-
Hot reload not working
- Restart development server
- Check file watcher limits (Linux)
- Verify Vite configuration
🚀 Deployment
Build for Production
npm run build
This creates an optimized build in the dist/ folder.
Deployment Options
- Vercel: Automatic deployment from Git
- Netlify: Drag-and-drop or Git integration
- GitHub Pages: Static hosting
- AWS S3: With CloudFront CDN
- Any static hosting: Serve the
dist/folder
Environment Variables for Production
Update .env.production:
VITE_API_URL=https://your-production-api.com/api
🤝 Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
📄 License
This project is open source and available for educational and commercial use.
🔗 Related Projects
- Backend API: contact_list_server
Built with ❤️ using Vue.js and Vite