{"id":21823400,"url":"https://github.com/steeve0403/apiaiflask","last_synced_at":"2026-04-13T22:02:42.720Z","repository":{"id":259453218,"uuid":"867646912","full_name":"steeve0403/ApiAiFlask","owner":"steeve0403","description":"This API facilitates interaction with one or more AI models through a user interface. ","archived":false,"fork":false,"pushed_at":"2024-10-20T12:38:33.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T11:35:45.858Z","etag":null,"topics":["ai","api","flask","python"],"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/steeve0403.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-10-04T13:04:47.000Z","updated_at":"2024-10-24T12:26:40.000Z","dependencies_parsed_at":"2024-10-25T15:56:12.247Z","dependency_job_id":"013abb05-f5a3-4295-af22-9cad12e3ec87","html_url":"https://github.com/steeve0403/ApiAiFlask","commit_stats":null,"previous_names":["steeve0403/apiaiflask"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/steeve0403/ApiAiFlask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steeve0403%2FApiAiFlask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steeve0403%2FApiAiFlask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steeve0403%2FApiAiFlask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steeve0403%2FApiAiFlask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steeve0403","download_url":"https://codeload.github.com/steeve0403/ApiAiFlask/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steeve0403%2FApiAiFlask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31772642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"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":["ai","api","flask","python"],"created_at":"2024-11-27T17:31:53.180Z","updated_at":"2026-04-13T22:02:42.687Z","avatar_url":"https://github.com/steeve0403.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Flask AI API - Documentation\n\n## Description\nThis API facilitates interaction with one or more AI models through a user interface. The project provides features such as user authentication, \nAPI key management, and an admin role to control users and logs. This API is designed to be used with a separate project that manages the AI models, \nwhile this API acts as an intermediary between the user interface and the AI models.\n\n## Features\n\n- **User Management**: Sign up, login, logout, and role-based access control (admin/user).\n- **API Keys**: Generation and management of API keys for authenticated users.\n- **Authentication**: JSON Web Tokens (JWT) for secure user authentication.\n- **Roles**: Admin and user roles, with specific permissions for each.\n- **Logging**: Manage and view logs for user actions and API usage.\n\n## Technology Stack\n\n- **Framework**: Flask\n- **Database**: Flask-SQLAlchemy (supports MySQL or SQLite by default)\n- **Authentication**: Flask-JWT-Extended for JWT token management.\n- **Migrations**: Flask-Migrate for database migrations.\n- **API Documentation**: ReDoc (OpenAPI specifications)\n\n## Requirements\n\n- **Python 3.8+**\n- **MySQL** or **SQLite**\n- **pip** for installing Python packages\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/steeve0403/ApiAiFlask.git\n   cd ApiAiFlask\n   ```\n\n2. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. Configure the environment:\n   Create a `.env` file in the root directory and set the following environment variables:\n   ```bash\n   FLASK_APP=app.py\n   FLASK_ENV=development\n   SECRET_KEY=your-secret-key\n   SQLALCHEMY_DATABASE_URI=mysql://username:password@localhost/dbname\n   ```\n\n4. Initialize the database:\n   ```bash\n   flask db init\n   flask db migrate\n   flask db upgrade\n   ```\n\n5. Run the server:\n   ```bash\n   flask run\n   ```\n\n## Usage\n\n### Authentication\n- **Sign up**: `/api/auth/signup` (POST)\n- **Login**: `/api/auth/signin` (POST)\n- **Logout**: `/api/auth/logout` (POST)\n\n### Users (Admin only)\n- **List users**: `/api/admin/users` (GET)\n- **Deactivate/Activate user**: `/api/admin/users/\u003cint:user_id\u003e/deactivate` (PUT)\n\n### API Keys\n- **Generate API key**: `/api/keys/generate` (POST)\n- **List API keys**: `/api/keys/all` (GET)\n\n## API Documentation\n\nAccess the interactive API documentation (ReDoc) at:\n```\nhttp://localhost:5000/redoc\n```\nThis documentation is automatically generated based on the OpenAPI specifications.\n\n## Testing\n\nTo run the unit tests:\n```bash\npytest\n```\n\n## Deployment\n\nTo deploy the application using **Docker**, follow these steps:\n\n1. Build the Docker image:\n   ```bash\n   docker build -t ApiAiFlask.\n   ```\n\n2. Run the Docker container:\n   ```bash\n   docker run -p 5000:5000 ApiAiFlask\n   ```\n\n## Contributing\n\nContributions are welcome! Please submit a pull request or open an issue for any feature requests or improvements.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteeve0403%2Fapiaiflask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteeve0403%2Fapiaiflask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteeve0403%2Fapiaiflask/lists"}