https://github.com/pulkit1822/faq-api
This project is a RESTful API for managing multilingual FAQs using Django and Django REST Framework, with caching provided by Redis. It supports rich text editing in the admin interface via CKEditor and uses Google Translate for language translations.
https://github.com/pulkit1822/faq-api
ckeditor django django-rest-framework docker docker-compose google-translate multilingual-support python redis rest-api
Last synced: 3 months ago
JSON representation
This project is a RESTful API for managing multilingual FAQs using Django and Django REST Framework, with caching provided by Redis. It supports rich text editing in the admin interface via CKEditor and uses Google Translate for language translations.
- Host: GitHub
- URL: https://github.com/pulkit1822/faq-api
- Owner: Pulkit1822
- Created: 2025-02-02T16:03:59.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-02T16:44:33.000Z (over 1 year ago)
- Last Synced: 2025-06-06T00:41:29.242Z (about 1 year ago)
- Topics: ckeditor, django, django-rest-framework, docker, docker-compose, google-translate, multilingual-support, python, redis, rest-api
- Language: Python
- Homepage: https://www.bharatfd.com
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FAQ API (bharatFD)
This project provides a RESTful API for managing Frequently Asked Questions (FAQs) with multilingual support using Django and Django REST Framework. The FAQs are stored in a database and can be retrieved in different languages using Google Translate. The project also uses Redis for caching.
## Installation
### Prerequisites
- Docker
- Docker Compose
### Key Features:
- **Multilingual Support:** FAQs can be retrieved in different languages (English, Hindi, Bengali) using Google Translate.
- **Caching:** FAQs are cached in Redis for 15 minutes to improve performance.
- **Admin Interface:** Django admin interface is available for managing FAQs with rich text support using CKEditor.
The project uses the following technologies:
- **Django:** Web framework for building the FAQ API.
- **Django REST Framework:** Toolkit for building Web APIs.
- **Docker:** Containerization platform to package the application.
- **Docker Compose:** Tool for defining and running multi-container Docker applications.
- **Redis:** In-memory data structure store used for caching FAQs.
- **Google Translate:** Service for translating FAQs into different languages.
- **CKEditor:** Rich text editor for the Django admin interface.
- **Python:** Programming language used for the application logic.
### Steps
1. Clone the repository:
```sh
git clone https://github.com/yourusername/faq-api.git
cd faq-api
```
2. Build and start the Docker containers:
```sh
docker-compose up --build
```
3. Apply database migrations:
```sh
docker-compose exec web python manage.py migrate
```
4. Create a superuser to access the Django admin:
```sh
docker-compose exec web python manage.py createsuperuser
```
5. Access the application at `http://localhost:8000`.
## API Usage
### List FAQs
- **URL:** `/api/faqs/`
- **Method:** GET
- **Query Parameters:**(optional): The language code for translation (default is `en`).
#### Example Request
```sh
curl -X GET "http://localhost:8000/api/faqs/"
```
#### Example Response
```json
[
{
"question": "What is your name?",
"answer": "My name is John Doe."
}
]
```
### List FAQs in Hindi
- **URL:** `/api/faqs/?lang=hi`
- **Method:** GET
#### Example Request
```sh
curl -X GET "http://localhost:8000/api/faqs/?lang=hi"
```
#### Example Response
```json
[
{
"question": "आपका नाम क्या है?",
"answer": "मेरा नाम जॉन डो है।"
}
]
```
### List FAQs in Bengali
- **URL:** `/api/faqs/?lang=bn`
- **Method:** GET
#### Example Request
```sh
curl -X GET "http://localhost:8000/api/faqs/?lang=bn"
```
#### Example Response
```json
[
{
"question": "তোমার নাম কি?",
"answer": "আমার নাম জন ডো।"
}
]
```
## Additional Notes
- The FAQs are cached in Redis for 15 minutes to improve performance.
- The project uses Google Translate for translating FAQs into different languages.
- The admin interface is available at `http://localhost:8000/admin/` for managing FAQs.