A system for quickly configuring data and developing page APPs. You can also think of it as a lightweight low-code platform for personal use, which will shine even more in the AI era. The following is an AI-organized guide. Welcome to try it out.
A modern data management system based on Flask + Vite + Tailwind CSS, providing user authentication, data management, and API services.
- User Management: User registration, login, authentication
- Dataset Management: CRUD operations, filtering, and combined queries
- API Services: Provides simple and easy-to-use API interfaces, supporting complex data queries
- Database Operations: ORM operations based on SQLAlchemy
- Logging: Complete operation log records
- CORS Support: Cross-origin request support
- Modern UI: Responsive design based on Tailwind CSS
- User Interfaces: Login, registration, user center, data management pages
- Componentization: Modular frontend component system
- Hot Reload: Vite dev server supports real-time hot updates
- Animation Effects: Smooth animations with Animate.css
python-data-api-open/
├── api/ # API route modules
│ ├── dataset.py # Dataset management API
│ ├── frame.py # Framework-related API
│ ├── service.py # Service API
│ └── user.py # User management API
├── comp/ # Core components
│ ├── base.py # Base class
│ ├── cache.py # Cache component
│ ├── datalogic.py # Data logic
│ ├── db.py # Database operations
│ ├── emaillogic.py # Email logic
│ ├── smsJDlogic.py # SMS logic
│ └── tool.py # Utility functions
├── conf/ # Configuration files
│ └── workflow.py # Workflow configuration
├── static/ # Frontend static resources
│ ├── app/ # Application pages
│ │ ├── login.html # Login page
│ │ ├── datamanage.html # Data management page
│ │ └── usercenter.html # User center page
│ ├── assets/ # Static assets
│ │ ├── css/ # Stylesheets
│ │ ├── js/ # JavaScript files
│ │ ├── images/ # Images
│ │ └── template/ # Template files
│ ├── package.json # Frontend dependencies
│ ├── vite.config.js # Vite configuration
│ └── tailwind.config.js # Tailwind CSS configuration
├── app.py # Flask application entry
├── env.py # Environment configuration
├── requirements.txt # Python dependencies
├── init.py # Database initialization script
├── start.sh # Startup script
├── stop.sh # Stop script
└── README.md # Project documentation
git clone <repository-url>
cd python-data-api-open
Edit the env.py
file to set up your database connection:
# Database configuration
DB_HOST = "localhost"
DB_PORT = 3306
DB_USER = "your_username"
DB_PWD = "your_password"
DB_NAME = "your_database"
# Flask configuration
FLASK_RUN_PORT = 5070
SECRET_KEY = "your_secret_key"
# Page configuration
PAGE_HOST = "http://localhost:5173"
python init.py
This script will automatically:
- Install Python dependencies (
pip install -r requirements.txt
) - Install frontend dependencies (
cd static && npm install
) - Initialize database tables
- Import initial data
# Start both backend and frontend
./start.sh
# Stop the services
./stop.sh
# In a new terminal, start frontend service
cd static
npm run dev
# Start backend service
python app.py
# In a new terminal, start frontend service
cd static
npm run dev
- Frontend: http://localhost:5173
- Backend API: http://localhost:5070
- Visit
/app/login
for user login/registration - Supports mobile verification code registration
- User authentication and session management
- Visit
/app/datamanage
for data management - Supports CRUD operations on data
- Provides advanced filtering and search features
- Supports combined data queries
/dataset/*
- Dataset management API (for external system access)/user/*
- User management API (for internal authentication)/frame/*
- Framework configuration API/service/*
- Service API (for internal system access)
cd static
npm run dev # Start Vite dev server
python app.py # Start Flask dev server
- Flask: Web framework
- SQLAlchemy: ORM for database operations
- PyMySQL: MySQL database driver
- Flask-CORS: CORS support
- Gunicorn: WSGI server
- Vite: Modern build tool
- Tailwind CSS: Utility-first CSS framework
- jQuery: JavaScript library
- Animate.css: CSS animation library
- Font Awesome: Icon library
- jQuery AppManager: Custom page app manager
- Low-Code Development: Rapid UI development with minimal JavaScript
- Component Reusability: Modular components that can be shared across pages
- Consistent UX: Standardized dialog, form, and interaction patterns
- Type Safety: Structured data flow and validation
- Performance: Efficient DOM manipulation and event handling
Set database connection parameters in env.py
:
DB_HOST = "localhost" # Database host
DB_PORT = 3306 # Database port
DB_USER = "root" # Database username
DB_PWD = "password" # Database password
DB_NAME = "datain" # Database name
Configure Vite in static/vite.config.js
:
import { defineConfig } from 'vite'
export default defineConfig({
root: '.',
server: {
host: '0.0.0.0',
port: 5173
}
})
- Port Configuration: Make sure ports 5070 and 5173 are available
- Database: Ensure MySQL service is running and configured correctly
- Node.js: Node.js (v16+) is required
- Python: Python 3.8+ is recommended
-
Port Occupied
# Check port usage lsof -i :5070 lsof -i :5173
-
Database Connection Failure
- Check database configuration in
env.py
- Ensure MySQL service is running
- Check database configuration in
-
Frontend Dependency Installation Failure
cd static rm -rf node_modules package-lock.json npm install
-
Python Dependency Installation Failure
pip install -r requirements.txt --upgrade
This project is licensed under the MIT License. See LICENSE for details.
Contributions are welcome! Please submit issues and pull requests to help improve this project.
Development Team: Sway Team
Version: 1.0.0
Last Updated: 2025