Local Development Setup
This guide walks you through setting up Clipron AI on your local machine for development, testing, or evaluation purposes.Local development setup is perfect for testing, customization, and contributing to the project. For production deployment, see our Production Deployment Guide.
Prerequisites
Before starting, ensure you have the following installed:Git
Version control
- Git 2.25+ recommended
- GitHub account for cloning
- SSH keys configured (optional)
Python 3.9+
Backend runtime
- Python 3.9, 3.10, or 3.11
- pip package manager
- venv module for virtual environments
Node.js 18+
Frontend build tools
- Node.js 18 LTS or newer
- npm package manager (included)
- Build tools for native modules
Code Editor
Development environment
- VS Code (recommended)
- PyCharm or similar IDE
- Extensions for Python and React
Quick Start
1. Clone the Repository
2. Automated Setup
The fastest way to get started is using our automated setup script:- Create Python virtual environment
- Install all Python dependencies
- Install Node.js dependencies
- Set up basic configuration files
- Initialize the database
3. Manual Setup (Alternative)
If you prefer manual setup or the automated script fails:1
Backend Setup
2
Frontend Setup
3
Database Initialization
Configuration
Environment Variables
Create configuration files from templates:- Backend Configuration
- Frontend Configuration
backend/.env with your settings:API Keys (Optional for Basic Testing)
For full functionality, you’ll need API keys. Add these tobackend/.env:
AI Model APIs (Optional)
AI Model APIs (Optional)
Without AI API keys, you can still test the UI and basic functionality, but code analysis won’t work.
OAuth (Optional)
OAuth (Optional)
Without OAuth, you can still create accounts using email/password authentication.
Stripe (Optional)
Stripe (Optional)
Without Stripe, the credit system will work in “free mode” with unlimited credits.
Running the Application
Development Servers
You’ll need to run both backend and frontend servers simultaneously:- Backend Server
- Frontend Server
http://localhost:8000Available endpoints:- API:
http://localhost:8000/api - Docs:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
Using Development Scripts
For convenience, you can use the provided scripts:Development Workflow
Making Changes
1
Backend Changes
- Edit Python files in
backend/ - Server automatically reloads on file changes
- Check logs in terminal for errors
- Test API endpoints at
http://localhost:8000/docs
2
Frontend Changes
- Edit React files in
frontend/src/ - Browser automatically refreshes on save
- Check browser console for errors
- Use React DevTools for debugging
3
Database Changes
- Modify models in
backend/models/ - Create migration:
alembic revision --autogenerate -m "description" - Apply migration:
alembic upgrade head - Or reset database:
python init_db.py
Testing
Backend Testing
Backend Testing
Frontend Testing
Frontend Testing
Integration Testing
Integration Testing
Development Tools
Recommended VS Code Extensions
Python Extensions
- Python (Microsoft)
- Pylance
- Python Docstring Generator
- autoDocstring
React Extensions
- ES7+ React/Redux/React-Native snippets
- Bracket Pair Colorizer
- Auto Rename Tag
- Prettier - Code formatter
General Extensions
- GitLens
- Thunder Client (API testing)
- REST Client
- Docker (if using containers)
Database Extensions
- SQLite Viewer
- PostgreSQL (if using PostgreSQL)
- Database Client JDBC
Debugging
- Backend Debugging
- Frontend Debugging
VS Code Python Debugging:
- Set breakpoints in Python code
- Press F5 or use “Run and Debug”
- Select “Python: FastAPI” configuration
- Debug requests step-by-step
Common Development Issues
Port Conflicts
Backend Port 8000 in Use
Backend Port 8000 in Use
Frontend Port 3000 in Use
Frontend Port 3000 in Use
Database Issues
Database Locked
Database Locked
Migration Errors
Migration Errors
Dependency Issues
Python Dependencies
Python Dependencies
Node.js Dependencies
Node.js Dependencies