Skip to content

[Under Development] A simple, fast, and secure way to organize all your personal and professional contacts in one place.

Notifications You must be signed in to change notification settings

msalahz/contactory

Repository files navigation

πŸ“‡ Contactory

A simple, fast and secure Contactory management application that helps users organize all their personal and professional/ contacts in one place.

πŸ”— Live Demo


πŸ“‘ Table of Contents


✨ Features

Feature Status Description
Authentication βœ… Implemented Secure signup, signin, password reset and session management
Theme Support 🚧 In Progress Dark/light mode with system preference detection
Organize Contacts πŸ“… Coming Soon CRUD operations for contacts
Search & Filter πŸ“… Coming Soon Real-time search with advanced filtering
Sync πŸ“… Coming Soon Cross-device synchronization
Share πŸ“… Coming Soon Share contacts via link, email or messaging
Import/Export πŸ“… Coming Soon CSV, vCard and JSON support
Groups/Labels πŸ“… Coming Soon Custom groups with color coding
Favorites πŸ“… Coming Soon Quick access to important contacts
Duplicate Detection πŸ“… Coming Soon Find and merge duplicate contacts
QR Code Sharing πŸ“… Coming Soon Share contact info via scannable QR code
Internationalization πŸ“… Coming Soon Bilingual support (English/Arabic) with RTL/LTR layout

πŸ› οΈ Tech Stack

Core

Technology Purpose
TypeScript Type-safe JavaScript
Vite Build tool & dev server
TanStack Start Full-stack React framework
React 19 UI library

Data & State

Technology Purpose
TanStack Router Type-safe routing
TanStack Query Data fetching & caching
TanStack Store State management
TanStack Form Form handling
Drizzle ORM Database ORM (PostgreSQL)
Zod Schema validation

UI/UX

Technology Purpose
Tailwind CSS 4 Utility-first styling
shadcn/ui Component library
Radix UI Accessible primitives
Lucide React Icons
Sonner Toast notifications
next-themes Theme management
CVA Component variants

Authentication

Technology Purpose
better-auth Auth library

Testing & Quality

Technology Purpose
Vitest Unit testing
Testing Library Component testing
ESLint Linting
Prettier Code formatting

πŸ“ Project Structure

contactory/
β”œβ”€β”€ .github/                       # GitHub configuration
β”‚   β”œβ”€β”€ copilot-instructions.md    # Copilot code generation guidelines
β”‚   β”œβ”€β”€ git-commit-instructions.md # Commit message conventions
β”‚   └── workflows/
β”‚       └── ci.yml                 # CI/CD pipeline configuration
β”œβ”€β”€ docs/                          # Documentation
β”‚   β”œβ”€β”€ ADR-001-tech-stack.md      # Architecture decision record
β”‚   └── PRD.md                     # Product requirements document
β”œβ”€β”€ drizzle/                       # Database migrations
β”‚   └── meta/                      # Migration metadata
β”œβ”€β”€ public/                        # Static assets
β”‚   β”œβ”€β”€ favicon.svg
β”‚   β”œβ”€β”€ manifest.json
β”‚   └── robots.txt
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ db/                        # Database configuration
β”‚   β”‚   β”œβ”€β”€ index.ts               # Database client
β”‚   β”‚   └── schemas/               # Drizzle ORM schemas
β”‚   β”‚       β”œβ”€β”€ auth.ts            # Auth-related tables
β”‚   β”‚       └── contacts.ts        # Contact tables
β”‚   β”œβ”€β”€ features/                  # Feature modules
β”‚   β”‚   β”œβ”€β”€ abstractions/          # Shared UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ primitives/    # Base UI components (button, input, etc.)
β”‚   β”‚   β”‚   β”‚   └── reused/        # Composite components (header, footer, etc.)
β”‚   β”‚   β”‚   └── lib/               # Utility functions
β”‚   β”‚   β”‚       β”œβ”€β”€ storage.ts       # cn() and helpers
β”‚   β”‚   β”‚       └── utils.test.ts  # Unit tests
β”‚   β”‚   └── users/                 # User feature module
β”‚   β”‚       β”œβ”€β”€ components/        # Auth forms
β”‚   β”‚       └── functions/         # Server functions
β”‚   β”œβ”€β”€ integrations/              # Third-party integrations
β”‚   β”‚   β”œβ”€β”€ better-auth/           # Auth integration
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.ts            # Server auth config
β”‚   β”‚   β”‚   β”œβ”€β”€ auth-client.ts     # Client auth config
β”‚   β”‚   β”‚   β”œβ”€β”€ hooks/             # Auth mutations
β”‚   β”‚   β”‚   └── middlewares/       # Auth middlewares
β”‚   β”‚   β”œβ”€β”€ tanstack-form/         # Form integration
β”‚   β”‚   β”‚   β”œβ”€β”€ components/        # Form field components
β”‚   β”‚   β”‚   └── hooks/             # useAppForm hook
β”‚   β”‚   └── tanstack-query/        # Query integration
β”‚   β”‚       β”œβ”€β”€ root-provider.tsx  # Query client provider
β”‚   β”‚       └── devtools.tsx       # Query devtools
β”‚   β”œβ”€β”€ routes/                    # TanStack Router routes
β”‚   β”‚   β”œβ”€β”€ __root.tsx             # Root layout
β”‚   β”‚   β”œβ”€β”€ index.tsx              # Home page
β”‚   β”‚   β”œβ”€β”€ _auth/                 # Auth layout routes
β”‚   β”‚   β”‚   β”œβ”€β”€ signin.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ signup.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ forgot-password.tsx
β”‚   β”‚   β”‚   └── reset-password.tsx
β”‚   β”‚   β”œβ”€β”€ api/auth/              # Auth API routes
β”‚   β”‚   └── console/               # Protected routes
β”‚   β”œβ”€β”€ env.ts                     # Type-safe environment variables
β”‚   β”œβ”€β”€ router.tsx                 # Router configuration
β”‚   β”œβ”€β”€ routeTree.gen.ts           # Auto-generated route tree
β”‚   └── styles.css                 # Global styles
β”œβ”€β”€ components.json                # shadcn/ui config
β”œβ”€β”€ drizzle.config.ts              # Drizzle ORM config
β”œβ”€β”€ eslint.config.js               # ESLint config
β”œβ”€β”€ package.json                   # Dependencies & scripts
β”œβ”€β”€ prettier.config.js             # Prettier config
β”œβ”€β”€ tsconfig.json                  # TypeScript config
└── vite.config.ts                 # Vite config

