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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“‡ Contactory

A modern, type-safe contact management application built with TanStack Start, React 19, and Drizzle ORM. Organize all your personal and professional contacts in one secure place with a beautiful, responsive interface.

πŸ”— Live Demo


πŸ“‘ Table of Contents


✨ Features

Feature Status Description
Authentication βœ… Implemented Secure signup, signin, password reset with better-auth
Theme Support βœ… Implemented Dark/light mode with system preference detection
Organize Contacts 🚧 In Progress CRUD operations for contacts (basic structure in place)
Favorites 🚧 In Progress Mark and manage favorite 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
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 with RTL/LTR layout

πŸ› οΈ Tech Stack

Core

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

Data & State

Technology Purpose
TanStack Router Type-safe routing
TanStack Query Data fetching & caching
TanStack Store State management & theme
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
class-variance-authority Component variants
tailwind-merge Merge Tailwind classes

Authentication

Technology Purpose
better-auth Authentication & session management
@t3-oss/env-core Environment validation

Deployment

Technology Purpose
Cloudflare Workers Edge deployment
Wrangler Cloudflare CLI tool

Development Tools

Technology Purpose
Vitest Unit testing framework
Testing Library Component testing
ESLint Code linting
Prettier Code formatting
Drizzle Kit Database migrations
React Email Email templates
Resend Email delivery service
Motion Animation library

πŸ“ Project Structure

contactory/
β”œβ”€β”€ .github/                       # GitHub configuration
β”‚   β”œβ”€β”€ workflows/
β”‚   β”‚   └── ci.yml                # CI/CD pipeline configuration
β”œβ”€β”€ docs/                          # Documentation
β”‚   β”œβ”€β”€ ADR-001-tech-stack.md      # Architecture decision record
β”‚   β”œβ”€β”€ ADR-002-file-structure.md  # Project structure decisions
β”‚   β”œβ”€β”€ ADR-003-internationalization.md  # i18n architecture (proposed)
β”‚   β”œβ”€β”€ PRD.md                     # Product requirements document
β”‚   └── SECURITY-AUDIT.md          # Security audit findings
β”œβ”€β”€ public/                        # Static assets
β”‚   β”œβ”€β”€ favicon.svg
β”‚   └── robots.txt
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ features/                  # Feature modules
β”‚   β”‚   β”œβ”€β”€ auth/                  # Authentication feature
β”‚   β”‚   β”‚   β”œβ”€β”€ components/        # Auth UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ hooks/             # Auth hooks
β”‚   β”‚   β”‚   └── lib/               # Auth utilities
β”‚   β”‚   β”œβ”€β”€ landing/               # Landing page feature
β”‚   β”‚   β”‚   └── components/        # Landing page components
β”‚   β”‚   └── users/                 # User management feature
β”‚   β”‚       β”œβ”€β”€ components/        # User UI components
β”‚   β”‚       β”œβ”€β”€ hooks/             # User hooks
β”‚   β”‚       β”œβ”€β”€ lib/               # User utilities
β”‚   β”‚       └── utils/             # User helper functions
β”‚   β”œβ”€β”€ integrations/              # Third-party integrations
β”‚   β”‚   β”œβ”€β”€ better-auth/           # Auth configuration
β”‚   β”‚   β”œβ”€β”€ shadcn/                # UI components
β”‚   β”‚   β”œβ”€β”€ tanstack-form/         # Form handling
β”‚   β”‚   └── tanstack-query/        # Data fetching
β”‚   β”œβ”€β”€ routes/                    # Application routes
β”‚   β”‚   β”œβ”€β”€ __root.tsx             # Root layout
β”‚   β”‚   β”œβ”€β”€ _auth/                 # Auth routes (sign-in, sign-up, etc.)
β”‚   β”‚   β”‚   β”œβ”€β”€ sign-in.tsx        # Sign in page
β”‚   β”‚   β”‚   β”œβ”€β”€ sign-up.tsx        # Sign up page
β”‚   β”‚   β”‚   β”œβ”€β”€ forgot-password.tsx # Password reset request
β”‚   β”‚   β”‚   └── reset-password.tsx # Password reset form
β”‚   β”‚   β”œβ”€β”€ _public/               # Public routes (landing page)
β”‚   β”‚   β”œβ”€β”€ _user/                 # Protected routes (authenticated users)
β”‚   β”‚   β”‚   β”œβ”€β”€ route.tsx          # User layout + auth guard
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard.tsx      # Main dashboard view
β”‚   β”‚   β”‚   β”œβ”€β”€ contacts.tsx       # Contacts management
β”‚   β”‚   β”‚   └── profile.tsx        # User profile page
β”‚   β”‚   β”œβ”€β”€ _admin/                # Admin routes (admin users only)
β”‚   β”‚   └── api/                   # API endpoints
β”‚   β”œβ”€β”€ server/                    # Server-side code
β”‚   β”‚   β”œβ”€β”€ db/                    # Database configuration
β”‚   β”‚   β”‚   β”œβ”€β”€ client.ts          # Drizzle DB client
β”‚   β”‚   β”‚   β”œβ”€β”€ migrations/        # Database migrations
β”‚   β”‚   β”‚   └── seeds.ts           # Seed data for development
β”‚   β”‚   β”œβ”€β”€ emails/                # Email templates
β”‚   β”‚   β”œβ”€β”€ middlewares/           # Server middlewares
β”‚   β”‚   β”œβ”€β”€ modules/               # Business logic modules
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.ts            # Auth business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ guards.ts          # Route guards
β”‚   β”‚   β”‚   β”œβ”€β”€ r2.ts              # Cloudflare R2 storage
β”‚   β”‚   β”‚   β”œβ”€β”€ theme.ts           # Theme management
β”‚   β”‚   β”‚   └── users.ts           # User business logic
β”‚   β”‚   β”œβ”€β”€ mutations/             # Server mutation functions
β”‚   β”‚   β”œβ”€β”€ queries/               # Server query functions
β”‚   β”‚   └── schemas/               # Validation schemas
β”‚   └── shared/                    # Shared utilities and components
β”‚       β”œβ”€β”€ components/            # Reusable components
β”‚       β”œβ”€β”€ theme/                 # Theme configuration
β”‚       └── utils/                 # Utility functions
β”œβ”€β”€ .env.example                   # Example environment variables
β”œβ”€β”€ 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 +14

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/contactory.git
    cd contactory
  2. Install dependencies:

    pnpm install
  3. Set up environment variables:

    cp .env.example .env.local

    Update the .env.local file with your configuration.

  4. Run database migrations:

    pnpm db:migrate
  5. Start the development server:

    pnpm dev

    The application will be available at http://localhost:3000

