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
- Features
- Tech Stack
- Project Structure
- Getting Started
- Scripts
- Code Review Workflows
- Documentation
- Dependencies
- License
| Feature | Status | Description |
|---|---|---|
| Authentication | β Implemented | Secure signup, signin, password reset with better-auth |
| Theme Support | β Implemented | Dark/light mode with system preference detection |
| Internationalization | β Implemented | Bilingual support with RTL/LTR layout |
| 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 |
| 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 |
| 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 |
| 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 |
| Technology | Purpose |
|---|---|
| better-auth | Authentication & session management |
| @t3-oss/env-core | Environment validation |
| Technology | Purpose |
|---|---|
| Cloudflare Workers | Edge deployment |
| Wrangler | Cloudflare CLI tool |
| 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 |
contactory/
βββ .github/ # GitHub configuration
β βββ workflows/
β β βββ ci.yml # CI/CD pipeline configuration
βββ docs/ # Documentation
β βββ project-overview.md # Product vision, features, requirements
β βββ project-architecture.md # Technical stack, patterns, guidelines
βββ public/ # Static assets
β βββ favicon.svg
β βββ robots.txt
βββ specs/ # Feature specifications
β βββ 001-contacts-crud/ # Contacts CRUD feature spec
βββ src/
β βββ backend/ # Server-only code
β β βββ lib/ # Business logic modules
β β β βββ auth.ts # Auth business logic
β β β βββ contacts.ts # Contacts business logic
β β β βββ storage.ts # File storage logic
β β β βββ theme.ts # Theme management
β β βββ middlewares/ # Server middlewares
β β βββ mutations/ # Server mutation functions (RPCs)
β β β βββ auth.ts # Auth mutations
β β β βββ contacts.ts # Contacts mutations
β β βββ queries/ # Server query functions (RPCs)
β β β βββ auth.ts # Auth queries
β β β βββ contacts.ts # Contacts queries
β β βββ utils/ # Server utilities
β βββ core/ # Core/reusable code
β β βββ components/ # Shared UI components
β β βββ locales/ # i18n translations
β β βββ theme/ # Theme system
β β βββ utils/ # Utility functions
β β βββ schemas.ts # Zod schemas & TypeScript types
β βββ features/ # Client feature modules
β β βββ auth/ # Authentication feature
β β β βββ components/ # Auth UI components
β β β βββ hooks/ # Auth hooks
β β β βββ lib/ # Auth utilities
β β βββ contacts/ # Contacts management feature
β β β βββ components/ # Contacts UI components
β β β βββ hooks/ # Contacts hooks
β β β βββ lib/ # Contacts utilities
β β β βββ keys.ts # Query keys factory
β β β βββ options.ts # Query options factory
β β βββ landing/ # Landing page feature
β β βββ components/ # Landing page components
β βββ integrations/ # Third-party integrations
β β βββ better-auth/ # Authentication config
β β βββ drizzle/ # Drizzle client, migrations, seeds, config
β β βββ i18n/ # Internationalization setup
β β βββ resend/ # Email integration & templates
β β βββ shadcn/ # UI components
β β βββ tanstack-form/ # Form handling
β β βββ tanstack-query/ # Query client setup
β βββ routes/ # File-based routing
β β βββ __root.tsx # Root layout with providers
β β βββ _auth/ # Unauthenticated routes
β β β βββ 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)
β β βββ _user/ # Protected user routes
β β β βββ route.tsx # User layout + auth guard
β β β βββ dashboard.tsx # Main dashboard view
β β β βββ contacts/ # Contacts routes
β β β β βββ index.tsx # Contacts list
β β β β βββ new.tsx # Create contact sheet
β β β β βββ $contactId.tsx # Contact detail sheet
β β β β βββ $contactId.edit.tsx # Edit contact sheet
β β β βββ profile.tsx # User profile page
β β βββ _admin/ # Admin-only routes
β βββ start.ts # TanStack Start configuration
β βββ style.css # Global styles with Tailwind CSS
β βββ env.client.ts # Client environment variables
β βββ env.server.ts # Server environment variables
β βββ router.tsx # TanStack Router configuration
βββ .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
- Node.js 20+
- pnpm 9+
- PostgreSQL +14
-
Clone the repository:
git clone https://github.com/your-username/contactory.git cd contactory -
Install dependencies:
pnpm install
-
Set up environment variables:
cp .env.example .env.local
Update the
.env.localfile with your configuration. -
Run database migrations:
pnpm db:migrate
-
Start the development server:
pnpm dev
The application will be available at
http://localhost:3000
| 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 | β |
| 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 |
This repo includes Claude/Windsurf workflows under .windsurf/workflows/ prefixed with
code-review*. These workflows follow a multi-agent code review approach (constitution
compliance, bug detection, security, performance) and use confidence scoring to reduce false
positives.
-
Project-wide review:
code-review.project- Use when: You want an overall health report for the repo.
- Examples:
code-review.projectcode-review.project quickcode-review.project focus:security
-
Pull request review:
code-review.pr- Use when: Reviewing a GitHub PR via
gh. - Examples:
code-review.prcode-review.pr 123
- Use when: Reviewing a GitHub PR via
-
Git diff review:
code-review.git- Use when: Reviewing local changes without a PR.
- Examples:
code-review.gitcode-review.git stagedcode-review.git unstagedcode-review.git HEAD~3code-review.git commit1..commit2
-
Pre-commit staged review:
code-review.staged- Use when: Quick gate-style check before committing.
- Examples:
code-review.stagedcode-review.staged --strict
-
Feature-scope review:
code-review.feature- Use when: Deep review for a feature folder (architecture, UX/i18n consistency, tests).
- Examples:
code-review.feature authcode-review.feature src/features/users
-
Single-file review:
code-review.file- Use when: You want detailed, line-by-line feedback for one file.
- Examples:
code-review.file src/router.tsx
- Code Quality: TypeScript strictness, lint/format consistency, error handling patterns
- Testing: coverage gaps and test quality for changes
- UX Consistency: i18n usage, accessibility, consistent shadcn/ui patterns
- Performance: expensive imports, unnecessary re-renders, route loading patterns
- Security: secrets, authz/authn correctness, input validation
- Project Overview - Product vision, features, requirements
- Project Architecture - High-level project structure and design decisions
- Contactory Constitution - Mandatory standards for code quality, testing, UX, and performance
| 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
| 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 |
| 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 |
This project is private.