https://github.com/uwancha/mp-blog-backend
Backend for a blog application with authentication functionality. Built with Node.js, Express.js, MongoDB, and JWT authentication.
https://github.com/uwancha/mp-blog-backend
bcryptjs express jwt mongodb mongoose nodejs restful-api typescript
Last synced: 3 months ago
JSON representation
Backend for a blog application with authentication functionality. Built with Node.js, Express.js, MongoDB, and JWT authentication.
- Host: GitHub
- URL: https://github.com/uwancha/mp-blog-backend
- Owner: Uwancha
- License: mit
- Created: 2024-03-24T14:13:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T18:47:47.000Z (about 2 years ago)
- Last Synced: 2025-03-14T02:22:47.090Z (over 1 year ago)
- Topics: bcryptjs, express, jwt, mongodb, mongoose, nodejs, restful-api, typescript
- Language: TypeScript
- Homepage:
- Size: 73.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Blog Backend
This is the backend for a blog application with authentication functionality. The backend is responsible for handling user authentication and managing blog posts through a RESTful API built using Node.js.
## Features
- User registration and login functionality.
- Secure password storage using hashing techniques.
- Authentication and authorization using JSON Web Tokens (JWT).
- CRUD (Create, Read, Update, Delete) operations for blog posts.
- Validation and error handling for API requests.
- Integration with a database to store user and blog post data.
## Technologies Used
- Node.js
- Express.js
- TypeScript
- MongoDB/Mongoose
- JSON Web Tokens (JWT) for authentication
- Express Validator for request validation
- bcryptjs for password hashing
## Getting Started
To get started with the backend of the blog application, follow these steps:
- Clone the repository:
```bash
git clone
```
- Install dependencies:
```bash
npm install
```
- **Alternatively:** you can download the zip file, extract it and follow the next steps.
- Set up your environment variables:
Create a .env file in the root directory and add the following variables:
```plaintext
PORT=3000
MONGODB_URI=
JWT_SECRET=
```
Since I used cloudinary for user profile images, you should set up environment variables for profile avatar updating endpoints to be functional. You can create free cloudinary account [here](https://cloudinary.com/users/register_free)
```plaintext
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
```
- 4. Run the development server:
```bash
npm run dev
```
## API Documentation
Please refer to the API documentation provided in the docs folder for details on the available endpoints, request parameters, and responses.
## Contributing
Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request.
## Contributors
[Sitota Alemu](https://github.com/Uwancha)
## License
This project is licensed under the [MIT License](LICENSE).