Lumnicode is a modern, AI-powered online code editor built with React (frontend) and FastAPI (backend). It provides real-time code editing, project management, and AI-assisted coding features.
- AI-Powered Code Assistance: Get intelligent suggestions and code improvements
- Project Management: Create, organize, and manage coding projects
- Real-time Code Editor: Monaco Editor integration with syntax highlighting
- Authentication: Secure user authentication with Clerk
- File Management: Complete CRUD operations for project files
- Modern UI: Responsive design inspired by VS Code
- Cloud Database: Powered by Neon.tech PostgreSQL
- Framework: FastAPI with Python 3.11+
- Database: PostgreSQL (Neon.tech)
- Authentication: Clerk JWT verification
- ORM: SQLAlchemy with Alembic migrations
- API: RESTful endpoints for projects, files, and AI assistance
- Framework: React 18 with TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- Editor: Monaco Editor
- Routing: React Router
- Authentication: Clerk React
Before running this project, make sure you have:
- Node.js (v18 or higher)
- Python (v3.11 or higher)
- Clerk Account (for authentication)
- Neon.tech Account (for PostgreSQL database)
git clone <your-repo-url>
cd lumnicode
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Create .env file
cp .env.example .env
Edit backend/.env
with your configuration:
# Database (from Neon.tech)
DATABASE_URL=postgresql://username:password@ep-example.us-east-1.aws.neon.tech/neondb
# Clerk Authentication
CLERK_SECRET_KEY=sk_test_your_clerk_secret_key_here
CLERK_PUBLISHABLE_KEY=pk_test_your_clerk_publishable_key_here
# Application Settings
DEBUG=True
APP_NAME=Lumnicode
# Generate initial migration
alembic revision --autogenerate -m "Initial migration"
# Run migrations
alembic upgrade head
cd ../frontend
# Install dependencies
npm install
# Create .env file
cp .env.example .env
Edit frontend/.env
with your Clerk configuration:
VITE_CLERK_PUBLISHABLE_KEY=pk_test_your_clerk_publishable_key_here
VITE_API_BASE_URL=http://localhost:8000
# From the root directory
docker-compose -f docker-compose.dev.yml up --build
This will start:
- Backend API at
http://localhost:8000
(with hot reload) - Frontend dev server at
http://localhost:3000
(with hot reload)
# From the root directory
docker-compose up --build
This will start:
- Backend API at
http://localhost:8000
- Frontend app served by Nginx at
http://localhost
(port 80)
Backend:
cd backend
# Activate virtual environment
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
# Start the server
uvicorn main:app --reload --host 0.0.0.0 --port 8000
Frontend:
cd frontend
npm run dev
Once the backend is running, you can access:
- API Documentation:
http://localhost:8000/docs
(Swagger UI) - Alternative Docs:
http://localhost:8000/redoc
(ReDoc)
GET /health
- Health checkGET /auth/me
- Get current user infoGET /projects
- List user projectsPOST /projects
- Create new projectGET /files?project_id=X
- List project filesPOST /files
- Create new filePOST /assist
- AI code assistance
cd backend
# Install development dependencies
pip install black ruff
# Format code
black .
# Lint code
ruff check .
# Run tests
pytest
cd frontend
# Format code
npm run format
# Lint code
npm run lint
# Type check
npx tsc --noEmit
cd backend
# Create new migration
alembic revision --autogenerate -m "Description of changes"
# Apply migrations
alembic upgrade head
# Rollback migration
alembic downgrade -1
lumnicode/
βββ backend/
β βββ src/
β β βββ api/ # API endpoints
β β βββ models/ # Database models
β β βββ schemas/ # Pydantic schemas
β β βββ services/ # Business logic
β β βββ db/ # Database configuration
β βββ alembic/ # Database migrations
β βββ main.py # FastAPI app entry point
β βββ requirements.txt # Python dependencies
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ lib/ # Utilities and API client
β βββ public/ # Static assets
β βββ package.json # Node.js dependencies
βββ docker-compose.yml # Docker configuration
- Create a Clerk account at clerk.com
- Create a new application
- Get your publishable and secret keys from the dashboard
- Add the keys to your
.env
files
Backend (.env):
CLERK_SECRET_KEY
: Your Clerk secret keyDATABASE_URL
: Your Neon.tech database URL
Frontend (.env):
VITE_CLERK_PUBLISHABLE_KEY
: Your Clerk publishable key
id
: Primary keyclerk_id
: Unique Clerk user identifieremail
: User emailfirst_name
,last_name
: User namescreated_at
,updated_at
: Timestamps
id
: Primary keyname
: Project namedescription
: Project descriptionowner_id
: Foreign key to usersis_public
: Visibility flagcreated_at
,updated_at
: Timestamps
id
: Primary keyname
: File namepath
: File path within projectcontent
: File contentlanguage
: Programming languageproject_id
: Foreign key to projectscreated_at
,updated_at
: Timestamps
- Connect your repository to Railway or Render
- Set environment variables in the platform dashboard
- The service will automatically build and deploy
- Connect your repository to Vercel
- Set the root directory to
frontend
- Add environment variables in Vercel dashboard
- Deploy automatically on push
Make sure to set these in your deployment platform:
Backend:
DATABASE_URL
CLERK_SECRET_KEY
CLERK_PUBLISHABLE_KEY
Frontend:
VITE_CLERK_PUBLISHABLE_KEY
VITE_API_BASE_URL
(your backend URL)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Database Connection Error:
- Verify your Neon.tech DATABASE_URL is correct
- Check if your IP is whitelisted in Neon.tech dashboard
Clerk Authentication Error:
- Ensure your Clerk keys are correctly set in environment variables
- Verify the keys match your Clerk application dashboard
Frontend Build Issues:
- Clear node_modules and reinstall:
rm -rf node_modules && npm install
- Check Node.js version compatibility
Backend Import Errors:
- Ensure you're in the correct virtual environment
- Reinstall requirements:
pip install -r requirements.txt
- Open an issue in the GitHub repository
- Check the API documentation at
/docs
- Review the browser console and server logs for error details
Built with β€οΈ using FastAPI, React, and modern web technologies.