Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/complete dark mode #12

Open
wants to merge 148 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
af9e3cc
Update page.tsx
carlvellotti Feb 15, 2025
fd680bc
Update page.tsx
carlvellotti Feb 15, 2025
9a43581
Delete route.ts
carlvellotti Feb 15, 2025
5ec983e
Delete route.ts
carlvellotti Feb 15, 2025
c57bd2f
Update page.tsx
carlvellotti Feb 15, 2025
0a0db9c
Update page.tsx
carlvellotti Feb 15, 2025
a8aad31
Add initial meme generator components
carlvellotti Feb 15, 2025
ca044d9
first draft
carlvellotti Feb 15, 2025
bd92f71
All the updates
carlvellotti Feb 16, 2025
39d7e72
Include video generation
carlvellotti Feb 16, 2025
5a1b8e4
Deploy fixes
carlvellotti Feb 16, 2025
94e4366
Deploy fixes
carlvellotti Feb 16, 2025
8bb0abb
Deploy fixes
carlvellotti Feb 16, 2025
00881bb
Update route.ts
carlvellotti Feb 16, 2025
2443c1a
deploy fixes?
carlvellotti Feb 16, 2025
2f05136
remove google auth
carlvellotti Feb 16, 2025
bebc2a4
deploy fixes???
carlvellotti Feb 16, 2025
5c40875
Update server.ts
carlvellotti Feb 16, 2025
ac566e7
Update route.ts
carlvellotti Feb 16, 2025
b4b78ae
Vector embedding!
carlvellotti Feb 18, 2025
eb23b21
Uploader improvements
carlvellotti Feb 19, 2025
ef8f254
Update page.tsx
carlvellotti Feb 19, 2025
cf6be1e
Update .eslintrc.json
carlvellotti Feb 19, 2025
f9e84f8
bug fixes
carlvellotti Feb 19, 2025
93c8d23
Added Anthropic
carlvellotti Feb 19, 2025
96a8283
bug fix
carlvellotti Feb 19, 2025
2244836
bug fix
carlvellotti Feb 19, 2025
f4c3431
another bug fix
carlvellotti Feb 19, 2025
cbffc1f
ANOTHER fix
carlvellotti Feb 19, 2025
7e1458c
Update route.ts
carlvellotti Feb 20, 2025
8fa5621
219417 fix
carlvellotti Feb 20, 2025
068a64d
error handling
carlvellotti Feb 20, 2025
b48920e
Update AIMemeSelector.tsx
carlvellotti Feb 20, 2025
5d67fd6
vector search!
carlvellotti Feb 20, 2025
b6b6fff
fix 219535
carlvellotti Feb 20, 2025
e963aa8
fix 219539
carlvellotti Feb 20, 2025
3c7e1f0
219542
carlvellotti Feb 20, 2025
6811dbb
Video download improvements
carlvellotti Feb 20, 2025
b286fa2
New prompts!
carlvellotti Feb 21, 2025
15d809c
Update prompts.ts
carlvellotti Feb 21, 2025
b31c0e8
fix
carlvellotti Feb 21, 2025
108bf21
issue fix
carlvellotti Feb 21, 2025
8fe0773
more fixes
carlvellotti Feb 21, 2025
cb9e37e
Updated prompt + download improvement
carlvellotti Feb 22, 2025
137a12e
Update route.ts
carlvellotti Feb 22, 2025
a9f2713
fix 906
carlvellotti Feb 22, 2025
6fea8a1
Add two template selection with separate captions for each
carlvellotti Feb 22, 2025
50b58ae
Fix TypeScript error in template mapping
carlvellotti Feb 22, 2025
acbd742
Merge pull request #1 from carlvellotti/feature/two-template-selection
carlvellotti Feb 22, 2025
50b3c75
feat: implement grid layout for template library
carlvellotti Feb 22, 2025
7e9552b
feat: reorganize template library and improve layouts
carlvellotti Feb 22, 2025
b280991
Merge pull request #2 from carlvellotti/feature/template-library-grid
carlvellotti Feb 22, 2025
88b2c62
UI: Standardize layout and styling across pages
carlvellotti Feb 22, 2025
becda7b
Merge pull request #3 from carlvellotti/feature/ui-consistency
carlvellotti Feb 22, 2025
a497b16
UI: Improve navigation responsiveness
carlvellotti Feb 22, 2025
351360d
Merge pull request #4 from carlvellotti/feature/mobile-nav
carlvellotti Feb 22, 2025
929992c
Fix meme video generation to include audio and correct duration
carlvellotti Feb 23, 2025
551e040
Merge pull request #5 from carlvellotti/fix/meme-video-audio
carlvellotti Feb 23, 2025
49afc07
Improve meme generator UI flow with persistent options
carlvellotti Feb 23, 2025
282d4e0
Fix TypeScript errors in MemeGenerator component
carlvellotti Feb 23, 2025
dfef0c6
Merge pull request #6 from carlvellotti/feature/meme-generator-ui-imp…
carlvellotti Feb 23, 2025
3a9800e
fix: remove timeout and video play/pause during meme download
carlvellotti Feb 23, 2025
5e01bf0
Merge pull request #7 from carlvellotti/fix/video-download-timing
carlvellotti Feb 23, 2025
e3c31ff
Add greenscreen support with background image replacement
carlvellotti Feb 23, 2025
07ed9d3
Fix import paths in BackgroundSelector
carlvellotti Feb 23, 2025
02bf9f0
Add live preview functionality for memes with greenscreen support
carlvellotti Feb 23, 2025
43ade89
Move greenscreen toggle to form section
carlvellotti Feb 23, 2025
3eacbd7
Improve meme generator layout and documentation
carlvellotti Feb 23, 2025
15c42b7
Merge pull request #9 from carlvellotti/feature/meme-preview-working
carlvellotti Feb 23, 2025
54c21f9
Add text customization features: alignment, font options, and line br…
carlvellotti Feb 23, 2025
1bc36d4
Fix TypeScript type error in text wrapping functions
carlvellotti Feb 23, 2025
5a0bbde
Merge pull request #10 from carlvellotti/feature/meme-editor-improvem…
carlvellotti Feb 23, 2025
f00ea2a
Add label system with documentation
carlvellotti Feb 23, 2025
8117128
Merge pull request #11 from carlvellotti/feature/meme-labels
carlvellotti Feb 23, 2025
9c0e0b1
Add proper Unsplash attribution links
carlvellotti Feb 24, 2025
8d66cf7
Fix: Update lodash import syntax
carlvellotti Feb 24, 2025
31381b9
Fix: Update lodash import to use require
carlvellotti Feb 24, 2025
8bd77e0
Fix: Reorganize imports and fix lodash import
carlvellotti Feb 24, 2025
25129c6
Fix: Switch to full lodash import for debounce functionality
carlvellotti Feb 24, 2025
fef810f
Fix: Replace lodash debounce with custom implementation
carlvellotti Feb 24, 2025
cbe7ae8
Add custom debounce utility and update imports
carlvellotti Feb 24, 2025
b904cc8
fix: update ImagePicker import path
carlvellotti Feb 24, 2025
4663a3a
trigger deploy after adding UNSPLASH_ACCESS_KEY
carlvellotti Feb 24, 2025
a49bc91
Merge pull request #12 from carlvellotti/feature/unsplash-attribution
carlvellotti Feb 24, 2025
45a3f95
Fix Unsplash download tracking to use download_location
carlvellotti Feb 24, 2025
c02be26
Merge pull request #13 from carlvellotti/fix/unsplash-download-tracking
carlvellotti Feb 24, 2025
e5fa1e8
Removed threshold filtering and cleaned up code
carlvellotti Feb 25, 2025
9bdbce4
Add text color and stroke weight customization for captions and labels
carlvellotti Feb 25, 2025
5617042
Fix type error with labelSettings color property
carlvellotti Feb 25, 2025
95a077c
Merge pull request #15 from carlvellotti/feature/text-customization
carlvellotti Feb 25, 2025
8d57dc2
Fix video processing issues with early stop implementation
carlvellotti Feb 26, 2025
3c3d439
Fix TypeScript error for HTMLAudioElement.captureStream
carlvellotti Feb 26, 2025
9dfab96
Fix Promise return type in videoProcessor
carlvellotti Feb 26, 2025
192740f
Merge pull request #16 from carlvellotti/fix-video-text-sync
carlvellotti Feb 26, 2025
fe0290d
Add 3D spinning orb animation for loading states
carlvellotti Feb 26, 2025
e2f6637
Fix null context error in SpinningOrb component
carlvellotti Feb 26, 2025
aadcbef
Merge pull request #17 from carlvellotti/feature/spinning-orb-loader
carlvellotti Feb 26, 2025
49ad1f3
Upgrade to Claude 3.7 Sonnet and improve prompt handling for meme gen…
carlvellotti Feb 27, 2025
a135db2
Merge pull request #18 from carlvellotti/feature/sonnet-upgrade-promp…
carlvellotti Feb 27, 2025
f4f6127
feat: add Claude 3.5 Sonnet option and update prompts
carlvellotti Feb 28, 2025
b81d697
Merge pull request #19 from carlvellotti/feature/update-prompts-add-s…
carlvellotti Feb 28, 2025
b30bad4
Fix Claude 3.5 Sonnet model ID and make it the default model for meme…
carlvellotti Feb 28, 2025
4bbc9cf
Trigger deployment
carlvellotti Feb 28, 2025
3fa2230
Merge pull request #20 from carlvellotti/fix/claude-3-5-sonnet
carlvellotti Feb 28, 2025
2fbf27b
trigger vercel deployment
carlvellotti Feb 28, 2025
8c0274e
Add BackgroundSVG component behind loading animations
carlvellotti Feb 28, 2025
c71b5a7
Update BackgroundSVG to use Vector.svg with hands
carlvellotti Feb 28, 2025
e1b658c
Adjust Vector SVG position to make orb float between hands
carlvellotti Feb 28, 2025
8e41431
Update SVG hands to black and enhance SpinningOrb with pulsating effe…
carlvellotti Feb 28, 2025
6471bb7
Enhance animation aesthetics: limit colors to green/blue/purple, lowe…
carlvellotti Feb 28, 2025
2ac9c34
Enhance animation: add pure blue colors, rename to 'Conjuring memes..…
carlvellotti Mar 1, 2025
4dce3af
Fix text positioning to prevent overlap with hands in loading animation
carlvellotti Mar 1, 2025
cabccda
Merge pull request #21 from carlvellotti/feature/svg-behind-loading-a…
carlvellotti Mar 1, 2025
2050d6d
improve: enhance meme prompt clarity regarding template captions
carlvellotti Mar 1, 2025
453cac5
Rename 'Meme Generator' to 'Meme Mage' throughout the application
carlvellotti Mar 1, 2025
8059440
Add wizard emoji favicon to browser tab
carlvellotti Mar 1, 2025
9586b35
Add magic wand icon as favicon
carlvellotti Mar 1, 2025
4e23af0
Fix favicon.png to use the magic wand image and clean up unused files
carlvellotti Mar 1, 2025
63dbb79
Add explicit favicon link tag and test HTML page
carlvellotti Mar 1, 2025
9bd2ec5
Attempted favicon fixes and added troubleshooting notes
carlvellotti Mar 1, 2025
2749e76
Merge pull request #22 from carlvellotti/improve-meme-prompt
carlvellotti Mar 1, 2025
8146ed3
Merge pull request #23 from carlvellotti/feature/rename-to-meme-mage
carlvellotti Mar 1, 2025
2761aa9
Add template-specific meme creation feature
carlvellotti Mar 1, 2025
7bcde6d
Fix template-specific meme creation flow to properly pass selected te…
carlvellotti Mar 1, 2025
55fb5f8
Fix API routing for template instructions update and add better error…
carlvellotti Mar 1, 2025
10a6940
Fix template-specific meme creation flow to properly pass selected te…
carlvellotti Mar 1, 2025
1fa5e98
Merge pull request #24 from carlvellotti/feature/template-specific-me…
carlvellotti Mar 1, 2025
d020b5f
Implement unique URLs for meme templates and simplify template select…
carlvellotti Mar 1, 2025
e79f719
Improve template browser UI with single-line titles, full video on ho…
carlvellotti Mar 1, 2025
81b41ca
Update template browser to expand cards in place on hover
carlvellotti Mar 1, 2025
e9e12d7
Improve template card hover effect with smooth downward expansion
carlvellotti Mar 1, 2025
95139b2
Improve template card animation with smooth bidirectional transitions
carlvellotti Mar 1, 2025
b2b8ff2
Fix template card closing animation with improved transition timing
carlvellotti Mar 1, 2025
31f07bb
Merge pull request #25 from carlvellotti/feature/template-unique-urls
carlvellotti Mar 1, 2025
0fff7d0
Improve attribution system for Unsplash images: clean UI, conditional…
carlvellotti Mar 2, 2025
0f81dd0
Fix: Update UnsplashImage interface to include social fields with ins…
carlvellotti Mar 2, 2025
347b257
Fix type error for instagram_username in attribution
carlvellotti Mar 2, 2025
7135820
Fix attribution display in production build
carlvellotti Mar 2, 2025
3c5b6a6
Merge pull request #26 from carlvellotti/improved-attribution
carlvellotti Mar 2, 2025
cc7bf43
Fix template display issue by adding refresh functionality and preven…
carlvellotti Mar 2, 2025
041bb7c
Update TEMPLATE_SPECIFIC_FLOW.md to document refresh functionality an…
carlvellotti Mar 2, 2025
45161a7
Empty commit to trigger redeploy
carlvellotti Mar 2, 2025
8d5470c
Merge pull request #28 from carlvellotti/trigger-redeploy
carlvellotti Mar 2, 2025
44d2b94
feat: Complete AI-enhanced template description feature
carlvellotti Mar 2, 2025
ace2540
Merge pull request #29 from carlvellotti/feature/ai-enhanced-template…
carlvellotti Mar 2, 2025
016ea0d
Implement dark mode styling for ImagePicker, UnsplashPicker, and upda…
carlvellotti Mar 3, 2025
67b2b1d
Merge pull request #30 from carlvellotti/feature/dark-mode-styling
carlvellotti Mar 3, 2025
1562edc
Complete dark mode styling across the entire application
carlvellotti Mar 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .aidev
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# AI Developer Guidelines