Environment Variables

Variable Description Required Default
DATABASE_URL PostgreSQL connection string βœ… -
BETTER_AUTH_SECRET Secret key for authentication βœ… -
BETTER_AUTH_URL Base URL of your app βœ… http://localhost:3000
BETTER_AUTH_GOOGLE_CLIENT_ID Google OAuth client ID ❌ -
BETTER_AUTH_GOOGLE_CLIENT_SECRET Google OAuth client secret ❌ -
RESEND_API_KEY API key for Resend email service ❌ -
VITE_BETTER_AUTH_BASE_URL Client-side base URL of your app βœ…

πŸ“œ 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 test:workers Run Cloudflare Workers 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:pull Pull schema from database
pnpm db:studio Open Drizzle Studio
pnpm db:seeds Run database seed script
pnpm deploy Build and deploy to Cloudflare Workers
pnpm cf-typegen Generate Cloudflare Workers types

πŸ“– Documentation

Project Documentation

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

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.3 UI library
react-dom ^19.2.3 React DOM renderer
@tanstack/react-start ^1.145.7 Full-stack React framework
@tanstack/react-router ^1.145.7 Type-safe routing
@tanstack/react-query ^5.90.16 Data fetching & caching
@tanstack/react-form ^1.27.7 Form handling
@tanstack/react-store ^0.7.7 State management & theme
drizzle-orm ^0.45.1 Database ORM
postgres ^3.4.7 PostgreSQL client
better-auth ^1.4.10 Authentication library
zod ^4.3.5 Schema validation
tailwindcss ^4.1.18 CSS framework
class-variance-authority ^0.7.1 Component variants
clsx ^2.1.1 Class name utility
tailwind-merge ^3.4.0 Tailwind class merging
radix-ui ^1.4.3 Accessible UI primitives
lucide-react ^0.544.0 Icon library
motion ^12.24.0 Animation library
@t3-oss/env-core ^0.13.10 Type-safe env variables
uuid ^13.0.0 UUID generation

Development

Package Version Description
typescript ^5.9.3 TypeScript compiler
vite ^7.3.0 Build tool
vitest ^3.2.4 Test runner
@testing-library/react ^16.3.1 Component testing
eslint ^9.39.2 Linting
prettier ^3.7.4 Code formatting
drizzle-kit ^0.31.8 Drizzle CLI tools
@cloudflare/vite-plugin ^1.17.1 Cloudflare Workers plugin
wrangler ^4.54.0 Cloudflare CLI

πŸ“„ License

This project is private.