Ứng dụng học tiếng Anh dành cho người Việt với AI, cung cấp luyện tập dịch Việt-Anh kèm phản hồi chi tiết, sửa lỗi ngữ pháp và chấm điểm theo thời gian thực.
https://chien-english.pages.dev
- Node.js >= 18
- npm or yarn
- MiMo API Key (for AI grading)
- Supabase Project (for auth & database)
git clone https://github.com/quemanhmcr/chien-english.git
cd chien-english
npm installCopy the example file and fill in your values:
cp .env.example .env.localEdit .env.local:
# Supabase (required)
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
# MiMo API (for local development with Vite proxy)
MIMO_API_KEY=your_mimo_api_keynpm run devApp will be available at: http://localhost:3000
┌─────────────────┐ ┌──────────────────────┐ ┌─────────────────┐
│ Browser │ ──▶ │ Cloudflare Pages │ ──▶ │ MiMo API │
│ (React App) │ │ + Functions │ │ (AI Grading) │
└─────────────────┘ └──────────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ Supabase │
│ (Auth + DB) │
└─────────────────┘
| Aspect | Decision | Reason |
|---|---|---|
| Hosting | Cloudflare Pages | Free, fast, global CDN |
| API Security | Cloudflare Functions proxy | API keys never exposed to browser |
| CI/CD | GitHub Actions | Auto-deploy on push to main |
| Auth | Supabase Auth | Easy, secure, supports multiple providers |
chien-english/
├── components/ # React components
├── services/ # API services (mimoService, authService)
├── functions/ # Cloudflare Pages Functions
│ └── api-mimo/ # Proxy for MiMo API (server-side)
├── .github/workflows/ # GitHub Actions CI/CD
├── .env.example # Environment variables template
├── vite.config.ts # Vite configuration
├── wrangler.toml # Cloudflare Pages configuration
└── package.json
| Variable | Description |
|---|---|
VITE_SUPABASE_URL |
Supabase project URL |
VITE_SUPABASE_ANON_KEY |
Supabase anonymous key |
| Variable | Description | Where to Set |
|---|---|---|
MIMO_API_KEY |
MiMo AI API key | Cloudflare Pages Settings |
⚠️ Security Note:MIMO_API_KEYis NEVER sent to the browser. It's only used by Cloudflare Functions server-side.
Push to main branch → GitHub Actions automatically builds and deploys to Cloudflare Pages.
git add .
git commit -m "Your changes"
git push origin mainnpm run deploy| Script | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build locally |
npm run deploy |
Manual deploy to Cloudflare Pages |
npm run typecheck |
Run TypeScript type checking |
Go to: Settings → Secrets and variables → Actions
| Secret | Description |
|---|---|
CLOUDFLARE_API_TOKEN |
Cloudflare API token with Pages edit permission |
CLOUDFLARE_ACCOUNT_ID |
Your Cloudflare account ID |
VITE_SUPABASE_URL |
Supabase project URL |
VITE_SUPABASE_ANON_KEY |
Supabase anon key |
MIMO_API_KEY |
MiMo API key |
Go to: Cloudflare Dashboard → Pages → chien-english → Settings → Environment Variables
| Variable | Environment |
|---|---|
MIMO_API_KEY |
Production (and Preview if needed) |
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Test locally with
npm run dev - Commit:
git commit -m "feat: Add amazing feature" - Push:
git push origin feature/amazing-feature - Open a Pull Request
This project is private. All rights reserved.
