A personal relationship memory app that helps couples keep track of each other's preferences, requests, and special moments. Built with Next.js 15, Cloudflare Workers AI, and PostgreSQL.
Couple Memory is a private PWA designed for two users (in this case, Wendy and Daniel) to:
- 📝 Save notes about each other's preferences, requests, and important details
- 🤖 Chat with an AI assistant that has context of all saved notes and can answer questions like "What did Wendy ask me to remember?" or "Does Daniel like sushi?"
- 💾 Save conversations (optional) - chats are ephemeral by default, but can be saved for later reference
- 📱 Install as a mobile app via PWA support with iOS "Add to Home Screen" prompt
- Framework: Next.js 15 (App Router)
- AI: Cloudflare Workers AI (Llama 3.1 8B Instruct)
- Database: PostgreSQL with Drizzle ORM
- Styling: Tailwind CSS 4 + shadcn/ui
- Auth: Simple session-based authentication with cookies
- Node.js 18+ or Bun
- PostgreSQL database
- Cloudflare account (for Cloudflare Workers AI)
git clone https://github.com/StringerBell69/cf_ai_couple-connect.git
cd cf_ai_couple-connectbun install
# or
npm installCopy the example environment file:
cp .env.example .env.localThen edit .env.local with your credentials:
# PostgreSQL database URL
DATABASE_URL=postgres://user:password@host:5432/couple_connect
# Cloudflare Workers AI credentials
CLOUDFLARE_ACCOUNT_ID=your_account_id
CLOUDFLARE_API_TOKEN=your_api_token- Go to Cloudflare Dashboard
- Your Account ID is in the URL or on the right sidebar of any page
- Create an API Token at API Tokens:
- Click "Create Token"
- Use "Workers AI" template or create custom with
Workers AI: Readpermission
Push the schema to your database:
bun run db:push
# or
npm run db:push(Optional) Seed the database with initial users:
npx tsx src/db/seed.tsThis creates two users:
- Wendy (password:
wendy123) - Daniel (password:
daniel123)
bun dev
# or
npm run devOpen http://localhost:3000 in your browser.
Log in as either Wendy or Daniel using the credentials above.
- Add notes about your partner's preferences, requests, or important details
- Notes are tagged with your name automatically
- Both users can see all notes
- Ask the AI questions about your saved notes
- The AI has full context of all notes and knows who you are
- Examples:
- "What does Wendy want for her birthday?"
- "Did I promise Daniel anything recently?"
- "What are our favorite restaurants?"
- Toggle the save button (disk icon) in the header to persist conversations
- Access saved conversations via the history button (clock icon)
- By default, chats are ephemeral and cleared on refresh
├── app/
│ ├── api/
│ │ ├── auth/ # Login/logout endpoints
│ │ ├── chat/ # AI chat endpoint (Cloudflare Workers AI)
│ │ ├── conversations/ # Conversation CRUD endpoints
│ │ └── notes/ # Notes CRUD endpoints
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Main app page
├── components/
│ ├── contexts/ # React contexts (Auth, Notes, Conversations)
│ ├── ui/ # shadcn/ui components
│ ├── ChatView.tsx # Chat interface
│ ├── NotesView.tsx # Notes interface
│ └── ...
└── src/
└── db/
├── db.ts # Database connection
├── schema.ts # Drizzle schema
└── seed.ts # Seed script
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/login |
User login |
| POST | /api/auth/logout |
User logout |
| GET | /api/notes |
Get all notes |
| POST | /api/notes |
Create a note |
| DELETE | /api/notes |
Delete a note |
| POST | /api/chat |
Send message to AI |
| GET | /api/conversations |
Get user's conversations |
| DELETE | /api/conversations |
Delete a conversation |
| GET | /api/conversations/[id] |
Get messages for a conversation |
This is a personal project, but feel free to fork and adapt it for your own couple!
MIT