Skip to content

Contact Manager is a simple and responsive web application built to manage and organize your personal or professional contacts. It allows users to add, update, delete, and search contacts efficiently. Built with modern web technologies and a minimal UI for a seamless experience.

License

Notifications You must be signed in to change notification settings

Mrtracker-new/Contact-manager

Repository files navigation

πŸ“± Contact Manager

A modern, privacy-focused contact management application built with React, TypeScript, and Capacitor. Designed for organizing and managing personal and professional contacts with ease across all platforms.

Contact Manager Version Platform


πŸš€ Author

Rolan - Always learning, always building


πŸ“‹ Table of Contents


✨ Features

🎯 Core Features

  • Contact Management: Create, edit, delete, and organize contacts
  • Smart Search: Fuzzy search with advanced filtering capabilities
  • Profile Pictures: Upload and manage contact photos with automatic compression
  • Custom Fields: Add unlimited custom fields for each contact
  • Tags System: Organize contacts with colorful tags
  • Notes & Links: Attach notes and external links to contacts
  • File Attachments: Attach documents, images, and files to contacts

πŸ”’ Privacy & Security

  • Offline-First: All data stored locally using IndexedDB
  • Data Encryption: Optional AES encryption for backups
  • Privacy-Focused: No external servers, complete data ownership
  • Secure Backups: Export encrypted backups with password protection

🌐 Cross-Platform Support

  • Web Application: PWA with offline capabilities
  • Mobile Apps: Native Android and iOS apps via Capacitor
  • Desktop Ready: Electron and Tauri compatibility
  • Responsive Design: Optimized for all screen sizes

🎨 User Experience

  • Dark/Light Mode: System-aware theme switching
  • Modern UI: Clean, intuitive interface with smooth animations
  • Touch-Friendly: Optimized for mobile interactions
  • Keyboard Shortcuts: Efficient navigation for power users

πŸ—οΈ Architecture Overview

graph TB
    subgraph "Frontend Layer"
        A[React 18 + TypeScript]
        B[Tailwind CSS]
        C[React Router]
        D[Zustand State Management]
    end
    
    subgraph "Data Layer"
        E[IndexedDB via Dexie]
        F[Local Storage]
        G[File System Access]
    end
    
    subgraph "Cross-Platform Layer"
        H[Capacitor Core]
        I[Web APIs]
        J[Native Plugins]
    end
    
    subgraph "Build System"
        K[Vite]
        L[TypeScript Compiler]
        M[PWA Plugin]
        N[Capacitor CLI]
    end
    
    A --> E
    A --> H
    H --> I
    H --> J
    K --> A
    K --> M
    N --> H
Loading

Data Flow Architecture

sequenceDiagram
    participant U as User
    participant C as Component
    participant S as Store (Zustand)
    participant DB as Database Service
    participant IDB as IndexedDB
    
    U->>C: User Action
    C->>S: Update State
    S->>DB: Database Operation
    DB->>IDB: Query/Mutation
    IDB-->>DB: Result
    DB-->>S: Response
    S-->>C: State Update
    C-->>U: UI Update
Loading

πŸ“ Project Structure

