- Project Initialization: Set up the project using Spring Initializer and added the PostgreSQL driver.
- Database Configuration:
- Configured
application.properties
with PostgreSQL connection details:spring.application.name=managify spring.datasource.url= spring.datasource.username= spring.datasource.password= spring.datasource.driver-class-name= spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
- Created a local "Managify" database.
- Configured
- Security Setup: Implemented a custom security configuration and added JSON Web Token (JWT) authentication.
- User Model Creation:
- Defined
User
entity with JPA, including fieldsid
,fullName
,email
,password
, andprojectSize
. - Established a one-to-many relationship with
Issues
entity.
- Defined
- Authentication Setup:
- Developed
AuthController
for signup and signin with JWT token generation. - Incorporated
UserRepository
andPasswordEncoder
for database operations and secure password handling.
- Developed
- JWT Generation & Fixes:
- Implemented JWT generation but resolved a
WeakKeyException
by switching to a 256-bit secure key.
- Implemented JWT generation but resolved a
- Database Entity Corrections:
- Added
@Table(name = "users")
toUser
entity to resolve table naming conflicts.
- Added
- Password Matching Issue Fix:
- Corrected
PasswordEncoder
usage to ensure proper credential validation during sign-in.
- Corrected
- JWT Finalization:
- Integrated JWT-based authentication successfully for both signup and signin.
- Entities:
- Users: Manages user details like name, email, and project count.
- Issues: Tracks project-related issues with fields like title, status, priority, and tags.
- Projects: Contains project data, including name, description, and category.
- Chat: Represents user-project group chats.
- Messages: Stores chat messages with timestamps.
- Comments: Tracks comments on issues.
- Relationships:
- Users relate to Issues and Comments.
- Issues connect to Projects and Comments.
- Chat links Messages, Users, and Projects.
- Schema and Workflow Documentation: Drafted database schema and visualized main entity relationships.
- Service Enhancements:
- Improved
ChatService
,ProjectService
, andUserService
interfaces and implementations to enhance functionality and performance.
- Improved
- Repository Optimization:
- Adjusted repositories for improved data retrieval and storage.
- DTO Enhancements:
- Refined
IssueDTO.java
for better data handling and issue management.
- Refined
- Controller Updates:
- Enhanced multiple controllers (
AuthController
,CommentController
,IssueController
, etc.) to improve functionality and add new endpoints.
- Enhanced multiple controllers (
- Service Interface Extensions:
- Extended interfaces like
CommentService
,EmailService
, andIssueService
to support expanded functionalities.
- Extended interfaces like
- Model Adjustments:
- Refined
Message.java
,PlanType.java
, andSubscription.java
for better compatibility and functionality.
- Refined
- Repository Layer Enhancements:
- Improved repositories (e.g.,
CommentRepository
,IssueRepository
) to support more complex queries.
- Improved repositories (e.g.,
- Request & Response Updates:
- Refined request and response objects for consistency and improved API response structure.
- Service Implementations:
- Updated various service implementations (e.g.,
CommentServiceImp
,EmailServiceImp
) to enhance business logic and performance.
- Updated various service implementations (e.g.,
- Updated JWT configuration files (
JwtConstant
,JwtProvider
, andJwtTokenValidator
) to enhance token validation and security mechanisms. - Improved error handling in
IssueController
for better exception management.
- Enhanced
PaymentController
,ProjectController
, andUserController
to improve error handling and user validation. - Minor updates to the
User
model, adding validation layers to strengthen data integrity and security.
- Updated
CommentRepository
andProjectRepository
with optimizations for query performance.
- Improved functionality and structure in
CommentServiceImp
,MessageServicesImp
, andProjectServiceImp
to streamline service logic and improve code readability.
POSTMAN: Click me!
Endpoint | Method | Description |
---|---|---|
/auth/signup |
POST | Register a new user |
/auth/signing |
POST | Log in a user |
/api/users/profile |
GET | Retrieve user profile |
/api/projects |
POST | Create a new project |
/api/projects/{id} |
GET | Get project by ID |
/api/projects/{id} |
DELETE | Delete project by ID |
/api/projects |
GET | Get all projects |
/api/projects/search?keyword={keyword} |
GET | Search projects by keyword |
/api/issues |
POST | Create a new issue |
/api/issues/{id} |
GET | Get issue by user ID |
/api/issues/project/{projectId} |
GET | Get all issues by project ID |
/api/issues/{id}/status/{status} |
PUT | Update issue status |
/api/issues/{id}/status/{status} |
DELETE | Delete issue status |
/api/issues/{id}/assignee/{userId} |
PUT | Assign an issue to a user |
/api/projects/{id}/chat |
GET | Retrieve chat by project ID |
/api/messages/chat/{projectId} |
GET | Get messages by project ID |
/api/messages/send |
POST | Send a new message |
/api/comments/{id} |
GET | Get a comment by ID |
- Cache management has been implemented in the project controller.
- The following endpoints now utilize caching:
- GET /api/projects: The endpoint for listing projects has been cached based on user ID, along with category and tag filters.
- GET /api/projects/{projectId}: The endpoint for retrieving details of a single project has been cached using the project ID.
- PATCH /api/projects/{projectId}: When updating a project, the associated cache entry is updated accordingly.
- DELETE /api/projects/{projectId}: Upon deleting a project, the corresponding project data is removed from the cache.
- GET /api/projects/search: The endpoint for searching projects by keyword now caches the results.
-
Test for Saving User Information: Created tests to ensure that user information can be saved successfully in the database and verified by retrieving the saved user by email.
-
Find By Email Test: Implemented a test to check if a user can be found by their email address and validated the retrieved user's details.
-
Find All Users Test: Added a test to confirm that all users can be retrieved from the database and ensured the list is not empty.
-
Find Owner's Projects Test: Developed a test to find all projects owned by a specific user and validated that the owner ID matches the expected user's ID.
-
Count Projects By User Test: Implemented a test to verify the number of projects associated with a user.
-
Find Project By ID Test: Created a test to ensure that a project can be found using its ID and validated that the correct project is returned.
-
Delete Project Test: Added a test to confirm that a project can be deleted from the database and that it no longer exists afterward.
-
Validate Project Owner and Name Test: Implemented a test to check that each project returned for a user has the correct owner ID and a non-null project name.
-
Comment Service:
- createComment: Verified successful creation with valid
issueId
anduserId
; handled exceptions for invalid IDs. - deleteComment: Confirmed deletion functionality, validated exception handling for non-existent comments, invalid users, and unauthorized deletions.
- findCommentByIssue: Checked that the method returns a non-empty list of comments for a given
issueId
.
- createComment: Verified successful creation with valid
-
Issue Service:
- getIssueById: Ensured retrieval of issues by ID and proper exception handling for non-existent issues.
- getIssueByProjectId: Validated that issues can be retrieved by
projectId
and checked for exceptions if the project is not found. - createIssue: Verified successful issue creation with valid data and project association.
- deleteIssue: Confirmed deletion of issues with appropriate checks for existence.
- addUserToIssue: Ensured users are added to issues and validated that proper exceptions are thrown for non-existent users and issues.
- updateStatus: Verified that issue status updates function correctly with valid IDs.
-
User Service:
- loadUserByUsername: Mocked user retrieval by email and ensured proper exception handling for non-existent users.
-
Project Service:
- getProjectById: Validated project retrieval by ID with appropriate exception handling for non-existent projects.