{"id":39120103,"url":"https://github.com/clacky-ai/uniapp-fastapi-mysql-starter","last_synced_at":"2026-01-17T20:30:37.392Z","repository":{"id":305909326,"uuid":"1017323296","full_name":"clacky-ai/uniapp-fastapi-mysql-starter","owner":"clacky-ai","description":"UniApp FastAPI MySQL Starter from ClackyAI","archived":false,"fork":false,"pushed_at":"2025-07-22T15:44:14.000Z","size":161,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-22T17:20:14.079Z","etag":null,"topics":["fastapi","python","uniapp","weapp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clacky-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-10T11:05:26.000Z","updated_at":"2025-07-22T15:44:15.000Z","dependencies_parsed_at":"2025-07-22T17:21:31.165Z","dependency_job_id":null,"html_url":"https://github.com/clacky-ai/uniapp-fastapi-mysql-starter","commit_stats":null,"previous_names":["clacky-ai/uniapp-fastapi-mysql-starter"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/clacky-ai/uniapp-fastapi-mysql-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clacky-ai%2Funiapp-fastapi-mysql-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clacky-ai%2Funiapp-fastapi-mysql-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clacky-ai%2Funiapp-fastapi-mysql-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clacky-ai%2Funiapp-fastapi-mysql-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clacky-ai","download_url":"https://codeload.github.com/clacky-ai/uniapp-fastapi-mysql-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clacky-ai%2Funiapp-fastapi-mysql-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28517625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T18:55:29.170Z","status":"ssl_error","status_checked_at":"2026-01-17T18:55:03.375Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","python","uniapp","weapp"],"created_at":"2026-01-17T20:30:36.861Z","updated_at":"2026-01-17T20:30:37.379Z","avatar_url":"https://github.com/clacky-ai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UniApp FastAPI MySQL Starter\n\nA lightweight user management system built with FastAPI backend, UniApp frontend, and MySQL database. This project provides essential user authentication and management features for modern web applications with cross-platform support.\n\n## 🏗️ Project Structure\n\n```\n├── backend/              # FastAPI backend service\n│   ├── app/\n│   │   ├── api/         # API routes and endpoints\n│   │   ├── core/        # Core configurations and security\n│   │   ├── crud/        # Database CRUD operations\n│   │   ├── db/          # Database connection and setup\n│   │   ├── models/      # SQLAlchemy data models\n│   │   ├── schemas/     # Pydantic schemas for validation\n│   │   └── main.py      # FastAPI application entry point\n│   ├── requirements.txt # Python dependencies\n│   └── .env            # Environment variables\n├── frontend/            # UniApp Vue3 frontend application\n│   ├── src/\n│   │   ├── pages/      # Application pages\n│   │   ├── utils/      # Utility functions\n│   │   └── main.ts     # Application entry point\n│   ├── package.json    # Node.js dependencies\n│   └── vite.config.ts  # Vite configuration\n├── database/           # Database initialization scripts\n│   └── init.sql       # Database schema and sample data\n├── logs/              # Application logs\n└── scripts/           # Startup and utility scripts\n```\n\n## ✨ Features\n\n### Backend Features\n- ✅ **User Management**: Registration, authentication, and user profiles\n\n- ✅ **JWT Authentication**: Secure token-based authentication\n- ✅ **Permission Control**: Role-based access control\n- ✅ **Statistics API**: Dashboard metrics and analytics\n- ✅ **Admin Interface**: Built-in SQLAdmin management panel\n- ✅ **API Documentation**: Auto-generated OpenAPI/Swagger docs\n- ✅ **Database ORM**: SQLAlchemy with async support\n\n### Frontend Features\n- ✅ **Responsive Design**: Modern UI with mobile-first approach\n\n- ✅ **Real-time Stats**: Dynamic dashboard with live data\n- ✅ **Cross-platform**: Supports H5, WeChat Mini Program, and more\n- ✅ **TypeScript**: Full type safety throughout the application\n- ✅ **Vue 3 Composition API**: Modern Vue.js development patterns\n\n### Database Features\n- ✅ **MySQL Integration**: Robust relational database support\n- ✅ **Schema Management**: Well-structured user management tables\n- ✅ **Data Relationships**: Proper indexing and constraints\n- ✅ **Sample Data**: Pre-populated demo users for quick start\n\n## 🚀 Quick Start\n\n### Prerequisites\n- Python 3.12+\n- Node.js 20+\n- MySQL 8.0+\n\n### 1. Database Setup\n```bash\n# Create database and tables\nmysql -h 127.0.0.1 -u root -p \u003c database/init.sql\n```\n\n### 2. Backend Setup\n```bash\ncd backend\n\n# Install dependencies\npip install -r requirements.txt\n\n# Start the FastAPI server\nuvicorn app.main:app --host 0.0.0.0 --port 8000 --reload\n```\n\n### 3. Frontend Setup\n```bash\ncd frontend\n\n# Install dependencies\nnpm install\n\n# Start development server for H5\nnpm run dev:h5\n\n# Or for WeChat Mini Program\nnpm run dev:mp-weixin\n```\n\n### 4. Access URLs\n- **Frontend Application**: http://localhost:5174/\n- **API Documentation**: http://localhost:8000/docs\n- **Admin Panel**: http://localhost:8000/admin/\n- **Alternative API Docs**: http://localhost:8000/redoc\n\n## 🔐 Default Credentials\n\n**Admin Account:**\n- Username: `admin`\n- Password: `secret`\n\n**Test Users:**\n- alice / secret\n- bob / secret  \n- charlie / secret\n\n## 📚 API Endpoints\n\n### Authentication\n```\nPOST /api/v1/auth/login          # User login\nPOST /api/v1/users/              # User registration\nGET  /api/v1/users/me            # Get current user info\n```\n\n\n\n### Statistics\n```\nGET  /api/v1/stats/dashboard     # Get dashboard statistics\nGET  /api/v1/stats/overview      # Get application overview\n```\n\n## 🗄️ Database Schema\n\n### Users Table\n| Field | Type | Description |\n|-------|------|-------------|\n| id | INT | Primary key |\n| username | VARCHAR(50) | Unique username |\n| email | VARCHAR(100) | User email address |\n| password_hash | VARCHAR(255) | Hashed password |\n| full_name | VARCHAR(100) | Display name |\n| is_active | BOOLEAN | Account status |\n| created_at | DATETIME | Creation timestamp |\n| updated_at | DATETIME | Last update timestamp |\n\n\n\n## 🛠️ Technology Stack\n\n### Backend\n- **Framework**: FastAPI 0.116.0\n- **Database**: MySQL 8.0 with SQLAlchemy ORM\n- **Authentication**: JWT with python-jose\n- **Password**: bcrypt hashing\n- **Admin**: SQLAdmin interface\n- **Validation**: Pydantic v2\n- **Environment**: python-dotenv\n\n### Frontend\n- **Framework**: Vue 3.4.21 with Composition API\n- **Build Tool**: Vite 5.2.8\n- **Language**: TypeScript 4.9.4\n- **UI Framework**: UniApp 3.0\n- **Cross-platform**: H5, WeChat Mini Program, Alipay Mini Program\n- **HTTP Client**: Axios with request interceptors\n\n### Development \u0026 Deployment\n- **Code Quality**: ESLint, Ruff formatter\n- **Type Checking**: TypeScript, Vue TSC\n- **Environment**: Docker-ready configuration\n- **Logging**: Structured logging with file rotation\n\n## 🔧 Development Commands\n\n### Backend\n```bash\ncd backend\n\n# Install dependencies\npip install -r requirements.txt\n\n# Run with hot reload\nuvicorn app.main:app --reload\n\n# Format code with Ruff\nruff format .\n\n# Lint code\nruff check .\n```\n\n### Frontend\n```bash\ncd frontend\n\n# Install dependencies\nnpm install\n\n# Development (H5)\nnpm run dev:h5\n\n# Development (WeChat Mini Program)\nnpm run dev:mp-weixin\n\n# Build for production\nnpm run build\n\n# Type checking\nnpm run type-check\n\n# Lint code\nnpm run lint\n\n# Lint and fix\nnpm run lint:fix\n```\n\n## 🌟 Key Features Explained\n\n### Cross-Platform Support\nThe UniApp framework enables deployment to multiple platforms:\n- **H5**: Web browsers and mobile web\n- **WeChat Mini Program**: Native WeChat integration\n- **Alipay Mini Program**: Alipay ecosystem support\n- **Mobile Apps**: Android and iOS with uni-app build\n\n### API-First Design\n- RESTful API architecture\n- OpenAPI 3.0 specification\n- Automatic documentation generation\n- Request/response validation\n- Error handling with proper HTTP status codes\n\n### Security Implementation\n- JWT token-based authentication\n- Password hashing with bcrypt\n- CORS configuration for cross-origin requests\n- SQL injection prevention with SQLAlchemy ORM\n- Input validation with Pydantic schemas\n\n## 📖 Usage Examples\n\n\n\n### User Authentication\n```python\n# Backend authentication\nfrom app.core.security import verify_password, create_access_token\n\ndef authenticate_user(username: str, password: str):\n    user = get_user_by_username(username)\n    if not user or not verify_password(password, user.password_hash):\n        return False\n    return user\n\n# Generate JWT token\naccess_token = create_access_token(data={\"sub\": user.username})\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🆘 Support\n\nIf you encounter any issues or have questions:\n\n1. Check the [API documentation](http://localhost:8000/docs) when running the backend\n2. Review the console logs in the `logs/` directory\n3. Ensure all dependencies are properly installed\n4. Verify database connection settings in `backend/.env`\n\n## 🔄 Recent Updates\n\n- ✅ Fixed all Ruff formatting issues\n- ✅ Updated repository to git@github.com:clacky-ai/uniapp-fastapi-mysql-starter.git\n- ✅ Enhanced project documentation\n- ✅ Improved code structure and organization\n\n---\n\n**Made with ❤️ using FastAPI, Vue 3, and UniApp**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclacky-ai%2Funiapp-fastapi-mysql-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclacky-ai%2Funiapp-fastapi-mysql-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclacky-ai%2Funiapp-fastapi-mysql-starter/lists"}