Alphaware_Blog_Application

Overview

This project is a blog application developed using Spring Boot, Maven, and Swagger. It allows users to create, view, edit, and delete blog posts along with commenting on posts. The application supports two types of users: admin and regular users. Admin users have access to all API endpoints while regular users have limited access.

Technologies Used

  • Spring Boot
  • Maven
  • Swagger
  • MySQL

Entities

  1. User: Represents users of the application.
  2. Post: Represents blog posts created by users.
  3. Comment: Represents comments made on blog posts.
  4. Category: Represents categories for organizing blog posts.

Users

There are two types of users:

  • Admin: Has full access to all API endpoints.
  • User: Regular users with limited access to API endpoints.

Database

The application uses MySQL as the database to store user information, blog posts, comments, and categories.

Swagger

Swagger is integrated into the application to provide a user-friendly interface for viewing and interacting with the API endpoints. It allows users to explore the available endpoints, their parameters, and responses.

API Endpoints

The following API endpoints are available in the application:

  1. /api/user
    • GET: Get all users
    • Sub-end point :- /register & Method POST : Create a new user
    • Sub-end point :- /login & Method POST : login a user by jwt tocken
    • PUT: Update an existing user
    • DELETE: Delete a user
  2. /api/posts
    • GET: Get all blog posts
    • POST: Create a new blog post
    • PUT: Update an existing blog post
    • DELETE: Delete a blog post
  3. /api/comments
    • GET: Get all comments
    • POST: Add a new comment to a blog post
    • PUT: Update an existing comment
    • DELETE: Delete a comment
  4. /api/categories
    • GET: Get all categories
    • POST: Create a new category
    • PUT: Update an existing category
    • DELETE: Delete a category

How to Run

OR

To run the application, follow these steps:

  1. Clone the repository.
  2. Set up the MySQL database and configure the database connection in the application properties.
  3. Build the project using Maven.
  4. Run the application using the generated JAR file.
  5. Access the Swagger UI to interact with the API endpoints.

Swagger Image1 Swagger Image1