Skip to content

A simple-featured blog application with role-based access control, category management, and post creation. Built with NestJS, TypeORM, Mysql, JWT for authentication, Bcrypt for password hashing, Multer for files upload and Swagger for Api's Documentation.

Notifications You must be signed in to change notification settings

Mshandev/Blog-Apis-Nestjs

Repository files navigation

Blog Apis - NestJS

This repository hosts the source code for a simple-featured Blog Application built with NestJS. It includes role-based access control, category management, and post creation features. The application uses JWT for authentication, Bcrypt for password hashing, Multer for file uploads, and Swagger for API documentation.

Demo

Features

  • User and Admin roles
  • JWT Authentication
  • Password Hashing with Bcrypt
  • CRUD Operations for Posts and Categories
  • Multer for File Uploads
  • Login/Signup
  • Swagger API Documentation
  • Role-Based Access Control
  • Admin: Can create, edit, delete posts and categories.
  • User: Can view posts and categories.
  • Authenticated APIs for secured access
  • REST APIs for interaction with the application
  • Database: MySQL with TypeORM

API Documentation

You can access the full API documentation via Swagger at the root URL of the deployed application:

Swagger UI: https://your-app-url.com/

Relationships

  • User to Post: One-to-Many relationship (One user can have multiple posts).
  • Category to Post: One-to-Many relationship (One category can contain multiple posts).

Screenshots

Post

  • Post Apis

Categories

  • Categories And Authentication Apis

Run Locally

Clone the project

    git clone https://github.com/Mshandev/Blog-Apis-Nestjs.git

Go to the project directory

    cd Blog-Apis-Nestjs

Install dependencies

    npm install

Setup Environment Vaiables

  DATABASE_HOST=YOUR_DB_HOST
  DATABASE_PORT=YOUR_DB_PORT
  DATABASE_USER=YOUR_DB_USER
  DATABASE_PASSWORD=YOUR_DB_PASSWORD
  DATABASE_NAME=DB_NAME
  JWT_SECRET=secretkey

Start the server

    npm run start:dev

Tech Stack

Deployment

The application is deployed on Render.

Contributing

Contributions are always welcome! Just raise an issue, and we will discuss it.

Feedback

If you have any feedback, please reach out to me here

About

A simple-featured blog application with role-based access control, category management, and post creation. Built with NestJS, TypeORM, Mysql, JWT for authentication, Bcrypt for password hashing, Multer for files upload and Swagger for Api's Documentation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published