22
33Jazzy is a lightweight web framework for Java. It provides a minimal and easy-to-understand API for developing fast web applications with a structure inspired by Laravel and Spring Boot.
44
5- ## 🚀 Latest Updates (v0.4 .0)
5+ ## 🚀 Latest Updates (v0.5 .0)
66
7- ** NEW: Auto-CRUD System with Zero Boilerplate !**
7+ ** NEW: Security & Authentication System !**
88
9- Jazzy Framework 0.4 introduces revolutionary auto-CRUD capabilities that generate complete REST APIs with just annotations :
9+ Jazzy Framework 0.5 introduces a comprehensive security system with JWT-based authentication :
1010
11- - 🎯 ** @Crud Annotation** : Automatically generates all CRUD endpoints (GET, POST, PUT, DELETE)
12- - 🔍 ** Smart Search ** : Built-in search functionality with configurable fields
13- - 📊 ** Pagination Support ** : Automatic pagination with customizable page sizes
14- - 🔄 ** Batch Operations ** : Support for bulk create, update, delete operations
15- - 🎨 ** Method Override ** : Custom logic with @ CrudOverride annotation
16- - 📝 ** Standardized Responses ** : Consistent API response format with ApiResponse
17- - ⚡ ** Zero Configuration ** : Complete REST API with 3 lines of code
18- - 🔧 ** Highly Configurable ** : Fine-tune behavior with comprehensive options
11+ - 🔐 ** @EnableJazzyAuth Annotation** : One-line authentication setup for your applications
12+ - 🎟️ ** JWT Token System ** : Secure token generation and validation with configurable expiration
13+ - 🛡️ ** SecurityConfig ** : URL-based security rules with wildcard pattern support
14+ - 👤 ** Built-in Auth Endpoints ** : Automatic /register, /login, /me endpoints
15+ - 🔒 ** Role-based Access Control ** : ADMIN role support with extensible architecture
16+ - 🚦 ** SecurityInterceptor ** : Automatic request validation and protection
17+ - ⚡ ** Zero Boilerplate ** : Complete authentication system with just annotations
18+ - 🔄 ** Seamless Integration ** : Works perfectly with existing DI and CRUD systems
1919
2020## Version History
2121
2222| Version | Release Date | Key Features |
2323| ---------| -------------| --------------|
24+ | ** 0.5.0** | 2025 | 🆕 ** Security & Authentication** - JWT authentication, @EnableJazzyAuth annotation, role-based access control, SecurityConfig |
2425| ** 0.4.0** | 2025 | 🆕 ** Auto-CRUD System** - @Crud annotation, zero-boilerplate REST APIs, automatic endpoint generation, search & pagination |
2526| ** 0.3.0** | 2025 | 🆕 ** Database Integration** - Hibernate/JPA, Spring Data JPA-like repositories, automatic query generation, transaction management |
2627| ** 0.2.0** | 2025 | 🆕 ** Dependency Injection System** , Spring-like annotations, automatic component discovery, lifecycle management |
@@ -30,7 +31,7 @@ Jazzy Framework 0.4 introduces revolutionary auto-CRUD capabilities that generat
3031
3132| Planned Version | Features |
3233| ----------------| ----------|
33- | ** 0.5 .0** | 🔐 ** Security & Authentication ** - JWT support, role-based access control, security filters |
34+ | ** 0.6 .0** | 🌐 ** WebSocket Support ** - Real-time communication, WebSocket controllers, broadcasting |
3435
3536## Features
3637
@@ -72,8 +73,117 @@ Jazzy Framework 0.4 introduces revolutionary auto-CRUD capabilities that generat
7273- ** Validation Integration** : Built-in input validation for create/update operations
7374- ** Audit Logging** : Optional audit trail for all CRUD operations
7475
76+ ### Security & Authentication (v0.5+)
77+ - ** @EnableJazzyAuth Annotation** : One-annotation authentication setup with automatic endpoint registration
78+ - ** JWT Token System** : Secure token generation, validation, and configurable expiration times
79+ - ** SecurityConfig** : Declarative URL-based security rules with wildcard pattern support (* , ** )
80+ - ** Built-in Auth Endpoints** : Automatic /register, /login, /me endpoints with standardized responses
81+ - ** Role-based Access Control** : ADMIN role support with extensible role system
82+ - ** SecurityInterceptor** : Automatic request interception and security validation
83+ - ** Password Security** : Built-in BCrypt password hashing and validation
84+ - ** Seamless Integration** : Works with DI container, repositories, and existing framework components
85+ - ** Flexible Configuration** : Support for custom JWT secrets, expiration times, and base paths
86+
7587## Quick Start
7688
89+ ### Secure Application with Authentication (v0.5 style) - Latest & Recommended
90+
91+ ``` java
92+ // 1. User Entity
93+ @Entity
94+ @Table (name = " users" )
95+ public class User {
96+ @Id
97+ @GeneratedValue (strategy = GenerationType . IDENTITY )
98+ private Long id;
99+
100+ @Column (unique = true )
101+ private String email;
102+
103+ private String username;
104+ private String password;
105+ private String role = " USER" ; // USER or ADMIN
106+
107+ // getters and setters...
108+ }
109+
110+ // 2. User Repository
111+ @Component
112+ public interface UserRepository extends BaseRepository<User , Long > {
113+ Optional<User > findByEmail (String email );
114+ Optional<User > findByUsername (String username );
115+ }
116+
117+ // 3. Security Configuration
118+ @Component
119+ public class AppSecurityConfig extends SecurityConfig {
120+ @Override
121+ public void configure () {
122+ // Public endpoints (no auth needed)
123+ publicEndpoints(" /" , " /api/auth/**" );
124+
125+ // Secure endpoints (JWT required)
126+ requireAuth(" /api/user/**" , " /api/protected" );
127+
128+ // Admin endpoints (JWT + ADMIN role required)
129+ requireRole(" ADMIN" , " /api/admin/**" );
130+ }
131+ }
132+
133+ // 4. Main Application - That's it! Full authentication system with 1 annotation!
134+ @EnableJazzyAuth (
135+ userClass = User . class,
136+ repositoryClass = UserRepository . class,
137+ loginMethod = LoginMethod . EMAIL ,
138+ jwtSecret = " your-secret-key" ,
139+ jwtExpirationHours = 24 ,
140+ authBasePath = " /api/auth"
141+ )
142+ public class AuthApp {
143+ public static void main (String [] args ) {
144+ Config config = new Config ();
145+ Router router = new Router ();
146+
147+ // Security is automatically configured!
148+ // Available endpoints:
149+ // POST /api/auth/register - User registration
150+ // POST /api/auth/login - User login
151+ // GET /api/auth/me - Current user info
152+
153+ Server server = new Server (router, config);
154+ server. start(8080 );
155+ }
156+ }
157+ ```
158+
159+ ** 🎉 Result** : You now have a complete authentication system with JWT tokens, role-based access control, and protected endpoints!
160+
161+ ### Complete Secure CRUD Application (v0.5 + v0.4)
162+
163+ ``` java
164+ // Combine authentication with auto-CRUD for the ultimate experience
165+ @EnableJazzyAuth (
166+ userClass = User . class,
167+ repositoryClass = UserRepository . class,
168+ loginMethod = LoginMethod . EMAIL
169+ )
170+ public class SecureCrudApp {
171+ public static void main (String [] args ) {
172+ Config config = new Config ();
173+ Router router = new Router ();
174+
175+ Server server = new Server (router, config);
176+ server. start(8080 );
177+
178+ // You now have:
179+ // - Complete authentication system (/api/auth/*)
180+ // - Role-based security on all endpoints
181+ // - JWT token protection
182+ // - Auto-CRUD endpoints (if using @Crud controllers)
183+ }
184+ }
185+ ```
186+
77187### Auto-CRUD Application (v0.4 style) - Recommended
78188
79189``` java
0 commit comments