contact-manager/
β”œβ”€β”€ πŸ“ src/
β”‚   β”œβ”€β”€ πŸ“ components/          # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ AttachmentSection.tsx
β”‚   β”‚   β”œβ”€β”€ FloatingActionButton.tsx
β”‚   β”‚   β”œβ”€β”€ Layout.tsx
β”‚   β”‚   β”œβ”€β”€ LinkSection.tsx
β”‚   β”‚   β”œβ”€β”€ MobileNavigation.tsx
β”‚   β”‚   β”œβ”€β”€ NoteCard.tsx
β”‚   β”‚   β”œβ”€β”€ NoteSection2.tsx
β”‚   β”‚   β”œβ”€β”€ ProfilePicture.tsx
β”‚   β”‚   β”œβ”€β”€ SaveIndicator.tsx
β”‚   β”‚   β”œβ”€β”€ SearchInput.tsx
β”‚   β”‚   β”œβ”€β”€ Sidebar.tsx
β”‚   β”‚   └── TopBar.tsx
β”‚   β”œβ”€β”€ πŸ“ pages/               # Main application pages
β”‚   β”‚   β”œβ”€β”€ ContactDetail.tsx   # Contact view/edit page
β”‚   β”‚   β”œβ”€β”€ ContactList.tsx     # Main contacts listing
β”‚   β”‚   β”œβ”€β”€ NewContact.tsx      # Contact creation form
β”‚   β”‚   β”œβ”€β”€ Search.tsx          # Advanced search page
β”‚   β”‚   └── Settings.tsx        # App settings & preferences
β”‚   β”œβ”€β”€ πŸ“ db/                  # Database layer
β”‚   β”‚   └── database.ts         # Dexie configuration & operations
β”‚   β”œβ”€β”€ πŸ“ store/               # State management
β”‚   β”‚   └── useStore.ts         # Zustand store configuration
β”‚   β”œβ”€β”€ πŸ“ services/            # Business logic services
β”‚   β”‚   └── attachments.service.ts
β”‚   β”œβ”€β”€ πŸ“ utils/               # Utility functions
β”‚   β”‚   β”œβ”€β”€ fileOpener.ts       # File handling utilities
β”‚   β”‚   β”œβ”€β”€ index.ts            # Export/import utilities
β”‚   β”‚   └── mobileFileUtils.ts  # Mobile file operations
β”‚   β”œβ”€β”€ πŸ“ types/               # TypeScript type definitions
β”‚   β”‚   β”œβ”€β”€ index.ts            # Core type definitions
β”‚   β”‚   └── tauri.d.ts          # Tauri-specific types
β”‚   β”œβ”€β”€ πŸ“ plugins/             # Capacitor plugins
β”‚   β”‚   └── index.ts            # Plugin registrations
β”‚   β”œβ”€β”€ App.tsx                 # Main application component
β”‚   β”œβ”€β”€ main.tsx                # Application entry point
β”‚   └── index.css               # Global styles
β”œβ”€β”€ πŸ“ android/                 # Android-specific files
β”œβ”€β”€ πŸ“ dist/                    # Built application files
β”œβ”€β”€ πŸ“ public/                  # Static assets
β”œβ”€β”€ capacitor.config.ts         # Capacitor configuration
β”œβ”€β”€ package.json                # Project dependencies
β”œβ”€β”€ tailwind.config.js          # Tailwind CSS configuration
β”œβ”€β”€ tsconfig.json               # TypeScript configuration
β”œβ”€β”€ vite.config.ts              # Vite build configuration
└── README.md                   # This file

πŸ› οΈ Tech Stack

Frontend Framework

  • React 18: Latest React with Concurrent Features
  • TypeScript: Type-safe development
  • Vite: Lightning-fast build tool
  • Tailwind CSS: Utility-first CSS framework

State Management & Data

  • Zustand: Lightweight state management
  • Dexie: IndexedDB wrapper for offline storage
  • React Router: Client-side routing

Cross-Platform Development

  • Capacitor: Native mobile app development
  • PWA: Progressive Web App capabilities
  • Workbox: Service worker management

UI/UX Libraries

  • Lucide React: Beautiful icons
  • React Hot Toast: Elegant notifications
  • React Dropzone: File upload handling
  • Fuse.js: Fuzzy search functionality

Development Tools

  • ESLint: Code linting
  • Prettier: Code formatting
  • Vitest: Unit testing framework

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/Mrtracker-new/Contact-manager.git
    cd contact-manager
  2. Install dependencies

    npm install
  3. Start development server

    npm run dev
  4. Open in browser

    http://localhost:5173
    

Build for Production

# Build web application
npm run build

# Preview production build
npm run preview

Mobile Development

  1. Add mobile platforms

    # Add Android
    npx cap add android
    
    # Add iOS (macOS only)
    npx cap add ios
  2. Build and sync

    npm run build
    npx cap sync
  3. Open in native IDE

    # Android Studio
    npx cap open android
    
    # Xcode (macOS only)
    npx cap open ios

🌍 Platform Support

Platform Status Features
Web Browser βœ… Full Support PWA, Offline, File System API
Android βœ… Full Support Native file access, Share integration
iOS βœ… Full Support Native file access, Share integration
Electron πŸ”„ Compatible Desktop file operations
Tauri πŸ”„ Compatible Rust-based desktop app

Web Features

  • Progressive Web App (PWA)
  • Offline functionality
  • File System Access API
  • Web Share API
  • Push notifications (planned)

Mobile Features

  • Native file system access
  • Share integration
  • Camera access for profile pictures
  • Biometric authentication (planned)
  • Background sync (planned)

πŸ—„οΈ Database Design

Entity Relationship Diagram

