https://github.com/chandrakanthrck/blogapplication
A simple Spring Boot blog application demonstrating basic CRUD operations, user authentication, and category management using RESTful APIs, Spring Data JPA, and MySQL.
https://github.com/chandrakanthrck/blogapplication
crud mysql rest-api spring-boot
Last synced: 3 months ago
JSON representation
A simple Spring Boot blog application demonstrating basic CRUD operations, user authentication, and category management using RESTful APIs, Spring Data JPA, and MySQL.
- Host: GitHub
- URL: https://github.com/chandrakanthrck/blogapplication
- Owner: chandrakanthrck
- Created: 2024-08-26T22:21:49.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-06T02:23:38.000Z (9 months ago)
- Last Synced: 2025-01-11T13:29:47.683Z (5 months ago)
- Topics: crud, mysql, rest-api, spring-boot
- Language: Java
- Homepage:
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blog Application
## Overview
The application allows users to create, read, update, and delete blog posts, and provides basic authentication for users.## Features
- **User Management**: Register and manage users.
- **CRUD Operations**: Create, read, update, and delete blog posts.
- **Categories**: Manage blog categories.
- **Authentication**: Basic user authentication and authorization.
- **Pagination**: View posts with pagination support.
- **Comments**: Users can comment on posts.## Technologies Used
- **Java 17**
- **Spring Boot**
- **Spring Data JPA**
- **MySQL** (or any preferred database)
- **Hibernate**
- **Thymeleaf** (for front-end)
- **Maven**## Setup and Run
### Prerequisites
- Java 17+
- Maven 3.6+
- MySQL or other database for storing user and blog data### Clone the Repository
```bash
git clone https://github.com/chandrakanthrck/BlogApplication.git
cd BlogApplication
```
Configure Database
Update the database connection details in src/main/resources/application.properties:
```properties
spring.datasource.url=jdbc:mysql://localhost:3306/blog_db
spring.datasource.username=root
spring.datasource.password=your_password
```
### Run the Application
```bash
mvn spring-boot:run
```### API Endpoints
- **POST** `/api/auth/register` - Register a new user
- **POST** `/api/auth/login` - Login and obtain JWT token
- **GET** `/api/posts` - Get all blog posts
- **GET** `/api/posts/{id}` - Get a specific post by ID
- **POST** `/api/posts` - Create a new post
- **PUT** `/api/posts/{id}` - Update an existing post
- **DELETE** `/api/posts/{id}` - Delete a post
- **GET** `/api/categories` - Get all categories### License
This project is licensed under the MIT License.