This is a REST API built with Node.js and Express.js for managing FAQs with multi-language translation support. The project includes:
- MongoDB for data storage
- Redis caching for performance
- Google Translate API for automatic translations
- WYSIWYG support for answers
- Docker & Deployment support
- Unit tests with Mocha & Chai
- Create, Read FAQs
- Multi-language translation (English, Hindi, Bengali)
- Fast API responses using Redis caching
- Automatic translations using Google Translate API
- Admin Panel with WYSIWYG support
- API testing with Mocha & Chai
- Backend: Node.js, Express.js
- Database: MongoDB
- Caching: Redis
- Translation API: Google Translate API
- Testing: Mocha & Chai
- Containerization: Docker, Docker Compose
git clone https://github.com/juniorcoder02/bharatfd-backend.git
cd bharatfd-backendnpm installCreate a .env file and add the following:
PORT=8000
MONGO_URI=your_mongodb_connection_string
REDIS_HOST=localhost
REDIS_PORT=6379npm startServer will be running on http://localhost:8000
GET /api/faqs/curl http://localhost:8000/api/faqs/[
{
"question": "What is BharatFD?",
"answer": "BharatFD is a financial services platform."
}
]GET /api/faqs/?lang=hicurl http://localhost:8000/api/faqs/?lang=hi[
{
"question": "भारतFD क्या है?",
"answer": "भारतFD एक वित्तीय सेवा प्लेटफार्म है।"
}
]POST /api/faqs/{
"question": "What is Node.js?",
"answer": "Node.js is a JavaScript runtime."
}{
"question": "What is Node.js?",
"answer": "Node.js is a JavaScript runtime.",
"translations": {
"question_hi": "Node.js क्या है?",
"answer_hi": "Node.js एक JavaScript रनटाइम है।",
"question_bn": "Node.js কি?",
"answer_bn": "Node.js একটি JavaScript রানটাইম।"
}
}docker-compose up --builddocker-compose downnpm install --save-dev mocha chai supertestnpx mocha- Fork the repository.
- Clone the repo:
git clone https://github.com/juniorcoder02/bharatfd-backend.git
- Create a new branch:
git checkout -b feature-branch
- Commit changes:
git commit -m "feat: Add FAQ API" - Push and create a PR.