- Overview
- Features
- Technologies Used
- Learning Objectives
- Getting Started
- Contributors
- Acknowledgments
The backend of the Book Social Network is built with Spring Boot 3 and provides RESTful APIs for managing user accounts, book collections, and community interactions. It handles user registration, secure email validation, book management, and book borrowing/return functionality with an approval system for returns. The application ensures security using JWT tokens and adheres to best practices in REST API design.
- User Registration: Create a new user account.
- Email Validation: Secure account activation via email.
- User Authentication: Secure login using JWT tokens.
- Book Management: Create, update, share, and archive books.
- Book Borrowing: Verify availability and borrow books.
- Book Returning: Return borrowed books.
- Book Return Approval: Approve book returns.
- Spring Boot 3
- Spring Security 6
- JWT Token Authentication
- Spring Data JPA
- JSR-303 and Spring Validation
- OpenAPI and Swagger UI Documentation
- Docker
- GitHub Actions
- Keycloak
By working on this backend project, you will learn:
- Designing class diagrams from business requirements.
- Implementing JWT-based authentication with Spring Security.
- User registration and account validation via email.
- Utilizing inheritance with Spring Data JPA.
- Implementing service layers and handling application exceptions.
- Object validation using JSR-303 and Spring Validation.
- Handling custom exceptions in a Spring Boot application.
- Implementing pagination and adhering to REST API best practices.
- Configuring Spring Profiles for different environments.
- Documenting APIs with OpenAPI and Swagger UI.
- Dockerizing the backend service.
- Setting up a CI/CD pipeline with GitHub Actions.
- JDK 17 or higher
- Maven 3.6+
- Docker (optional for containerization)
- PostgreSQL (or your preferred database)
- Keycloak (for authentication)
-
Clone the repository:
git clone https://github.com/CodexParas/book-social-network-api.git cd book-social-network-api -
Set up the database:
Configure your PostgreSQL database and update the
application.propertiesorapplication.ymlfile with your database credentials. -
Run the application:
mvn spring-boot:run
-
Access the API documentation:
Once the application is running, you can access the API documentation at
http://localhost:8080/api/v1/swagger-ui/index.html.
To run the application in a Docker container:
-
Build the Docker image:
docker build -t book-social-network-api . -
Run the Docker container:
docker run -p 8080:8080 book-social-network-api
Special thanks to the developers and maintainers of the technologies used in this project.