A backend service for managing the diverse content of the Bangla Web Magazine, including articles, artwork, photography, and podcasts. Built with Node.js and Express.js, this application uses REST APIs to provide a reliable and scalable solution for content management.
Follow these steps to set up the project locally:
-
Clone the repository:
git clone https://github.com/Iktisad/bangla_magazine_backend.git
-
Navigate to the project directory:
cd bangla_magazine_backend
-
Install dependencies:
npm install
-
Set up your environment variables:
LOCAL DEVELOPMENT
Create a
.env.development.local
file in the root directory of the project with the following content:# .env.development.local # Application PORT=3001 APP_HOST=http://localhost # Database ## Development DB_PORT=27017 DB_NAME=bangla_web_magazine DB_HOST=localhost # or set this as 0.0.0.0 if there is a MongooseServer Selection Error # JWT for authentication JWT_SECRET=SET_AS_YOU_LIKE JWT_EXPIRATION=4h # Nodemailer Configurations MAILER_EMAIL=example@example.com MAILER_PASSWORD=secret MAILER_SERVICE=Example MAILER_HOST=smtp.mail.example.com MAILER_PORT=465 MAILER_SECURE=false MAILER_LOGGER=true
PRODCUTION DEVELOPMENT
Create a
.env
orenv.production.local
file in the root directory of the project with the following content as above and set the links appropriately.
To start the application, run:
npm start
For development mode with hot reloading, run:
npm run start:dev
- 🔒 User Authentication: Secure login and registration system with JWT (JSON Web Tokens) to ensure user data privacy and protection.
- 🔄 RESTful API: A set of RESTful endpoints to manage resources, providing CRUD operations for entities like users, magazine, artwork and podcasts.
- 🛡️ Role-Based Access Control: Fine-grained access control with different user roles (admin, author, and contributor) to manage permissions and access to various parts of the application.
- ✔️ Data Validation: Robust data validation using
Express-Validator
to ensure that all incoming data is correctly formatted and prevents malicious inputs. - 📝 Logging: Comprehensive logging system with
Winston
to track application behavior and errors for easier debugging and monitoring. - 📖 API Documentation: Interactive API documentation created with
Rest Client
of VSCode extension, making it easy for developers to understand and use the API. ⚠️ Error Handling: Centralized error handling to manage application errors gracefully and provide meaningful feedback to users.- 🌐 Environment Configuration: Flexible configuration management for different environments (development, staging, production) using dotenv.
We welcome contributions! To get started:
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
- Make your changes.
- Commit your changes:
git commit -m 'Add new feature'
- Push to the branch:
git push origin feature-branch
- Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any inquiries, please contact iktisad.rashid@gmail.com.