## Code Quality Standards
When a file becomes too long, split it into smaller files. When a function becomes too long, split it into smaller functions.

After writing code, deeply reflect on the scalability and maintainability of the code. Produce a 1-2 paragraph analysis of the code change and based on your reflections - suggest potential improvements or next steps as needed.

## Planning Mode
When asked to enter "Planner Mode" deeply reflect upon the changes being asked and analyze existing code to map the full scope of changes needed. Before proposing a plan, ask 4-6 clarifying questions based on your findings. Once answered, draft a comprehensive plan of action and ask for approval on that plan. Once approved, implement all steps in that plan. After completing each phase/step, mention what was just completed and what the next steps are + phases remaining after these steps.

## Debugging Mode
When asked to enter "Debugger Mode" please follow this exact sequence:

1. Reflect on 5-7 different possible sources of the problem
2. Distill those down to 1-2 most likely sources
3. Add additional logs to validate your assumptions and track the transformation of data structures throughout the application control flow before we move onto implementing the actual code fix
4. Use the "getConsoleLogs", "getConsoleErrors", "getNetworkLogs" & "getNetworkErrors" tools to obtain any newly added web browser logs
5. Obtain the server logs as well if accessible - otherwise, ask me to copy/paste them into the chat
6. Deeply reflect on what could be wrong + produce a comprehensive analysis of the issue
7. Suggest additional logs if the issue persists or if the source is not yet clear
8. Once a fix is implemented, ask for approval to remove the previously added logs
136 changes: 129 additions & 7 deletions .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,138 @@ You are an expert in TypeScript, Next.js App Router, React, and Tailwind. Follow
- src/app/lib has all the other code like helpers, hooks, and contexts

