# Quick Start Guide ## โœ… Everything Still Works! Your existing code (`auth/`, `models/`, `gateway/`, `extensions/`) **still works exactly as before**. The Core Engine System is **added on top**, not replacing anything. ## ๐Ÿš€ Quick Setup (3 Steps) ### Step 1: Create .env File Create a file named `.env` in the project root: ```bash # Minimum required for Core Engine MONGODB_USER_LIVE=your_username MONGODB_PASSWORD_LIVE=your_password MONGODB_HOST_LIVE=your_host MONGODB_PORT_LIVE=27017 MONGODB_DB_LIVE=your_database JWT_SECRET_KEY=your_secret_key_here # Optional (for external services) # IMPORTANT: Set your actual core service URL here CORE_SERVICE_URL=your_core_service_url_here FPL_SERVICE_URL=https://fpl.nanope.ai ``` **Or copy from example:** ```bash cp .env.example .env # Then edit .env with your actual values ``` ### Step 2: Install New Dependencies ```bash pip install -r requirements.txt ``` This installs: - `pydantic` (for request validation) - `pytest` (for testing) ### Step 3: Run the App ```bash python app.py ``` The app will start on `http://localhost:5001` ## ๐Ÿงช Test It Works ### Test Existing Endpoint (Should Still Work) ```bash curl http://localhost:5001/api/test ``` ### Test New Core Engine Endpoint ```bash # Get JWT token first from /auth/v1/POSTloginverifyotp # Then: curl -X POST http://localhost:5001/api/v1/loan/apply \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -H "X-Platform: NOW" \ -d '{"loan_amount": 5000, "purpose": "Business"}' ``` ## ๐Ÿ“ What's New? ``` pebble26/ โ”œโ”€โ”€ core_engine/ โ† NEW: Core Engine System โ”‚ โ”œโ”€โ”€ apim/ โ† API Gateway Layer โ”‚ โ”œโ”€โ”€ logic/ โ† Orchestration Layer โ”‚ โ”œโ”€โ”€ services/ โ† Service Layer โ”‚ โ”œโ”€โ”€ domain/ โ† Domain Models โ”‚ โ””โ”€โ”€ common/ โ† Common Utilities โ”œโ”€โ”€ auth/ โ† EXISTING: Still works! โ”œโ”€โ”€ models/ โ† EXISTING: Still works! โ”œโ”€โ”€ gateway/ โ† EXISTING: Still works! โ”œโ”€โ”€ extensions/ โ† EXISTING: Still works! โ””โ”€โ”€ app.py โ† UPDATED: Registers both old & new ``` ## โš ๏ธ What If .env is Missing? - โœ… App **will still start** - โœ… Existing endpoints **will still work** - โš ๏ธ Core Engine endpoints **may fail** (they need .env) - โš ๏ธ You'll see **warnings** in console ## ๐Ÿ” Verify Setup ```bash # Test imports python -c "from core_engine.common.config import Config; print('โœ“ Core Engine imports OK')" # Test app starts python -c "from app import app; print('โœ“ App imports OK')" ``` ## ๐Ÿ“š More Info - **Setup Details**: See `SETUP_GUIDE.md` - **API Docs**: See `CORE_ENGINE_README.md` - **Architecture**: See `ARCHITECTURE_DESIGN.md` --- **TL;DR**: Create `.env` file, run `pip install -r requirements.txt`, then `python app.py`. Everything else works as before! ๐ŸŽ‰