This is the backend API for DevBlogs, a Full Stack Blogging site for Developers by Developers. It's part of the MLSA HACKTOBER 2024: WEBDEV project.
npm install
or
yarn install
.env
file in the backend directory.MONGODB_URI
and JWT_SECRET
.npm run dev
or
yarn dev
Clone the repository:
git clone https://github.com/MLSAKIIT/devblogs-backend.git
Navigate to the project directory:
cd devblogs-backend
Configure your .env file:
Before running Docker, ensure you have correctly set up your environment variables.
Run the following command to start the application:
docker compose up -d
.
└── src/
├── controllers/
│ ├── auth.js
│ └── blog.js
├── index.js
├── middlewares/
│ ├── errorHandler.js
│ └── verifyTokenMiddleware.js
├── models/
│ ├── Blogs.js
│ └── User.js
├── routes/
│ ├── auth.js
│ ├── blog.js
│ └── verify.js
├── utils/
│ ├── jwtHelper.js
│ └── rateLimit.js
└── validators/
├── login.js
└── register.js
/register
: User registration/login
: User login/verify
: Verify JWT token/change-password
: Change user password/get-blogs
: Retrieve blog posts (with pagination)/create-blog
: Create a new blog post (protected route)/get-featured-blog
: Retrieve featured blog postsFor detailed API documentation, refer to the Swagger UI at /api-docs
when the server is running.
We welcome contributions to improve this project! Here's how you can contribute:
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)joi
.Check the main project documentation for a list of current issues and tasks for the backend.