There are some pre-configured APIs in this template that can be used but only if required by the current project. These have already been created:
- Firebase
- In src/lib/firebase there is a firebase.ts configuration file as well as firebaseUtils.ts for various utility functions when interacting with Firebase Database, Storage, and Authencation
- In src/lib/contexts there is an AuthContext.tsx file that has user authentication with Firebase set up with the onAuthStateChanged listener.
- In src/lib/hooks there is a useAuth.ts hook

- Supabase
- src/lib/supabase has client.ts, server.ts, admin.ts, and types.ts for database operations
- Used for meme template storage and vector search functionality
- Handles all data persistence needs including user data and template management

- OpenAI
- src/app/api/openai has chat/route.ts which is a simple API calling streamText from openai using the Vercel AI library
- src/app/api/openai has chat/route.ts which is a simple API calling streamText from OpenAI using the Vercel AI library
- Also used for generating embeddings for template search

- Anthropic
- src/app/api/anthropic has chat/route.ts which is a simple API calling streamText from Anthropic using the Vercel AI library

- Replicate
- src/app/api/replicate has generate-image/route.ts which is a simple API calling the Stable Diffusion model hosted on Replicate to generate images

- Deepgram
- src/app/api/deepgram has transcribe-audio/route.ts which is a simple API that returns the Deepgram API key to be used in the client side to transcribe audio in real-time.
- src/lib/contexts has a DeepgramContext.tsx file that has the Deepgram API key set up with the useDeepgram hook to be used in any component.
- src/app/api/deepgram has transcribe-audio/route.ts which is a simple API that returns the Deepgram API key to be used in the client side to transcribe audio in real-time
- src/lib/contexts has a DeepgramContext.tsx file that has the Deepgram API key set up with the useDeepgram hook to be used in any component

