Skip to content

Commit 51dfbb2

Browse files
committed
add rules
1 parent b76c867 commit 51dfbb2

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

.cursorrules

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You are an expert in TypeScript, Next.js App Router, React, and Tailwind. Follow
66
- src/app/components has all the React components
77
- src/app/lib has all the other code like helpers, hooks, and contexts
88

9-
There are some pre-configured APIs in this template that can be used but only if required by the current project:
9+
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:
1010
- Firebase
1111
- 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
1212
- In src/lib/contexts there is an AuthContext.tsx file that has user authentication with Firebase set up with the onAuthStateChanged listener.
@@ -16,4 +16,7 @@ There are some pre-configured APIs in this template that can be used but only if
1616
- Anthropic
1717
- src/app/api/anthropic has chat/route.ts which is a simple API calling streamText from Anthropic using the Vercel AI library
1818
- Replicate
19-
- 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
19+
- 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
20+
- Deepgram
21+
- 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.
22+
- 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.

paths/voice-notes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ The flow of the app is as follows:
2121
- Now, the app displays the note in a list of all notes on the home screen.
2222

2323

24-
This application is set-up with existing configuration for APIs and Firebase. Implement all the functionality in the flow above while using the existing codebase as a starting point, but fully modify the codebase to fit the flow and functionality described above.
24+
This application is set-up with existing configuration for Deepgram APIs and Firebase. Implement all the functionality in the flow above while using the existing codebase as a starting point, but fully modify the codebase to fit the flow and functionality described above.

src/components/VoiceRecorder.tsx

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
'use client';
22

3-
import { useState } from 'react';
3+
import { useState, useEffect } from 'react';
44
import { useDeepgram } from '../lib/contexts/DeepgramContext';
55
import { addDocument } from '../lib/firebase/firebaseUtils';
6+
import { motion } from 'framer-motion';
67

78
export default function VoiceRecorder() {
89
const [isRecording, setIsRecording] = useState(false);
@@ -38,6 +39,17 @@ export default function VoiceRecorder() {
3839
</button>
3940
{isRecording && (
4041
<div className="mt-4 p-4 bg-gray-100 rounded-lg">
42+
<motion.div
43+
animate={{
44+
scale: [1, 1.2, 1],
45+
}}
46+
transition={{
47+
duration: 1.5,
48+
repeat: Infinity,
49+
ease: "easeInOut",
50+
}}
51+
className="w-8 h-8 bg-blue-500 rounded-full mx-auto mb-4"
52+
/>
4153
<p className="text-sm text-gray-600">{realtimeTranscript}</p>
4254
</div>
4355
)}

0 commit comments

Comments
 (0)