A modern full-stack application built with Next.js (TypeScript) and FastAPI (Python), running on Oracle Cloud with Cloudflare services (D1 database and KV storage).
- Frontend: Next.js 14 with TypeScript (deployable to Cloudflare Pages)
- Backend: FastAPI running on Oracle Cloud
- Database: Cloudflare D1 (SQLite-compatible)
- Storage: Cloudflare KV (Key-Value store)
chmod +x setup.sh
./setup.shFollow the Cloudflare Setup Guide to:
- Create D1 database
- Create KV namespace
- Get API credentials
Then update backend/.env:
CLOUDFLARE_ACCOUNT_ID=your_account_id
CLOUDFLARE_API_TOKEN=your_api_token
CLOUDFLARE_D1_DATABASE_ID=your_database_id
CLOUDFLARE_KV_NAMESPACE_ID=your_namespace_idTerminal 1 - Backend (Oracle Cloud compatible)
cd backend
source venv/bin/activate
python run.pyTerminal 2 - Frontend
cd frontend
npm run devVisit:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- START_HERE.md - Quick start guide
- QUICKSTART.md - Detailed setup
- PROJECT_OVERVIEW.md - Architecture details
- cloudflare/README.md - Cloudflare setup
- backend/README.md - Backend docs
- frontend/README.md - Frontend docs
- ⚡ Fast async Python API
- 🗄️ Cloudflare D1 database integration
- 💾 Cloudflare KV storage
- 📝 Auto-generated API docs
- 🔒 CORS configured
- ⚛️ React 18 with TypeScript
- 💅 Tailwind CSS styling
- 🌓 Dark mode support
- 📱 Responsive design
- ☁️ Cloudflare Pages ready
- 🗄️ D1: SQLite-compatible database
- 💾 KV: Fast key-value storage
- 🌍 Global edge network
- 🚀 Serverless architecture
GET /- Health checkGET /health- Detailed statusPOST /unfreeze- Main endpoint
GET /cloudflare/d1/status- Database statusPOST /cloudflare/d1/query- Execute SQL queryPOST /cloudflare/d1/batch- Batch queries
GET /cloudflare/kv/status- KV statusGET /cloudflare/kv/{key}- Get valuePUT /cloudflare/kv- Store valueDELETE /cloudflare/kv/{key}- Delete value
-
Create Oracle Cloud Compute Instance
- Choose Ubuntu/AlmaLinux
- Open ports 80, 443, 8000
-
Deploy Backend
# On Oracle Cloud instance
git clone your-repo
cd dubhacks-25/backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Add .env with Cloudflare credentials
python run.py- Setup Nginx (optional)
sudo apt install nginx
# Configure reverse proxy for production- Push code to GitHub
- Go to Cloudflare Pages
- Connect repository
- Set build settings:
- Build command:
cd frontend && npm install && npm run build - Build output:
frontend/.next - Root directory:
/
- Build command:
- Add environment variable:
NEXT_PUBLIC_API_URL: Your Oracle Cloud backend URL
- Deploy!
Initialize your D1 database:
cd cloudflare
wrangler d1 create unfreeze-db
wrangler d1 execute unfreeze-db --file=./schema.sql- Test Cloudflare locally: Use Wrangler CLI
- Monitor Oracle Cloud: Set up logging and monitoring
- Secure your API: Add authentication middleware
- Use environment variables: Never commit secrets
MIT License - feel free to use this project!
Built with ❤️ for DubHacks 2025
Stack: Next.js + FastAPI + Oracle Cloud + Cloudflare