The Movie Review System API is a RESTful web service designed to manage movies and reviews. Built with Spring Boot, JPA, and MySQL, it enables CRUD operations on movies and reviews. The system features JWT Authentication, Rate Limiting, Internationalization, Swagger OpenAPI documentation, and uses Lombok to minimize boilerplate code.
- Java 17
- Spring Boot 3.2.3
- Spring Data JPA
- MySQL
- Spring Security
- JJWT 0.12.6
- Swagger OpenAPI
- Lombok
- Resilience4j (Rate Limiting)
- MessageSource (Internationalization)
MovieReviewSystemAPI
│── src/main/java/in/lakshay
│ ├── config/ # Configuration files (Security, Swagger, JWT)
│ ├── controller/ # REST Controllers with rate limiting
│ ├── entity/ # JPA Entities
│ ├── repo/ # Data access layer
│ ├── service/ # Business logic layer
│ ├── util/ # Constants and utility classes
│ └── exception/ # Global exception handling
│── src/main/resources
│ ├── application.properties # Application configuration
│ └── messages.properties # i18n messages
git clone https://github.com/lakshay1341/MovieReviewSystemAPI.git
cd MovieReviewSystemAPI
Update src/main/resources/application.properties
:
spring.datasource.url=jdbc:mysql://localhost:3306/moviereviewdbupdated
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.hibernate.ddl-auto=create
spring.jpa.show-sql=true
# JWT Configuration
# Generate your own secure secret key using:
# openssl rand -base64 64
jwt.secret=<your-generated-secret>
jwt.expiration=3600000
# Rate Limiting Configuration
resilience4j.ratelimiter.instances.basic.limitForPeriod=100
resilience4j.ratelimiter.instances.basic.limitRefreshPeriod=1m
resilience4j.ratelimiter.instances.basic.timeoutDuration=1s
- Never use default or example secrets in production
- Always generate a new secure secret using
openssl rand -base64 64
- Keep your generated secret private and never commit it to version control
Default admin credentials (automatically created):
- Username:
admin
- Password:
admin123
(BCrypt encoded, strength 12)
mvn clean install
mvn spring-boot:run
Method | Endpoint | Description | Rate Limited | Roles |
---|---|---|---|---|
POST | /api/v1/auth/register |
Register new user | Yes | None |
POST | /api/v1/auth/login |
Get JWT token | Yes | None |
Method | Endpoint | Description | Rate Limited | Roles |
---|---|---|---|---|
GET | /api/v1/movies |
Get movies (paginated) | Yes | None (Public) |
POST | /api/v1/movies |
Add movie | Yes | ADMIN |
Method | Endpoint | Description | Rate Limited | Roles |
---|---|---|---|---|
POST | /api/v1/reviews/movies/{movieId} |
Add review | Yes | USER, ADMIN |
PUT | /api/v1/reviews/{reviewId} |
Update review | Yes | Owner, ADMIN |
GET | /api/v1/reviews/my-reviews |
Get user reviews | Yes | USER, ADMIN |
- JWT Authentication with configurable expiration
- BCrypt Password Encoding (strength 12)
- Role-Based Access Control
- Rate Limiting (100 requests per minute)
- Global Exception Handling
{
"success": boolean,
"message": "Internationalized message key",
"data": {
// Response payload
}
}
Access Swagger UI: http://localhost:8080/swagger-ui/index.html
OpenAPI Spec: http://localhost:8080/api-docs
Messages are externalized in messages.properties
supporting:
- User notifications
- Error messages
- Validation messages
- System messages
- Implement Redis caching
- Add comprehensive test coverage
- Add OAuth2 support
- Implement WebSocket for real-time updates
- Add metrics monitoring (Prometheus/Grafana)
Lakshay Chaudhary
📧 Email: lakshaychaudhary2003@gmail.com
💎 GitHub: lakshay1341
⭐ Star this repository if you find it helpful!