Skip to content

mclovin15/ai-note

Repository files navigation

Studia - AI-Powered Note Taking Application

An intelligent note-taking platform that uses Claude AI (Anthropic) to transform PDF documents into structured notes, quizzes, and summaries.

🚀 Features

  • 📄 PDF Upload & Processing: Upload PDF documents and extract text automatically
  • 🤖 AI-Powered Note Generation: Generate structured notes from PDFs using Claude AI
  • 📝 Quiz Generation: Automatically create quiz questions from document content
  • 📊 Summaries: Get concise summaries of lengthy documents
  • 🏢 Workspace Organization: Organize notes into spaces by topic or project
  • 🔐 Secure Authentication: User authentication powered by Clerk
  • 🎨 Modern UI: Beautiful interface built with Tailwind CSS and Radix UI

🛠️ Tech Stack

  • Framework: Next.js 15.5.2 with App Router
  • Frontend: React 19.1.0, TypeScript
  • Styling: Tailwind CSS 4.0
  • Database: PostgreSQL with Prisma ORM
  • Authentication: Clerk
  • AI: Claude AI (Anthropic) - NOT OpenAI
  • UI Components: Radix UI + shadcn/ui

⚙️ Setup

Prerequisites

  • Node.js 18+ and npm
  • PostgreSQL database
  • Claude API key (from Anthropic)
  • Clerk account for authentication

Installation

  1. Clone the repository
git clone <repository-url>
cd ai-note
  1. Install dependencies
npm install
  1. Configure environment variables

Create a .env.local file in the root directory:

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_key
CLERK_SECRET_KEY=your_clerk_secret

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/ai_note

# Claude AI (Anthropic) - NOT OpenAI
CLAUDE_API_KEY=sk-ant-api03-your-key-here
CLAUDE_MODEL=claude-3-5-sonnet-20241022

📖 See ENV_SETUP.md for detailed setup instructions

  1. Set up the database
npm run db:push
# or
npm run db:migrate
  1. Run the development server
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the application.

🤖 Claude AI Integration

This application uses Claude AI by Anthropic instead of OpenAI for all AI features.

Available AI Features

  1. Generate Notes: /api/ai/generate-notes

    • Converts PDF text into structured markdown notes
  2. Generate Quiz: /api/ai/generate-quiz

    • Creates interactive quiz questions from PDF content
  3. Generate Summary: /api/ai/generate-summary

    • Produces concise summaries of documents

📖 See CLAUDE_INTEGRATION.md for complete API documentation

Why Claude?

  • ✅ More accurate for educational content
  • ✅ Better context understanding
  • ✅ Longer context windows
  • ✅ Competitive pricing
  • ✅ Strong safety and ethics focus

📁 Project Structure

ai-note/
├── src/
│   ├── app/
│   │   ├── (dashboard)/       # Dashboard routes
│   │   ├── api/
│   │   │   ├── spaces/        # Space management APIs
│   │   │   └── ai/            # Claude AI endpoints
│   │   ├── sign-in/           # Authentication pages
│   │   └── sign-up/
│   ├── components/            # React components
│   ├── lib/
│   │   ├── claude.ts          # Claude AI service (main integration)
│   │   ├── prisma.ts          # Database client
│   │   └── utils.ts           # Utilities
│   └── middleware.ts          # Auth middleware
├── prisma/
│   └── schema.prisma          # Database schema
├── .env.local                 # Environment variables (not in git)
├── CLAUDE_INTEGRATION.md      # Claude API documentation
└── ENV_SETUP.md              # Environment setup guide

🔧 Available Scripts

npm run dev          # Start development server
npm run build        # Build for production
npm run start        # Start production server
npm run lint         # Run ESLint
npm run db:push      # Push Prisma schema to database
npm run db:studio    # Open Prisma Studio
npm run db:migrate   # Run database migrations

📚 Documentation

🔒 Security Notes

  • .env.local is gitignored by default
  • ✅ Never commit API keys to version control
  • ✅ All AI endpoints require authentication
  • ✅ User permissions are validated on every request
  • ⚠️ Remember to use different API keys for development and production

🤝 Contributing

  1. Create a feature branch
  2. Make your changes
  3. Test thoroughly
  4. Submit a pull request

📝 License

This project is part of the INF6150 course at UQAM.

🆘 Troubleshooting

"CLAUDE_API_KEY is not configured"

  • Check that .env.local exists and contains your Claude API key
  • Restart the development server after adding the key

Database connection errors

  • Verify PostgreSQL is running
  • Check your DATABASE_URL in .env.local
  • Run npm run db:push to sync the schema

Authentication issues

  • Verify Clerk keys are correct in .env.local
  • Check Clerk dashboard for application status

🔗 Useful Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors