Consolidate 3 separate applications (reports-app, data-entry-app, telegram-bot) into a unified
architecture with single backend and frontend:
Backend Changes:
- Unified FastAPI backend at backend/ with modular structure
- Modules: reports, data_entry, telegram in backend/modules/
- Centralized config.py and main.py with all routers registered
- Single worker mode (--workers 1) for Telegram bot compatibility
- Shared Oracle connection pool and JWT authentication
- Unified requirements.txt and environment configuration
Frontend Changes:
- Single Vue.js SPA with module-based routing
- Unified frontend at src/ with modules in src/modules/{reports,data-entry}/
- Shared components and stores in src/shared/
- Error boundaries for module isolation
- Dual API proxy in Vite for module communication
Infrastructure:
- New unified startup scripts: start-prod.sh, start-test.sh, start-backend.sh
- Environment templates: .env.dev.example, .env.test.example, .env.prod.example
- Updated deployment scripts for Windows IIS
- Simplified SSH tunnel management
Documentation:
- Comprehensive CLAUDE.md with architecture overview
- Module-specific docs in docs/{data-entry,telegram}/
- Architecture decision records in docs/ARCHITECTURE-DECISIONS.md
- Deployment guides consolidated in deployment/windows/docs/
This migration reduces complexity, improves maintainability, and enables easier
deployment while maintaining all existing functionality.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
103 lines
2.7 KiB
Markdown
103 lines
2.7 KiB
Markdown
# Quick Environment Reference
|
|
|
|
## 🔒 SECURITY FIRST
|
|
|
|
**All `.env*` files (except `.env*.example`) contain real credentials and are NEVER committed to git!**
|
|
|
|
## 🚀 First-Time Setup
|
|
|
|
```bash
|
|
# 1. Copy template with real credentials
|
|
cp backend/.env.prod.example backend/.env.prod
|
|
|
|
# 2. Edit with YOUR credentials
|
|
vim backend/.env.prod
|
|
|
|
# 3. Fill in the placeholders:
|
|
# - ORACLE_PASSWORD
|
|
# - JWT_SECRET_KEY
|
|
# - AUTH_SESSION_SECRET
|
|
# - TELEGRAM_BOT_TOKEN
|
|
# - SMTP_PASSWORD
|
|
|
|
# 4. Start production
|
|
./start-prod.sh
|
|
```
|
|
|
|
## 📋 Daily Usage
|
|
|
|
```bash
|
|
# Production (uses .env.prod automatically)
|
|
./start-prod.sh
|
|
|
|
# Test Environment (uses .env.test automatically)
|
|
./start-test.sh
|
|
|
|
# Quick Restart (uses existing .env)
|
|
./start-backend.sh restart
|
|
```
|
|
|
|
## ✏️ Changing Configuration
|
|
|
|
```bash
|
|
# 1. Edit the source file (NOT .env!)
|
|
vim backend/.env.prod # Production
|
|
vim backend/.env.test # Test
|
|
|
|
# 2. Restart to apply changes
|
|
./start-prod.sh
|
|
```
|
|
|
|
## 📁 Which File to Edit?
|
|
|
|
| You Want To... | Edit This File |
|
|
|----------------|----------------|
|
|
| Change dev database password | `backend/.env.prod` |
|
|
| Update test server settings | `backend/.env.test` |
|
|
| Add new environment variable | Templates: `.env*.example` + your `.env.prod`/`.env.test` |
|
|
| Create production config | Copy `.env.prod.example` to `.env.prod` and fill secrets |
|
|
|
|
## 🔑 Generating Secrets
|
|
|
|
```bash
|
|
# For JWT_SECRET_KEY and AUTH_SESSION_SECRET
|
|
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
|
|
```
|
|
|
|
**Generate DIFFERENT secrets for each environment (dev, test, prod)!**
|
|
|
|
## ⚠️ Important
|
|
|
|
- **Never edit** `backend/.env` directly (it's auto-generated!)
|
|
- **Always edit** `backend/.env.prod` or `.env.test`
|
|
- **Never commit** `.env`, `.env.prod`, `.env.test`, `.env.prod`
|
|
- **Only commit** `.env*.example` (templates with placeholders)
|
|
- Restart after changes for them to take effect
|
|
|
|
## 🛡️ Git Behavior
|
|
|
|
| File | Git Status | Contains |
|
|
|------|-----------|----------|
|
|
| `.env.prod.example` | ✅ Committed | Template (placeholders) |
|
|
| `.env.test.example` | ✅ Committed | Template (placeholders) |
|
|
| `.env.prod.example` | ✅ Committed | Template (placeholders) |
|
|
| `.env.example` | ✅ Committed | Generic template |
|
|
| `.env.prod` | ❌ Ignored | **Real dev credentials** |
|
|
| `.env.test` | ❌ Ignored | **Real test credentials** |
|
|
| `.env.prod` | ❌ Ignored | **Real prod credentials** |
|
|
| `.env` | ❌ Ignored | Auto-generated (current) |
|
|
|
|
## ✅ Quick Check
|
|
|
|
```bash
|
|
# See what git will commit
|
|
git status backend/.env*
|
|
|
|
# Should show ONLY .env*.example files
|
|
# If .env.prod or .env.test appear, they're NOT properly ignored!
|
|
```
|
|
|
|
## 📖 More Info
|
|
|
|
See `backend/ENV-SETUP.md` for complete documentation.
|