πŸš€ Getting Started

Prerequisites

  • Node.js 20+
  • pnpm 9+
  • PostgreSQL database

Installation

# Clone the repository
git clone https://github.com/your-username/contactory.git
cd contactory

# Install dependencies
pnpm install

Environment Variables

Copy the example environment file and configure your variables:

cp .env.example .env.local

Then fill in the required environment variables:

Variable Description Required
DATABASE_URL PostgreSQL connection string βœ…
BETTER_AUTH_SECRET Secret key for authentication βœ…
BETTER_AUTH_URL Base URL of your app (e.g., http://localhost:3000) βœ…
BETTER_AUTH_ENABLE_OPENAPI Enable OpenAPI docs (true for dev, false for prod) ❌
VITE_BETTER_AUTH_BASE_URL Client-side base URL of your app βœ…

Running the App

# Run database migrations
pnpm db:migrate

# Start the development server
pnpm dev

The app will be running at http://localhost:3000.


πŸ“œ Scripts

Script Description
pnpm dev Start development server (port 3000)
pnpm build Build for production
pnpm serve Preview production build
pnpm test Run unit tests
pnpm lint Lint codebase
pnpm format Format code with Prettier
pnpm check Format and lint with auto-fix
pnpm typecheck Run TypeScript type checking
pnpm db:generate Generate database migrations
pnpm db:migrate Run database migrations
pnpm db:push Push schema changes to database
pnpm db:studio Open Drizzle Studio

πŸ“– Documentation

Project Documentation

Document Description
Product Requirements (PRD) Feature specifications, user stories and requirements
Tech Stack ADR Architecture decision record explaining technology choices

GitHub Configuration

File Description
Copilot Instructions Code generation guidelines and project conventions for GitHub Copilot
Git Commit Instructions Conventional commit message format and guidelines
CI Workflow GitHub Actions workflow for linting, testing and building

CI/CD Pipeline

The project uses GitHub Actions for continuous integration. The pipeline runs on every push and pull request to main:

  • Linting – ESLint code quality checks
  • Formatting – Prettier format verification
  • Type Check – TypeScript type validation
  • Tests – Vitest unit test execution
  • Build – Production build verification

πŸ“¦ Dependencies

Production

Package Version Description
react ^19.2.1 UI library
react-dom ^19.2.1 React DOM renderer
@tanstack/react-start ^1.132.0 Full-stack React framework
@tanstack/react-router ^1.132.0 Type-safe routing
@tanstack/react-query ^5.66.5 Data fetching & caching
@tanstack/react-form ^1.0.0 Form handling
@tanstack/react-store ^0.7.0 State management
drizzle-orm ^0.39.0 Database ORM
pg ^8.11.0 PostgreSQL client
better-auth ^1.4.5 Authentication library
zod ^4.1.11 Schema validation
tailwindcss ^4.0.6 CSS framework
class-variance-authority ^0.7.1 Component variants
clsx ^2.1.1 Class name utility
tailwind-merge ^3.0.2 Tailwind class merging
@radix-ui/* various Accessible UI primitives
lucide-react ^0.544.0 Icon library
sonner ^2.0.7 Toast notifications
next-themes ^0.4.6 Theme management
@t3-oss/env-core ^0.13.8 Type-safe env variables
uuid ^13.0.0 UUID generation

Development

Package Version Description
typescript ^5.7.2 TypeScript compiler
vite ^7.1.7 Build tool
vitest ^3.0.5 Test runner
@testing-library/react ^16.2.0 Component testing
eslint ^9.39.1 Linting
prettier ^3.5.3 Code formatting
drizzle-kit ^0.30.0 Drizzle CLI tools
@netlify/vite-plugin-tanstack-start ^1.2.2 Netlify deployment

πŸ“„ License

This project is private.