erDiagram
    CONTACT {
        int id PK
        string name
        string email
        string phone
        date birthday
        string profilePicture
        boolean isFavorite
        json customFields
        json tags
        datetime createdAt
        datetime updatedAt
    }
    
    NOTE {
        int id PK
        int contactId FK
        string title
        string content
        datetime createdAt
        datetime updatedAt
    }
    
    LINK {
        int id PK
        int contactId FK
        string title
        string url
        string description
        datetime createdAt
    }
    
    ATTACHMENT {
        int id PK
        int contactId FK
        string name
        string type
        int size
        string mimeType
        blob data
        string thumbnail
        datetime createdAt
    }
    
    SETTINGS {
        string key PK
        json value
        datetime updatedAt
    }
    
    CONTACT ||--o{ NOTE : has
    CONTACT ||--o{ LINK : has
    CONTACT ||--o{ ATTACHMENT : has
Loading

Database Schema

Contacts Table

interface Contact {
  id?: number;
  name: string;
  email?: string;
  phone?: string;
  birthday?: Date;
  profilePicture?: string;
  isFavorite: boolean;
  customFields: CustomField[];
  tags: string[];
  createdAt: Date;
  updatedAt: Date;
}

Notes Table

interface Note {
  id?: number;
  contactId: number;
  title: string;
  content: string;
  createdAt: Date;
  updatedAt: Date;
}

Links Table

interface Link {
  id?: number;
  contactId: number;
  title: string;
  url: string;
  description?: string;
  createdAt: Date;
}

Attachments Table

interface Attachment {
  id?: number;
  contactId: number;
  name: string;
  type: 'document' | 'image' | 'video' | 'other';
  size: number;
  mimeType: string;
  data?: Blob | ArrayBuffer | string;
  filePath?: string;
  thumbnail?: string;
  createdAt: Date;
}

πŸ”§ API Reference

Database Operations

Contacts API

// Get all contacts
const contacts = await db.contacts.toArray();

// Get contact by ID
const contact = await db.contacts.get(id);

// Create contact
const id = await db.contacts.add(contact);

// Update contact
await db.contacts.update(id, updates);

// Delete contact
await db.contacts.delete(id);

// Search contacts
const results = await db.contacts
  .filter(contact => contact.name.includes(query))
  .toArray();

Export/Import API

// Export data
const data = await dbOperations.exportData();

// Import data
await dbOperations.importData(data);

// Export to Excel
await exportUtils.downloadExcel(data, filename);

// Import from Excel
const data = await exportUtils.readExcelFile(file);

Attachment Service API

// Get contact attachments
const attachments = await getContactAttachments(contactId);

// Add attachment
const result = await addAttachment(contactId, files);

// Delete attachment
await deleteAttachment(attachmentId);

// Open file
const result = await openFile(attachment);

// Share file
const result = await shareFile(attachment);

πŸš€ Deployment

Web Deployment (Netlify/Vercel)

  1. Build the project

    npm run build
  2. Deploy the dist folder to your hosting platform

Android Deployment

  1. Build the app

    npm run build
    npx cap sync android
  2. Generate signed APK

    cd android
    ./gradlew assembleRelease

iOS Deployment

  1. Build the app

    npm run build
    npx cap sync ios
  2. Open in Xcode and archive

    npx cap open ios

Docker Deployment

FROM node:18-alpine

WORKDIR /app
COPY package*.json ./
RUN npm install

COPY . .
RUN npm run build

EXPOSE 5173
CMD ["npm", "run", "preview"]

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Add tests if applicable
  5. Commit your changes
    git commit -m 'Add amazing feature'
  6. Push to your fork
    git push origin feature/amazing-feature
  7. Open a Pull Request

Code Style

  • Use TypeScript for all new code
  • Follow ESLint rules
  • Use Prettier for formatting
  • Write tests for new features
  • Update documentation as needed

πŸ“Š Performance Metrics

Metric Value
Bundle Size < 2MB
First Load < 3s
Lighthouse Score 95+
Offline Support 100%
PWA Score Perfect

πŸ”’ Security Features

  • Client-side encryption for sensitive data
  • No external tracking or analytics
  • Secure file handling with validation
  • XSS protection via React
  • Content Security Policy headers
  • Input sanitization throughout

πŸ› Known Issues & Limitations

  • Large files: Attachments > 50MB may cause performance issues
  • iOS Safari: Some file operations limited by browser restrictions
  • Older browsers: IE11 not supported, Chrome 90+ recommended

πŸ“ˆ Roadmap

Version 1.0 (Mar30)

  • Real-time sync across devices
  • Advanced contact grouping
  • Backup scheduling
  • Theme customization

Version 2.0 (July 25)

  • Calendar integration
  • Task management
  • Email integration
  • API for third-party integrations
  • Advanced search filters

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • React Team for the amazing framework
  • Capacitor Team for cross-platform capabilities
  • Tailwind CSS for the utility-first approach
  • Dexie.js for excellent IndexedDB wrapper
  • Lucide for beautiful icons

πŸ“ž Support


Made with ❀️ by Rolan

Always learning, always building

About

Contact Manager is a simple and responsive web application built to manage and organize your personal or professional contacts. It allows users to add, update, delete, and search contacts efficiently. Built with modern web technologies and a minimal UI for a seamless experience.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published