# lab3-2 **Repository Path**: larryivanhan/lab3-2 ## Basic Information - **Project Name**: lab3-2 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-30 - **Last Updated**: 2026-05-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Smart Travel Planner Lab 3-2 front-end/back-end separated project: a travel planner built with Vue 3, FastAPI, SQLite, AMap, QWeather, and DeepSeek-compatible chat completion APIs. ## Features - Create, view, edit, and delete travel plans. - Persist plans in SQLite and reopen them after restart. - Automatically create itinerary days from the selected date range. - Add locations through AMap click selection or manual latitude/longitude input. - Move locations across days and morning/afternoon/evening time slots. - Use quick plan templates, search/sort historical plans, duplicate existing plans, and export itineraries. - Fetch weather through the backend so weather credentials stay server-side. - Run planning checks for empty days, tight budgets, overpacked slots, and outdoor-weather risk. - Generate an AI-assisted travel summary based on plan details, weather, schedule, budget, and checks. - Fall back to a local structured summary when no DeepSeek key is configured, so the app remains demoable. ## Project Structure ```text backend/ FastAPI service, SQLite models, external API integration frontend/ Vue 3 + Vite + Pinia + Element Plus UI docs/ Design notes, collaboration record, and experiment summary ``` ## Backend Setup ```bash cd backend python3 -m venv venv source venv/bin/activate pip install -r requirements.txt cp .env.example .env uvicorn main:app --reload ``` The backend runs at `http://localhost:8000`. ## Frontend Setup ```bash cd frontend npm install cp .env.example .env.local npm run dev ``` The frontend runs at the Vite URL shown in the terminal, usually `http://localhost:5173`. ## Environment Variables Backend: - `DATABASE_URL`: SQLite database URL, defaults to `sqlite:///./travel_planner.db`. - `HEFENG_WEATHER_API_KEY`: QWeather key. - `DEEPSEEK_API_KEY`: DeepSeek-compatible API key. - `DEEPSEEK_BASE_URL`: Chat completions endpoint. - `DEEPSEEK_MODEL`: Chat model name. Frontend: - `VITE_API_BASE_URL`: Backend API base URL. - `VITE_AMAP_KEY`: AMap Web JS key. - `VITE_AMAP_SECURITY_CODE`: AMap security code. Real `.env` files are ignored by Git. Commit only `.env.example`. ## Verification ```bash cd frontend && npm run build cd .. && backend/venv/bin/python -m py_compile backend/main.py backend/routers/*.py backend/models/*.py backend/schemas/*.py backend/crud/*.py backend/core/*.py backend/services/*.py ``` For API smoke testing, use FastAPI's `TestClient` or open `/docs` after starting the backend.