{"id":25723355,"url":"https://github.com/rohit-j0shi/faqs-backend-test","last_synced_at":"2025-08-14T18:40:31.852Z","repository":{"id":275390545,"uuid":"925931654","full_name":"ROHIT-J0SHI/Faqs-backend-test","owner":"ROHIT-J0SHI","description":"This is an assessment test project for the backend role. It is a multilingual FAQ API built using Django and Django REST Framework. The API allows users to retrieve FAQs in multiple languages using the Google Translate API. FAQs can be managed through the Django Admin Panel, and API endpoints are tested using pytest.","archived":false,"fork":false,"pushed_at":"2025-02-02T06:42:32.000Z","size":21088,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T20:39:37.954Z","etag":null,"topics":["api","backend","django","googletrans","pytest","python","sqlite"],"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/ROHIT-J0SHI.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":"2025-02-02T05:10:31.000Z","updated_at":"2025-02-06T08:10:32.000Z","dependencies_parsed_at":"2025-02-02T07:32:14.899Z","dependency_job_id":null,"html_url":"https://github.com/ROHIT-J0SHI/Faqs-backend-test","commit_stats":null,"previous_names":["rohit-j0shi/faqs-backend-test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ROHIT-J0SHI/Faqs-backend-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROHIT-J0SHI%2FFaqs-backend-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROHIT-J0SHI%2FFaqs-backend-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROHIT-J0SHI%2FFaqs-backend-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROHIT-J0SHI%2FFaqs-backend-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ROHIT-J0SHI","download_url":"https://codeload.github.com/ROHIT-J0SHI/Faqs-backend-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROHIT-J0SHI%2FFaqs-backend-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270466466,"owners_count":24588791,"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","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"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":["api","backend","django","googletrans","pytest","python","sqlite"],"created_at":"2025-02-25T20:33:00.674Z","updated_at":"2025-08-14T18:40:31.796Z","avatar_url":"https://github.com/ROHIT-J0SHI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FAQ Backend API\n\n## Table of Content\n\n* Overview\n* Features\n* Technologies Used\n* Installation\n* API Usage\n* Admin Panel\n* Testing API Endpoints using Postman\n* Running Tests\n\n## Overview\n\nThe **FAQ Backend API** is a robust, multilingual API built using **Django** that allows users to manage Frequently Asked Questions (FAQs). This API supports features like retrieving FAQ entries in different languages, a Django-powered admin panel to manage FAQs easily, and a flexible backend that can be extended for various use cases. It is built to handle a variety of FAQ-related operations, such as fetching, adding, and translating FAQs into multiple languages.\n\n## ✅Features\n\n- **FAQ Management**: Supports CRUD (Create, Read, Update, Delete) operations on FAQ entries.\n- **Multilingual Support**: FAQs can be retrieved in multiple languages (default is English).\n- **Django Admin Panel**: A user-friendly web interface to manage FAQ data easily.\n- **Database**: Uses **SQLite** by default, with the flexibility to use other databases like PostgreSQL or MySQL.\n- **API Endpoints**: Exposes multiple endpoints to manage FAQ data, including the ability to fetch FAQs in various languages.\n\n## 📍Technologies Used\n\n- **Django**: Web framework used to build the backend.\n- **Django REST Framework**: For building RESTful APIs.\n- **SQLite** (default): For local database management.\n- **Python 3.x**: Programming language used to write the backend.\n- **Pytest**: Testing framework used for write and run tests for your code.\n- **googletrans**: Library used to integrate Google Translate API for automatic language translation\n\n## Installation\n\nTo get the FAQ Backend API up and running on your local machine, follow the steps below:\n\n### 1. Clone the Repository\n\nClone this repository to your local machine:\n\n```bash\ngit clone https://github.com/ROHIT-J0SHI/Faqs-backend-test.git\ncd Faqs-backend-test\n```\n\n### 2. Create a Virtual Environment\n\nCreate a virtual environment to keep dependencies isolated:\n\n```\npython -m venv venv\n```\n\n### 3. Activate the Virtual Environment\n\n* On  **Windows** :\n\n  ```\n  venv\\Scripts\\activate\n\n  ```\n* On  **macOS/Linux** :\n\n  ```\n  source venv/bin/activate\n  ```\n\n### 4. Install Dependencies\n\nInstall the necessary dependencies from the `requirements.txt` file:\n\n```\npip install -r requirements.txt\n```\n\n### 5. Run Migrations\n\nSet up the database by applying the migrations:\n\n```\npython manage.py migrate\n```\n\n### 6. Start the Development Server\n\nRun the Django development server:\n\n```\npython manage.py runserver\n\n```\n\nOnce the server is up and running, the API will be available at `http://127.0.0.1:8000/`.\n\n## API Usage\n\nThe following endpoints are available for interacting with the FAQ data:\n\n### 1. Get All FAQs\n\n* **Endpoint** : `/api/faqs/`\n* **Method** : `GET`\n* **Response** :\n  ```\n  {\n    \"status\": \"success\",\n    \"total_faqs\": 3,\n    \"faqs\": [\n      {\n        \"id\": 1,\n        \"question\": \"What is Django?\",\n        \"answer\": \"Django is a Python web framework.\"\n      },\n      {\n        \"id\": 2,\n        \"question\": \"How do I install Django?\",\n        \"answer\": \"You can install Django using pip: `pip install django`.\"\n      },\n      {\n        \"id\": 3,\n        \"question\": \"Is Django good for beginners?\",\n        \"answer\": \"Yes, Django is beginner-friendly and well-documented.\"\n      }\n    ]\n  }\n\n  ```\n\n### 2. Get FAQs in a Specific Language\n\n* **Endpoint** : `/api/faqs/?lang=\u003clanguage_code\u003e`\n* **Method** : `GET`\n* **Parameters** :\n* `lang`: The language code for the translation (e.g., `hi` for Hindi, `es` for Spanish).\n\n#### Example Request:\n\n```\nGET /api/faqs/?lang=hi\n```\n\n#### Example Response (in Hindi):\n\n```\n{\n  \"status\": \"success\",\n  \"total_faqs\": 3,\n  \"faqs\": [\n    {\n      \"id\": 1,\n      \"question\": \"Django क्या है?\",\n      \"answer\": \"Django एक Python वेब फ्रेमवर्क है।\"\n    },\n    {\n      \"id\": 2,\n      \"question\": \"मैं Django कैसे इंस्टॉल करूं?\",\n      \"answer\": \"आप Django को pip के माध्यम से इंस्टॉल कर सकते हैं: `pip install django`।\"\n    },\n    {\n      \"id\": 3,\n      \"question\": \"क्या Django शुरुआत करने वालों के लिए अच्छा है?\",\n      \"answer\": \"हां, Django शुरुआत करने वालों के लिए आसान है और इसका दस्तावेज़ अच्छी तरह से उपलब्ध है।\"\n    }\n  ]\n}\n\n```\n\n## Admin Panel\n\nDjango comes with a built-in admin panel for managing the FAQ entries. To access the admin panel:\n\n1. **Create a Superuser** : Run the following command to create a superuser:\n\n   ```\n   python manage.py createsuperuser\n   ```\n\n   Follow the prompts to create a superuser with a username, email, and password.\n2. **Access the Admin Panel** : Once the superuser is created, start the Django server:\n\n   ```\n   python manage.py runserver\n   ```\n\n   Then, navigate to `http://127.0.0.1:8000/admin/` in your browser.\n3. **Log in** : Use the superuser credentials you just created to log in to the admin panel.\n4. **Manage FAQs** : In the admin panel, you will see a section for  **FAQs** . You can add, edit, and delete FAQ entries from here.\n\n## Testing API Endpoints Using Postman\n\nTo test the API endpoints, you can use Postman to make GET requests to the endpoints. Here's how to test the API:\n\n### 1. Test `GET /api/faqs/`\n\n1. Open  **Postman** .\n2. Set the request type to  **GET** .\n3. Enter the URL: `http://127.0.0.1:8000/api/faqs/`.\n4. Click  **Send** .\n\nYou should receive a response similar to:\n\n```\n{\n  \"status\": \"success\",\n  \"total_faqs\": 3,\n  \"faqs\": [\n    {\n      \"id\": 1,\n      \"question\": \"What is Django?\",\n      \"answer\": \"Django is a Python web framework.\"\n    },\n    {\n      \"id\": 2,\n      \"question\": \"How do I install Django?\",\n      \"answer\": \"You can install Django using pip: `pip install django`.\"\n    },\n    {\n      \"id\": 3,\n      \"question\": \"Is Django good for beginners?\",\n      \"answer\": \"Yes, Django is beginner-friendly and well-documented.\"\n    }\n  ]\n}\n\n```\n\n### 2. Test `GET /api/faqs/?lang=\u003clanguage_code\u003e`\n\n1. Open  **Postman** .\n2. Set the request type to  **GET** .\n3. Enter the URL: `http://127.0.0.1:8000/api/faqs/?lang=hi` (or any other language code).\n4. Click  **Send** .\n\nYou should receive a response with FAQs in the specified language, like Hindi in this example.\n\n## Running Tests\n\nTo run tests for the API, use the following command:\n\n```\npython manage.py test\n\n```\n\nThis will run all the test cases defined in the `tests.py` file and ensure the API endpoints are functioning correctly.\n\n## Thank You!\n\nThank you for exploring the **FAQ Backend API** project! We hope this API  efficiently manage and serve FAQ data in multiple languages. If you have any questions or encounter any issues, don't hesitate to reach out!\n\nHappy coding! 😊\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohit-j0shi%2Ffaqs-backend-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohit-j0shi%2Ffaqs-backend-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohit-j0shi%2Ffaqs-backend-test/lists"}