Local Development Guide
This document explains how to develop and debug the Rin project locally.
Quick Start
1. Clone the Project
2. Install Dependencies
3. Configure Environment Variables
4. Start the Development Server
This will automatically:
- ✅ Generate
wrangler.tomlconfiguration file - ✅ Generate
client/.envfrontend environment variables - ✅ Generate
.dev.varssensitive information file - ✅ Run database migrations
- ✅ Start backend service (port 11498)
- ✅ Start frontend service (port 5173)
Visit http://localhost:5173 to start developing!
Environment Variable Configuration
All configurations are centralized in the .env.local file:
Frontend Configuration
Backend Configuration
Sensitive Configuration (Required)
Common Commands
Development Workflow
First-time Setup
- Fork the project repository
- Clone to local
- Install dependencies:
bun install - Configure
.env.local - Run
bun run dev
Daily Development
- Modify code
- Frontend auto-hot reloads, backend restarts automatically on changes
- Test functionality
- Commit code
Database Changes
- Modify
server/src/db/schema.ts - Run
bun run db:generateto generate migration files - Run
bun run db:migrateto apply migrations
Troubleshooting
Port Already in Use
If ports 5173 or 11498 are occupied, you can modify the configuration in .env.local:
Database Migration Failed
Configuration Files Not Generated
GitHub OAuth Configuration
GitHub OAuth needs to be configured for local development:
- Visit https://github.com/settings/developers
- Create a new OAuth App
- Authorization callback URL:
http://localhost:11498/user/github/callback - Fill Client ID and Client Secret into
.env.local
Project Structure
Production Deployment
Please refer to the Deployment Guide for production deployment procedures.
Getting Help
- 📖 Full documentation: https://docs.openrin.org
- 💬 Discord: https://discord.gg/JWbSTHvAPN
- 🐛 Submit Issue: https://github.com/openRin/Rin/issues