Prerequisites
Before installing Uxie, ensure you have the following:Required Software
- Node.js v18 or later (download)
- pnpm package manager (installation)
- PostgreSQL database (local or cloud-hosted)
- Git for version control
Required Service Accounts
You’ll need accounts for the following services:Supabase
PostgreSQL database hosting
Uploadthing
PDF file storage and CDN
Pinecone
Vector database for embeddings
Google Cloud
OAuth and AI services
Hugging Face
AI model embeddings
Liveblocks
Real-time collaboration (optional)
Installation Steps
Install Dependencies
The postinstall script will automatically run
prisma generate to create the Prisma client.Configure Environment Variables
Copy the example environment file:Open
.env in your editor and configure all required variables (see below).Set Up Database
After configuring DATABASE_URL, push the Prisma schema:This creates all necessary tables in your PostgreSQL database.
Start Development Server
Environment Variables
Uxie requires several environment variables to function properly. Below is a comprehensive guide for each variable.Database Configuration
.env
Create Supabase Project
- Go to Supabase and create a new project
- Wait for the project to be provisioned
For local PostgreSQL, use:
postgresql://postgres:password@localhost:5432/uxieAuthentication (NextAuth.js)
.env
- Development:
http://localhost:3000 - Production: Your deployed domain (e.g.,
https://uxie.vercel.app)
Google OAuth
.env
Create OAuth Credentials
- Go to Google Cloud Console
- Create a new project or select an existing one
- Navigate to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
Configure OAuth Consent Screen
- Click Configure Consent Screen
- Choose External user type
- Fill in application name and support email
- Add scopes:
email,profile,openid
File Upload (Uploadthing)
.env
Create Uploadthing Account
- Go to Uploadthing
- Sign up and create a new application
AI Features (Google Generative AI)
.env
Enable Generative AI API
- Go to Google AI Studio
- Click Get API Key
- Create a new API key or use an existing one
- Document summarization
- Question answering
- Flashcard generation and evaluation
- Text enhancement and autocompletion
Vector Database (Pinecone)
.env
Create Pinecone Account
- Sign up at Pinecone
- Create a new project
Create Index
- Click Create Index
- Configure:
- Name:
uxie(or your preferred name) - Dimensions:
768(for Hugging Face embeddings) - Metric:
cosine - Pod Type: Starter (free tier) or as needed
- Name:
- Click Create Index
Pinecone stores vector embeddings of your PDFs for semantic search and RAG (Retrieval Augmented Generation).
Embeddings (Hugging Face)
.env
Create Access Token
- Go to Hugging Face Settings
- Click New token
- Name:
uxie-embeddings - Role: Read (inference API access)
- Copy the token
Supabase Configuration
.env
Real-time Collaboration (Liveblocks)
.env
Create Liveblocks Account
- Sign up at Liveblocks
- Create a new project
Collaboration features may be limited in the free tier. This is optional for basic functionality.
Node Environment
.env
developmentfor local developmentproductionfor deployed environmentstestfor testing
Database Setup
Uxie uses Prisma as the ORM and PostgreSQL as the database.Schema Overview
The database includes models for:- User: Authentication and user profiles
- Account: OAuth provider accounts
- Document: PDF documents and metadata
- Highlight: Text and image highlights
- Message: AI chat messages
- Flashcard: Learning flashcards
- FlashcardAttempt: User responses and AI evaluations
- Collaborator: Document sharing and permissions
- Feedback: User feedback submissions
Applying Schema Changes
prisma db push is recommended for development. For production, use migrations:Database Relationships
Key relationships:- Users have many Documents (one-to-many)
- Documents have many Highlights, Messages, and Flashcards
- Collaborators link Users to Documents with specific roles (OWNER, EDITOR, VIEWER)
- FlashcardAttempts track user responses and AI evaluations
Verification
After setup, verify everything works:Check Database Connection
Test Development Server
Test Authentication
- Click “Sign in”
- Authenticate with Google
- Verify you’re redirected to the dashboard
Production Build
To test the production build locally:- Optimizes and minifies code
- Generates static pages where possible
- Validates environment variables
- Creates optimized images and assets
Troubleshooting
Prisma Client errors
Prisma Client errors
If you see “Prisma Client not found” errors:This regenerates the Prisma client based on your schema.
Database connection fails
Database connection fails
Check DATABASE_URL format:Test connection:Common issues:
- Incorrect password or username
- Database doesn’t exist
- PostgreSQL not running
- Firewall blocking connection
- SSL mode mismatch (add
?sslmode=requirefor cloud databases)
Environment variables not loading
Environment variables not loading
Verify .env file location:Check variable validation:
Look in
- Must be in the root directory (same level as package.json)
- Named exactly
.env(not.env.localor.env.development)
src/env.mjs for required variables and their validation rules.OAuth redirect URI mismatch
OAuth redirect URI mismatch
Error: “redirect_uri_mismatch”Solution:
- Go to Google Cloud Console
- Check Authorized redirect URIs
- Ensure it includes:
http://localhost:3000/api/auth/callback/google - URIs must match exactly (no trailing slashes)
Uploadthing upload fails
Uploadthing upload fails
Check:
- UPLOADTHING_TOKEN is valid and not expired
- File size is within limits (check your Uploadthing plan)
- Network connection is stable
Pinecone errors
Pinecone errors
Index configuration mismatch:Recreate index if needed with correct dimensions.
- Dimensions must be
768 - Metric should be
cosine
Build fails
Build fails
Type errors:Clear cache and rebuild:Check Node.js version:
Optional Configuration
Custom Port
Change the development port:package.json
TypeScript Configuration
Uxie uses strict TypeScript settings. Seetsconfig.json for configuration.
Code Quality
Next Steps
Quickstart Guide
Get up and running quickly
Architecture
Understand how Uxie works
API Reference
Explore the tRPC API
Contributing
Join the development
Architecture
Understand Uxie’s technical architecture
API Reference
Explore the tRPC API endpoints
Contributing
Contribute to Uxie’s development
Getting Help
If you encounter issues not covered here:- Check GitHub Issues for similar problems
- Review the README for additional context
- Open a new issue with:
- Your Node.js version (
node --version) - Error messages (full stack trace)
- Steps to reproduce
- Your Node.js version (
- Join the community discussion on GitHub
