Contributing to Uxie
Thank you for your interest in contributing to Uxie! This guide will help you set up your development environment and understand our development workflow.Prerequisites
Before you begin, ensure you have the following installed:Node.js v18+
Download from nodejs.org
Getting Started
1. Fork and Clone
Fork the Repository
Visit github.com/zeus-12/uxie and click the “Fork” button to create your own copy.
2. Install Dependencies
- Install all npm dependencies
- Apply patches to
react-pdf-highlighter - Generate Prisma Client types
3. Set Up Environment Variables
Copy the example environment file:Database Setup (Supabase)
Database Setup (Supabase)
- Go to supabase.com and create a new project
- Once created, navigate to Settings → Database
- Copy the connection string and add to
.env:
- Run migrations:
Authentication (NextAuth + Google OAuth)
Authentication (NextAuth + Google OAuth)
- Go to Google Cloud Console
- Create a new project (or select existing)
- Navigate to APIs & Services → Credentials
- Click Create Credentials → OAuth 2.0 Client ID
- Configure consent screen if prompted
- Set Authorized redirect URIs:
http://localhost:3000/api/auth/callback/google
- Copy credentials to
.env:
- Generate NextAuth secret:
.env:File Upload (UploadThing)
File Upload (UploadThing)
- Go to uploadthing.com and sign up
- Create a new app
- Copy your API token:
Vector Database (Pinecone)
Vector Database (Pinecone)
- Go to pinecone.io and sign up
- Create a new index with:
- Name:
uxie - Dimensions:
768 - Metric:
cosine - Region: Choose closest to you
- Name:
- Copy your API key:
AI Services
AI Services
HuggingFace (Embeddings)Google AI (Gemini)
- Sign up at huggingface.co
- Go to Settings → Access Tokens
- Create a new token:
- Go to ai.google.dev
- Get an API key
- Add to
.env:
Collaboration (Optional - Liveblocks)
Collaboration (Optional - Liveblocks)
Currently disabled in production due to free tier limits, but you can enable locally:
- Go to liveblocks.io and sign up
- Create a new project
- Copy your public API key:
4. Start Development Server
Development Workflow
Creating a New Branch
Always create a new branch for your changes:Making Changes
Committing Changes
We follow conventional commit messages:| Type | Description | Example |
|---|---|---|
feat | New feature | feat: add export to markdown |
fix | Bug fix | fix: resolve highlight position offset |
docs | Documentation | docs: update contributing guide |
style | Code style (no logic change) | style: format with prettier |
refactor | Code refactoring | refactor: extract PDF utils |
perf | Performance improvement | perf: optimize vector search |
test | Add/update tests | test: add flashcard tests |
chore | Maintenance | chore: update dependencies |
Opening a Pull Request
Create Pull Request
- Go to github.com/zeus-12/uxie
- Click “Compare & pull request”
- Fill in the PR template
- Link any related issues
Coding Standards
TypeScript
Strict Mode
Always use TypeScript in strict mode.
- No
anytypes (useunknown) - Explicit return types for functions
- Null checks required
Type Inference
Prefer type inference when obvious:
React Components
Prefer Function Components:File Organization
Import Order
Prettier will auto-sort, but follow this pattern:
- React imports
- Third-party libraries
- Internal utilities
- Types
- Styles
tRPC Procedures
Input Validation:Prisma Schema
When modifyingschema.prisma:
- Make changes
- Generate migration:
- Generate client:
Tailwind CSS
Use utility classes:cn() helper for conditional classes:
Testing Locally
Manual Testing Checklist
Before submitting a PR, test:Authentication Flow
Authentication Flow
- Can sign in with Google
- Can sign out
- Protected routes redirect to login
Document Management
Document Management
- Can upload PDF
- Can view PDF in reader
- Can add highlights
- Can add notes
AI Features
AI Features
- Chat works and streams responses
- Flashcard generation works
- Flashcard evaluation works
Database Inspection
Use Prisma Studio to inspect database:Common Issues
Port Already in Use
Port Already in Use
If port 3000 is taken:
Prisma Client Not Generated
Prisma Client Not Generated
If you see Prisma import errors:This regenerates the Prisma Client.
Type Errors After Pull
Type Errors After Pull
After pulling latest changes:
Environment Variable Issues
Environment Variable Issues
Ensure
.env is in root directory (same level as package.json).Restart dev server after changing .env.Project Scripts
| Command | Description |
|---|---|
pnpm dev | Start development server |
pnpm build | Build for production |
pnpm start | Start production server |
pnpm lint | Run ESLint |
pnpm typecheck | Check TypeScript types |
pnpm format | Format code with Prettier |
pnpm prisma studio | Open Prisma Studio |
pnpm prisma migrate dev | Create/apply migration |
pnpm prisma db push | Push schema without migration |
Areas for Contribution
Looking for where to help? Check these areas:Bug Fixes
- Fix
.tippy-arrowappearing on screen - Improve error and loading pages
- Fix highlight positioning issues
Features
- Build category/tags system
- Implement rate limiting with Redis
- Semantic search improvements
- PDF summary generation
Performance
- Optimize PDF rendering
- Reduce bundle size
- Improve vector search speed
Documentation
- Add JSDoc comments
- Write component docs
- Create user guides
Code Review Guidelines
When reviewing PRs:- Be kind and constructive
- Focus on code, not the person
- Explain the “why” behind feedback
- Approve when ready, request changes when needed
- Test the changes locally if possible
Community
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Feedback: Feedback Form
License
By contributing to Uxie, you agree that your contributions will be licensed under the project’s license.Next Steps
Architecture
Understand the system architecture
Deployment
Learn about deployment and production
