{"id":22733839,"url":"https://github.com/samthinkgit/aia-battleground-backend","last_synced_at":"2025-06-30T03:06:41.457Z","repository":{"id":262864096,"uuid":"888599315","full_name":"SamthinkGit/AIA-Battleground-Backend","owner":"SamthinkGit","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-12T13:09:37.000Z","size":17554,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T02:11:31.857Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://colab.research.google.com/drive/1RH6nEtPFokiP6Yf4ums0xIFa1W-UYdyB#scrollTo=H1xwd5xJseti","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/SamthinkGit.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}},"created_at":"2024-11-14T17:14:29.000Z","updated_at":"2024-12-12T13:15:27.000Z","dependencies_parsed_at":"2025-02-05T04:42:26.833Z","dependency_job_id":null,"html_url":"https://github.com/SamthinkGit/AIA-Battleground-Backend","commit_stats":null,"previous_names":["samthinkgit/aia-battleground-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SamthinkGit/AIA-Battleground-Backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamthinkGit%2FAIA-Battleground-Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamthinkGit%2FAIA-Battleground-Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamthinkGit%2FAIA-Battleground-Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamthinkGit%2FAIA-Battleground-Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamthinkGit","download_url":"https://codeload.github.com/SamthinkGit/AIA-Battleground-Backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamthinkGit%2FAIA-Battleground-Backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262702324,"owners_count":23350641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-10T20:16:22.889Z","updated_at":"2025-06-30T03:06:41.422Z","avatar_url":"https://github.com/SamthinkGit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AIA-Battleground-Backend\n![image](https://github.com/user-attachments/assets/b3e8f897-bf80-4586-840d-bac09119097e)\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif\"\u003e\n\u003c/div\u003e\n\n### Main Components\n\n- **Backend**: Contains the game logic and AI analyzer.\n  - `app.py`: Main backend server.\n  - `analyser.py`: File to modify the guided prompt of the analyzer.\n  - `game.py`: Initial game configuration and mechanics.\n  - `wrappers/character_wrapper.py`: Defines fighters and their attributes.\n  - `wrappers/examples`: Examples of customized fighters.\n\n- **Frontend**: Graphical interface accessible via a web browser.\n  - `index.html`: Main game page.\n  - `media/`: Contains images and videos used in the design.\n  - `scripts/`: Contains `script.js` for frontend functionality.\n  - `styles/`: Contains `styles.css` for visual styling.\n\n- **scripts/setup.sh**: Script to set up project dependencies.\n\n## Installation\n\n### Prerequisites\n\n- Python 3.10 or higher.\n- Web browser (Firefox, Chrome, Edge, etc.).\n- Some python libraries such as langchain, colorama, etc. (requirements.txt not defined yet)\n### Initial Setup\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/SamthinkGit/AIA-Battleground-Backend/edit/main/README.md\n   cd AIA-Battleground-Backend\n   ```\n\n2. Run the `setup.sh` script to link the PYTHONPATH:\n   ```bash\n   source scripts/setup.sh\n   ```\n   This script must be run in every new terminal session or added to the `~/.bashrc` file for automation.\n\n   To add it to bashrc:\n   ```bash\n   echo \"source $(pwd)/scripts/setup.sh\" \u003e\u003e ~/.bashrc\n   ```\n\n## Usage\n\n### Starting the Server\n\n1. Launch the backend on port 8000:\n   ```bash\n   uvicorn backend.app:app --port 8000\n   ```\n\n2. Launch the frontend server on port 5500:\n   ```bash\n   cd frontend\n   python -m http.server 5500\n   ```\n\n### Accessing the Game\n\nOpen a web browser and visit:\n- `http://localhost:5500` to access the frontend.\n\n### Game Customization\n\n1. **AI Analyzer**: Modify the `backend/analyser.py` file to adjust the guided prompt as needed for the event.\n2. **Game Parameters**: Edit the `backend/game.py` file to change initialization values and game mechanics.\n3. **Fighters**: Modify or add fighters in `backend/wrappers/character_wrapper.py`. Each fighter must define a `response` variable with `attack`, `defend`, and `parry` attributes.\n4. **Visual Appearance**: Edit the `frontend/index.html` file and resources in the `media/` folder to customize names, images, and backgrounds.\n\n### Examples\n\nPreconfigured fighter examples (`example_1.py`, `example_2.py`, etc.) are included in the `wrappers/examples/` folder and can be used directly in battles.\n\n## Contributing\n\nWe welcome contributions to the project! Please open an issue or pull request in the repository if you have suggestions or improvements.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamthinkgit%2Faia-battleground-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamthinkgit%2Faia-battleground-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamthinkgit%2Faia-battleground-backend/lists"}