{"id":22612317,"url":"https://github.com/mustafa-kamel/pharmacies_api_mongodb","last_synced_at":"2026-04-14T23:31:17.351Z","repository":{"id":218949607,"uuid":"747433968","full_name":"mustafa-kamel/pharmacies_api_mongodb","owner":"mustafa-kamel","description":"Simple Django application integrating MongoDB as the main database and implements CRUD operations on a Pharmacies collection.","archived":false,"fork":false,"pushed_at":"2024-02-18T04:10:43.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T23:46:09.409Z","etag":null,"topics":["basic-authentication","crud-api","djago-rest-framework","django","djongo","drf-spectacular","mongodb","postman-collection","pytest","python","python-decouple","swagger"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mustafa-kamel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-01-23T23:11:08.000Z","updated_at":"2024-01-24T23:31:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"370bc715-f3ef-4b5c-89cc-ad9d14d811a5","html_url":"https://github.com/mustafa-kamel/pharmacies_api_mongodb","commit_stats":null,"previous_names":["mustafa-kamel/pharmacies_api_mongodb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mustafa-kamel/pharmacies_api_mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafa-kamel%2Fpharmacies_api_mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafa-kamel%2Fpharmacies_api_mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafa-kamel%2Fpharmacies_api_mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafa-kamel%2Fpharmacies_api_mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mustafa-kamel","download_url":"https://codeload.github.com/mustafa-kamel/pharmacies_api_mongodb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafa-kamel%2Fpharmacies_api_mongodb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31819715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"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":["basic-authentication","crud-api","djago-rest-framework","django","djongo","drf-spectacular","mongodb","postman-collection","pytest","python","python-decouple","swagger"],"created_at":"2024-12-08T17:12:17.210Z","updated_at":"2026-04-14T23:31:17.335Z","avatar_url":"https://github.com/mustafa-kamel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pharmacies API MongoDB\n\nThis project is a simple Django REST API that integrates MongoDB as the main database. It implements CRUD operations on a Pharmacies collection.\n\n## Features\n- MongoDB database to store pharmacy documents \n- Django REST Framework to build the RESTful API\n- djongo MongoDB adapter to connect Django and MongoDB\n- Basic authentication for API endpoints\n- API documentation using OpenAPI/Swagger\n- API testing\n\n## Setup\n### Prerequisites\n- Python \u003e= 3.8\n- Django\n- Django Rest Framework\n- MongoDB\n\n### Steps\n1. Clone the repo `git@github.com:mustafa-kamel/pharmacies_api_mongodb.git`\n2. Create a virtual environment `python -m venv venv`\n3. Activate virtual environment `source venv/bin/activate`\n4. Install dependencies: `pip install -r requirements.txt`\n5. Copy the `.env.example` file to `.env` run `cp .env.example .env`\n6. Update the variables in `.env` file according to your configurations.\n7. Apply migrations: `python manage.py migrate`\n8. Create a superuser: `python manage.py createsuperuser`\n9. Run the server: `python manage.py runserver`\n\n## Database \nThe project uses MongoDB as the backend database. Make sure MongoDB is installed locally and running on port 27017.\n\nCreate a local MongoDB database called `pharmacies` from MongoDBCompass or from shell using:\n\n```bash\nmongosh\nuse pharmacies\n```\n\n\u003e If you want to use a cloud database instead you will need to add its configuration to the project settings file.\n\n\n### Environment Variables\nMake sure to set the following environment variables in `.env`:\n- `MONGO_DB`: The mongodb name.\n- `SECRET_KEY`: Django secret key.\n- `DEBUG`: Set to `True` for development, `False` for production.\n\n\n## Creating New User\n- Use the Django admin interface or the API endpoint `/api/users/` to create a new user, Or you can do that simply from the django shell:\n```bash\npython manage.py shell\n```\n\nThen you need to create a new user using this code:\n```python\nfrom django.contrib.auth.models import User\nUser.objects.create_user(username=\"USERNAME\", password=\"USER_PASSWORD\")\n```\n\nThese user credentials will be used for basic authentication.\n\n\n## Running the API\n- Use the Django development server to run the API: `python manage.py runserver`\n- Access the API at `http://localhost:8000/pharmacies/`\n\n\n## Running Tests\n- Use pytest to run tests: `coverage run -m pytest`.\n- Generate coverage report: `coverage report` or `coverage html` for HTML report that shows a 99% test coverage.\n\n\n## API Documentation\n- API documentation is available at http://localhost:8000/api/schema/swagger-ui/ or http://localhost:8000/api/schema/redoc/ once the server is running.\n- Also check the project's Postman collection for a comprehensive API documentation, including request examples; also you can select the `pharmacies` environment and run the Postman collection to validate its functionality.\n\n[\u003cimg src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\"\u003e](https://app.getpostman.com/run-collection/1861377-d0deee14-feba-47fd-8810-b6f56cd65c84?action=collection%2Ffork\u0026source=rip_markdown\u0026collection-url=entityId%3D1861377-d0deee14-feba-47fd-8810-b6f56cd65c84%26entityType%3Dcollection%26workspaceId%3Df1fa4edc-8602-4006-bfa5-78678901d698)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustafa-kamel%2Fpharmacies_api_mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmustafa-kamel%2Fpharmacies_api_mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustafa-kamel%2Fpharmacies_api_mongodb/lists"}