{"id":25638543,"url":"https://github.com/stenwire/token-deduction-chatbot-api","last_synced_at":"2026-06-23T05:31:19.027Z","repository":{"id":270641106,"uuid":"858869108","full_name":"stenwire/Token-deduction-chatbot-API","owner":"stenwire","description":"knock knock","archived":false,"fork":false,"pushed_at":"2025-01-02T03:12:33.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T02:33:23.672Z","etag":null,"topics":[],"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/stenwire.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-09-17T17:12:04.000Z","updated_at":"2025-01-02T03:19:52.000Z","dependencies_parsed_at":"2025-01-02T04:21:35.808Z","dependency_job_id":"b620e17a-51a5-4713-a6d5-a0d927d359ec","html_url":"https://github.com/stenwire/Token-deduction-chatbot-API","commit_stats":null,"previous_names":["stenwire/upnyx_task_solution"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stenwire/Token-deduction-chatbot-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stenwire%2FToken-deduction-chatbot-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stenwire%2FToken-deduction-chatbot-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stenwire%2FToken-deduction-chatbot-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stenwire%2FToken-deduction-chatbot-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stenwire","download_url":"https://codeload.github.com/stenwire/Token-deduction-chatbot-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stenwire%2FToken-deduction-chatbot-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34677382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-02-23T02:31:47.370Z","updated_at":"2026-06-23T05:31:19.011Z","avatar_url":"https://github.com/stenwire.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simplification of a token deduction chatbot API, kind of like using OpenAIs API\n\u003e You're charged an amount of token to communicate with the chat-bot API\n\n---\n\n## How to Use\n\n### Requirements:\n- **Make**\n- **Docker**\n- **Docker Compose**\n\n---\n\n### Running the Application with Docker (Recommended)\n\n1. **Clone the repository:**\n   ```bash\n   git clone \u003crepo-url\u003e\n   ```\n\n2. **Navigate to the project directory:**\n   ```bash\n   cd \u003crepo-directory\u003e\n   ```\n\n3. **Set up the environment:**\n   - Duplicate the `.env.example` file:\n     ```bash\n     cp .env.example .env\n     ```\n   - Edit the `.env` file to suit your configuration.\n   - Modify the `postgres` service in `docker-compose.yml` to reflect your choice of database, and ensure this matches the `.env` file.\n\n4. **Build the docker image:**\n   ```bash\n   make build\n   ```\n\n5. **Run migrations:**\n   ```bash\n   make migrate\n   ```\n\n6. **Create a superuser:**\n   ```bash\n   make createsuperuser\n   ```\n   - Fill in the required details (your password won't be visible).\n\n7. **Start the server:**\n   ```bash\n   make up\n\n   # to run tests\n   make test\n   ```\n\n8. **Access the application:**\n   - Visit [http://127.0.0.1:8000](http://127.0.0.1:8000) in your browser to start using the application.\n\n8. **Edit templates and customize as needed.**\n\n---\n\n### Running the Application Outside of Docker (Not Recommended)\n\n1. **Create a Postgres database:**\n   - You can do this manually through `psql` commands (not recommended).\n\n2. **Set up the environment:**\n   - Duplicate the `.env.example` file and rename it to `.env`.\n   - Edit the `.env` file, especially the database settings\n3. **Run migrations:**\n   ```bash\n   python manage.py migrate\n   ```\n\n4. **Start the server:**\n   ```bash\n   gunicorn --bind 0.0.0.0:8000 config.wsgi:application\n   ```\n\n5. **Access the application:**\n   - Visit [http://127.0.0.1:8000](http://127.0.0.1:8000).\n\n6. **Switch to Docker for a smoother experience!**\n\n---\n\n### Common Commands (Makefile)\n\nMost of the commands you'll need are defined in the `Makefile`. Use them as:\n\n```bash\nmake \u003ccommand\u003e\n```\n\n**Available Commands:**\n- `up`: Start up the containers\n- `bash`: Start a bash shell for the application\n- `build`: Build the containers only\n- `build-up`: Build and start the containers\n- `createsuperuser`: Create a superuser for the Django app\n- `down`: Stop the containers\n- `format`: Run `isort` and `black` to format the codebase\n- `flush-db`: Empty the database and reset it from scratch\n- `install`: Install all dependencies in a local virtual environment\n- `lint`: Run `ruff` to lint and format the code\n- `migrations`: Create migrations based on DB schema changes\n- `migrate`: Run migrations\n- `resetdb`: Reset the database and delete everything, including the database itself\n- `run-command`: Run any custom command in the Django app context (e.g., `make run-command command=\"python manage.py test\"`)\n- `shell`: Start a Django shell session\n- `test`: Run the test suite using `pytest`\n- `testcase`: Run a single test case (e.g., `make testcase testcase=\"tests/test_models.py::TestUserModel::test_user_can_be_created\"`)\n- `up-d`: Start the container in detached mode (without logs)\n\n---\n\n### Running Commands in Docker\n\nFirst, check if the command you need is in the list above. If it is, use:\n\n```bash\nmake \u003ccommand\u003e\n```\n\nFor example, to run tests:\n```bash\nmake test\n```\n\nIf the command isn't there, use:\n```bash\nmake run-command command=\"\u003ccommand\u003e\"\n```\n\nFor example, to run tests:\n```bash\nmake run-command command=\"python manage.py test\"\n```\n\nAlternatively, without `make`:\n```bash\ndocker compose run \u003ccontainer-name\u003e \u003ccommand\u003e\n```\n\nFor example, to run tests:\n```bash\ndocker compose run web python manage.py test\n```\n\n---\n\n### VSCode Setup for Auto-Imports\n\n1. **Install dependencies outside of Docker:**\n   ```bash\n   make install\n   ```\n\n2. **Activate the virtual environment:**\n   ```bash\n   pipenv shell\n   ```\n\n3. **Configure VSCode:**\n   - In the bottom-right corner, click the Python version.\n   - Select the Python interpreter created from your virtual environment.\n\nNow you can continue working inside Docker with the benefits of local environment features.\n\n---\n\n### Project Tree\n\n```\nupnyx_task_solution\n├─ .dockerignore\n├─ .git\n├─ .gitignore\n├─ authentication\n│  ├─ admin.py\n│  ├─ apps.py\n│  ├─ migrations\n│  │  ├─ 0001_initial.py\n│  │  └─ __init__.py\n│  ├─ models.py\n│  ├─ serializers.py\n│  ├─ tests.py\n│  ├─ urls.py\n│  ├─ views.py\n│  └─ __init__.py\n├─ chat\n│  ├─ admin.py\n│  ├─ apps.py\n│  ├─ migrations\n│  │  ├─ 0001_initial.py\n│  │  └─ __init__.py\n│  ├─ models.py\n│  ├─ serializers.py\n│  ├─ tests.py\n│  ├─ urls.py\n│  ├─ views.py\n│  └─ __init__.py\n├─ config\n│  ├─ admin.py\n│  ├─ asgi.py\n│  ├─ settings.py\n│  ├─ urls.py\n│  ├─ wsgi.py\n│  └─ __init__.py\n├─ docker-compose.yml\n├─ Dockerfile\n├─ Makefile\n├─ manage.py\n├─ Pipfile\n├─ Pipfile.lock\n└─ README.md\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstenwire%2Ftoken-deduction-chatbot-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstenwire%2Ftoken-deduction-chatbot-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstenwire%2Ftoken-deduction-chatbot-api/lists"}