Incrypt is a secure, backend-driven notes management system focused on authentication security, data protection, and clean architectural design.
The application enables users to create, manage, and securely access personal notes through a stateless JWT-based authentication mechanism.
It is built following production-grade backend development practices using Spring Boot, Spring Security, and MySQL.
Incrypt demonstrates:
-
Stateless authentication using
JWT -
Role-basedauthorization (USER / ADMIN) -
Secure password storage with
BCrypt -
User-scoped data isolation
-
Layered architecture following
SOLIDprinciples -
Production-ready backend configuration
graph TD
Client -->|Signup/Login| AuthController
AuthController --> UserService
UserService --> UserRepository
UserRepository --> MySQL
AuthController -->|Generate JWT| Client
Client -->|Request + JWT| SecurityFilter
SecurityFilter -->|Validate Token| NoteController
NoteController --> NoteService
NoteService --> NoteRepository
NoteRepository --> MySQL
Client -->|Admin Request| AdminController
AdminController --> UserService
- Unique username and email enforcement
- Email validation
- BCrypt password hashing
- Default role assignment (ROLE_USER)
- Credential validation
- JWT token generation
- 48-hour token validity
- Stateless session management
- Secure token generation with secret key
- Bearer token extraction
- Request-level token validation
- Custom authentication filter integration
- ROLE_USER: Note management access
- ROLE_ADMIN: Platform management access
- Method-level authorization (
@PreAuthorize) - Endpoint-level protection
- Create notes (authenticated users only)
- Retrieve all notes for logged-in user
- Update notes (ownership enforced)
- Delete notes (ownership enforced)
- Strict user-level data isolation
- View all registered users
- Retrieve user details by ID
- Update user roles
- Admin-only endpoint protection
- BCrypt password hashing
- CSRF protection with cookie-based tokens
- Custom JWT authentication filter
- Unauthorized access handling (401)
- Access denied handling (403)
- CORS configuration
- Structured exception handling
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/public/signup |
Register new user |
| POST | /api/auth/public/login |
Authenticate user |
| GET | /api/csrf-token |
Retrieve CSRF token |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/notes |
Create note |
| GET | /api/notes |
Get user notes |
| PUT | /api/notes/{id} |
Update note |
| DELETE | /api/notes/{id} |
Delete note |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/admin/getUsers |
List all users |
| GET | /api/admin/user/{id} |
Get user details |
| PUT | /api/admin/updateRole |
Update user role |
| Layer | Technology |
|---|---|
| Language | Java 21 |
| Framework | Spring Boot 4.x |
| Security | Spring Security |
| Authentication | JWT |
| ORM | JPA / Hibernate |
| Database | MySQL |
| Build Tool | Maven |
| Validation | Jakarta Validation |
graph TD
A[Controller Layer] --> B[Security Layer]
B --> C[Service Layer]
C --> D[Repository Layer]
D --> E[Database]
com.incrypt
βββ controller
βββ service
βββ repository
βββ model
βββ security
βββ config
βββ exception
- Java 21+
- Maven 3.6+
- MySQL 8+
-
Clone the repository
git clone <git@github.com:BenGJ10/Inkrypt.git> cd Incrypt
-
Configure database credentials Update
application.propertieswith your MySQL configuration. -
Build the project
mvn clean install
-
Run the application
mvn spring-boot:run
-
Test using Postman or any API client:
- Register a user
- Login to receive JWT
- Access protected endpoints using Bearer token
-
Stateless backend design
-
Secure authentication flow
-
Clear separation of concerns
-
Ownership-based data access
-
Production-ready security configuration
-
Clean exception handling strategy
Because authentication is token-based and sessionless:
-
The application can scale horizontally behind a load balancer.
-
No sticky sessions required.
-
Easily deployable in containerized environments (Docker, Kubernetes).
Clear boundaries between:
-
Authentication logic
-
Authorization logic
-
Business logic
-
Data access
This allows:
-
Independent refactoring
-
Easier testing
-
Modular scaling
-
Relational integrity via foreign keys
-
Suitable for indexing on user_id and note_id
-
Designed for read/write optimization
-
Compatible with connection pooling
Architecture supports:
-
Deployment behind reverse proxies
-
Environment-based configuration
-
Externalized secrets
-
Migration to managed databases (RDS, Cloud SQL)
π‘οΈ Incrypt is a secure, scalable, and well-architected backend application for managing personal notes.
It demonstrates best practices in authentication, authorization, and data protection while adhering to clean code principles and production-ready configurations.