# crowdsensing **Repository Path**: enchated/crowdsensing ## Basic Information - **Project Name**: crowdsensing - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2025-12-04 - **Last Updated**: 2025-12-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Crowdsensing ## Project Introduction Crowdsensing is an open-source project hosted on Gitee, designed to collect data through crowdsourcing, integrating frontend and backend technologies to efficiently handle simulation and sensing tasks. The project primarily includes modules for simulation services, agent behavior definitions, database operations, and WebSocket communication. ## Technical Architecture - **Backend**: Written in Python using the FastAPI framework to provide RESTful APIs, with SQLAlchemy for database operations, supporting simulation creation, start, stop, and reset functions. - **Frontend**: Built on Vue.js with tools such as Babel and ESLint, providing a user interface for interacting with the backend, supporting real-time simulation visualization and control. ## Key Features - **Simulation Service**: Supports creating, starting, stopping, and resetting simulations, with real-time snapshot retrieval. - **Agent Behavior**: Defines movement and interaction strategies for hunter and target agents, including behaviors such as capture, encirclement, and exploration. - **Database**: Manages simulation, agent, and snapshot data via ORM models, supporting cleanup and export of old simulation data. - **WebSocket**: Enables real-time communication between frontend and backend for synchronized simulation state updates. ## Installation Dependencies ### Backend 1. Install dependencies: ```bash pip install -r backend/requirements.txt ``` 2. Initialize the database: ```bash python backend/create_db_standalone.py ``` ### Frontend 1. Install Node.js dependencies: ```bash cd frontend npm install ``` ## Usage Instructions ### Backend Start the FastAPI application: ```bash cd backend uvicorn app.main:app --reload ``` Visit `/docs` to access the API documentation and perform operations. ### Frontend Run the Vue project: ```bash cd frontend npm run serve ``` Access `http://localhost:8080` to use the Crowdsensing system. ## Module Overview - `backend/app/api/routes.py`: Defines RESTful API endpoints. - `backend/app/models/agent.py`: Defines agent classes and their behaviors. - `backend/app/services/simulation_service.py`: Core logic for simulation service handling. - `backend/app/database.py`: Database connection and initialization. - `frontend`: Vue frontend code for simulation control and display. ## License This project is licensed under the MIT License. For details, see the `LICENSE` file in the root directory. To contribute code or report issues, please visit the [project page](https://gitee.com/little_alone/crowdsensing) to submit an issue or pull request.