A beautiful, modern note-taking application built with Next.js 15, Appwrite, and Gemini AI. Smart Notes helps you organize your thoughts with AI-powered summaries and intelligent insights.
- User Authentication: Secure signup and login using Appwrite Auth
- Note Management: Create, read, update, and delete notes
- AI Summaries: Generate concise summaries using Google Gemini AI
- Smart Tags: Automatically generate relevant tags for your notes
- AI Insights: Discover patterns and categories across all your notes
- Beautiful UI: Clean, minimalistic design with smooth animations
- Responsive: Works seamlessly on desktop and mobile devices
- Frontend: Next.js 15 with TypeScript
- Styling: Tailwind CSS
- Animations: Framer Motion
- Backend: Appwrite (Auth & Database)
- AI: Google Gemini API
- Icons: Lucide React
Before you begin, ensure you have the following installed:
- Node.js 18+ and npm
- An Appwrite account (https://cloud.appwrite.io)
- A Google AI Studio account for Gemini API key (https://aistudio.google.com)
cd smart-notes
npm install- Go to Appwrite Console
- Click "Create Project"
- Name it "Smart Notes"
- Copy your Project ID
- In your project, go to "Auth" in the sidebar
- Enable "Email/Password" authentication
- (Optional) Configure email templates and settings
-
Go to "Databases" in the sidebar
-
Click "Create Database"
-
Name it "smart-notes-db"
-
Copy the Database ID
-
Inside the database, click "Create Collection"
-
Name it "notes"
-
Copy the Collection ID
-
Configure Collection Attributes:
userId(String, required, size: 255)title(String, required, size: 500)content(String, required, size: 10000)summary(String, optional, size: 2000, default: "")tags(String Array, optional)
-
Configure Collection Permissions:
- Go to "Settings" tab in the collection
- Under "Permissions", add:
- Create:
Users(any authenticated user) - Read:
User:[USER_ID]will be handled by queries - Update:
User:[USER_ID]will be handled by queries - Delete:
User:[USER_ID]will be handled by queries
- Create:
-
Create Indexes (for better performance):
- Index on
userId(Ascending) - Index on
$createdAt(Descending)
- Index on
- Go to "Settings" → "Platforms" in your Appwrite project
- Click "Add Platform" → "Web App"
- Name: "Smart Notes Web"
- Hostname:
localhost(for development) - For production, add your deployed domain
- Go to Google AI Studio
- Click "Get API Key"
- Create a new API key or use an existing one
- Copy the API key
Update the .env.local file in the root directory with your actual values:
# Appwrite Configuration
NEXT_PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
NEXT_PUBLIC_APPWRITE_PROJECT_ID=your_project_id_here
NEXT_PUBLIC_APPWRITE_DATABASE_ID=your_database_id_here
NEXT_PUBLIC_APPWRITE_NOTES_COLLECTION_ID=your_notes_collection_id_here
# Gemini API Configuration
GEMINI_API_KEY=your_gemini_api_key_hereReplace the placeholder values with your actual IDs and keys.
npm run devOpen http://localhost:3000 in your browser.
- Sign Up: Create a new account on the signup page
- Login: Sign in with your credentials
- Create Notes: Click the "New Note" button to create your first note
- AI Summarize: Click the "Summarize" button on any note to generate an AI summary and tags
- View Insights: Switch to the "AI Insights" tab to see patterns and categories across your notes
- Click the "New Note" button on the dashboard
- Enter a title and content
- Click "Save Note"
- Click the "Summarize" button on any note card
- The AI will generate a concise summary and relevant tags
- Summaries appear in a blue box on the note card
- Switch to the "AI Insights" tab
- View main categories identified across all your notes
- See a list of all notes with AI-generated summaries
- Edit: Click the edit icon to modify a note
- Delete: Click the delete icon to remove a note
- Notes are automatically sorted by creation date (newest first)
smart-notes/
├── app/
│ ├── api/
│ │ ├── insights/ # AI insights API route
│ │ └── summarize/ # AI summarization API route
│ ├── dashboard/ # Main dashboard page
│ ├── login/ # Login page
│ ├── signup/ # Signup page
│ ├── layout.tsx # Root layout with AuthProvider
│ └── page.tsx # Landing page
├── components/
│ └── ProtectedRoute.tsx # Protected route wrapper
├── context/
│ └── AuthContext.tsx # Authentication context
├── lib/
│ ├── appwrite.ts # Appwrite configuration
│ ├── notes.ts # Notes service functions
│ └── ai.ts # AI service functions
├── types/
│ └── index.ts # TypeScript type definitions
└── .env.local # Environment variables (not in git)
This app uses Appwrite Auth for all authentication operations:
- User signup with email and password
- User login with session management
- Secure session handling with cookies
- Protected routes requiring authentication
- User logout and session deletion
All authentication is handled through the AuthContext which wraps the Appwrite SDK.
- Push your code to a GitHub repository
- Go to Vercel
- Import your repository
- Add environment variables in Vercel project settings
- Deploy!
-
Build your Next.js app:
npm run build
-
Follow Appwrite Sites documentation for deployment instructions.
Authentication not working
- Verify your Appwrite project ID in
.env.local - Check that Email/Password auth is enabled in Appwrite Console
- Make sure you added
localhostas a platform in Appwrite
Notes not saving
- Verify Database ID and Collection ID in
.env.local - Check collection permissions in Appwrite Console
- Ensure all required attributes are created correctly
AI features not working
- Verify your Gemini API key is correct
- Check API key has not exceeded quota
- Review server logs for specific error messages
UI not loading properly
- Run
npm installto ensure all dependencies are installed - Clear browser cache and restart dev server
- Check browser console for JavaScript errors
| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_APPWRITE_ENDPOINT |
Appwrite API endpoint | https://cloud.appwrite.io/v1 |
NEXT_PUBLIC_APPWRITE_PROJECT_ID |
Your Appwrite project ID | 65f3a4b2c1d9e7f8a9b0 |
NEXT_PUBLIC_APPWRITE_DATABASE_ID |
Your Appwrite database ID | smart-notes-db |
NEXT_PUBLIC_APPWRITE_NOTES_COLLECTION_ID |
Your notes collection ID | notes |
GEMINI_API_KEY |
Google Gemini API key | AIzaSyC... |
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this project for personal or commercial purposes.
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Review Appwrite documentation: https://appwrite.io/docs
- Check Next.js documentation: https://nextjs.org/docs
- Built with Next.js
- Backend by Appwrite
- AI powered by Google Gemini
- Styled with Tailwind CSS
- Animations by Framer Motion