# Project Overview: Full-Stack AI Template

## Project Architecture
This is a Next.js 14 application with multiple AI integrations, designed as a template for building AI-powered applications.

### Core Technologies
- Next.js 14 App Router
- TypeScript
- TailwindCSS
- Vercel AI SDK
- Multiple AI Providers (OpenAI, Anthropic, Replicate)
- Supabase (for data persistence, template storage and vector search)
- Deepgram (for voice transcription)

### Directory Structure
- `/src`
- `/app` - Next.js app router pages and API routes
- `/api` - API endpoints for AI services
- `/components` - React components
- `/lib` - Utility functions, hooks, and contexts
- `/contexts` - React contexts (Deepgram)
- `/supabase` - Supabase client and types
- `/utils` - Helper functions

## Current Features

### 1. AI Chat Integration
- Supports both OpenAI and Anthropic models
- Streaming responses using Vercel AI SDK
- Model selection toggle
- Chat history management

### 2. Image Generation
- Replicate API integration for Stable Diffusion
- Image download functionality
- Gallery of generated images
- Advanced generation options

### 3. Voice Notes
- Real-time voice recording with Deepgram
- Automatic transcription
- Supabase storage integration
- Note management system

### 4. Meme Mage
- AI-powered template selection
- Caption generation
- Video processing with canvas
- Template management system

