A robust Node.js backend for the Multilingual FAQ Management System. This service provides RESTful APIs for managing FAQs with support for multiple languages using Google Translate.
backend/
├── config/ # Configuration files
├── controllers/ # Request handlers
├── models/ # Database models
├── routes/ # API routes
├── services/ # Business logic
├── tests/ # Test files
├── .env # Environment variables
├── .env.example # Example environment variables
├── .eslintrc # ESLint configuration
├── index.ts # Application entry point
├── server.ts # Application entry point
└── package.json # Project metadata and dependencies
- RESTful API endpoints for FAQ management (CRUD operations)
- MongoDB integration for data persistence
- Redis caching for improved performance
- Multilingual support using Google Translate API
- CORS enabled for frontend integration
- Comprehensive test suite using Mocha and Chai
- ESLint for code quality
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB
- Caching: Redis
- Testing: Mocha, Chai
- Translation: Google Translate API
- Other Tools: ESLint, Nodemon
- Node.js (v18 or higher)
- MongoDB
- Redis Server
- npm
-
Clone the repository:
git clone https://github.com/tivarii/BackendAssignment cd backend -
Install dependencies:
npm install
npm run devnpm startnpm testnpm run lint # Check for linting issues
npm run lint:fix # Fix linting issues-
GET
/api/faqs -
Returns a list of all FAQs
-
GET
/api/faqs?lang=hi -
Returns a list of all FAQs in hindi
- POST
/api/faqs - Creates a new FAQ
- Body:
{ "question": "What is Nodejs?", "answer": "Nodejs is a javascript runtime environment" }