## Development Guidelines

### 1. API Routes
- Place in `/src/app/api`
- Use proper error handling and typing
- Implement rate limiting where appropriate
- Return consistent response formats

### 2. Components
- Keep components focused and modular
- Use TypeScript interfaces for props
- Implement proper loading states
- Handle errors gracefully
- Use Tailwind for styling

### 3. State Management
- Use React Context for global state
- Implement proper TypeScript types
- Handle loading and error states
- Use local storage for persistence where appropriate

### 4. AI Integration
- Use Vercel AI SDK for streaming responses
- Implement proper error handling
- Handle rate limits and API failures
- Cache responses where appropriate

### 5. Database Operations
- Use Supabase for all data persistence
- Implement proper error handling
- Use TypeScript types for data models
- Utilize vector embeddings for template search

## Testing Guidelines
- Implement unit tests for utilities
- Add integration tests for API routes
- Test error handling
- Verify AI integration functionality

## Current Focus Areas
1. Improving meme generator functionality
2. Enhancing AI template selection
3. Optimizing video processing
4. Adding user authentication
5. Implementing proper error handling

## Known Issues
1. Video processing performance needs optimization
2. Template selection accuracy needs improvement
3. Error handling needs standardization
4. Loading states need refinement

## Future Enhancements
1. Add user authentication
2. Implement template sharing
3. Add more AI models
4. Improve performance optimization
5. Add comprehensive testing

Remember to:
- Follow TypeScript best practices
- Implement proper error handling
- Use consistent code formatting
- Document new features and changes
- Test thoroughly before deployment
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "next/core-web-vitals"
"extends": "next/core-web-vitals",
"rules": {
"react/no-unescaped-entities": "off"
}
}
33 changes: 33 additions & 0 deletions SQL Function Update
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-- Drop existing function
DROP FUNCTION IF EXISTS match_meme_templates(vector(1536), float, int, boolean);

-- Create updated version with greenscreen filter
CREATE FUNCTION match_meme_templates(
query_embedding vector(1536),
match_threshold float,
match_count int,
is_greenscreen_filter boolean
)
RETURNS TABLE (
id uuid,
name text,
video_url text,
instructions text,
similarity float
)
LANGUAGE SQL
AS $$
SELECT
meme_templates.id,
meme_templates.name,
meme_templates.video_url,
meme_templates.instructions,
1 - (meme_templates.embedding <=> query_embedding) as similarity
FROM meme_templates
WHERE
embedding IS NOT NULL AND
is_greenscreen = is_greenscreen_filter AND
(1 - (meme_templates.embedding <=> query_embedding)) > match_threshold
ORDER BY embedding <=> query_embedding
LIMIT match_count;
$$;
6 changes: 1 addition & 5 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ const nextConfig = {
protocol: "https",
hostname: "replicate.delivery",
},
{
protocol: "https",
hostname: "firebasestorage.googleapis.com",
},
],
dangerouslyAllowSVG: true,
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
},
async rewrites() {
return [
{
source: "/api/:path*",
source: "/api/openai/:path*",
destination: "https://api.openai.com/:path*",
},
];
Expand Down
Loading