Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
iammahesh123 authored Feb 4, 2024
1 parent 0c7812f commit 990f054
Showing 1 changed file with 193 additions and 7 deletions.
200 changes: 193 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,206 @@ This project implements a Task Management system using microservices architectur
- `service-4`: Server configuration
- `api-gateway`: API Gateway

## User Service
### UserService

The `UserService` microservice is responsible for managing user-related operations within the Task Management system. It focuses on user registration, authentication, and profile management.

#### Features:

- **User Registration:**
- Endpoint: `POST /api/users/register`
- Allows new users to register by providing necessary details.
- Utilizes web security to ensure secure registration.

- **User Authentication:**
- Endpoint: `POST /api/users/login`
- Implements web security and JWT token authentication for secure user login.
- Generates a JWT token upon successful authentication.

- **Get User Details:**
- Endpoint: `GET /api/users/{userId}`
- Retrieves user details based on the provided user ID.

#### Security:

The `UserService` employs web security to safeguard user registration and login processes. JWT token authentication is implemented to ensure secure communication and user authentication. This ensures that only authorized users can access the system's functionalities.

#### Usage:

- This microservice is an essential component for user management in the overall Task Management system.
- It provides the necessary endpoints for user registration, authentication, and fetching user details.

### TaskService

The `TaskService` microservice is dedicated to managing tasks within the Task Management system. It facilitates the creation of tasks, assignment to users, and retrieval of task details.

#### Features:

- **Create a New Task (Admin Only):**
- Endpoint: `POST /api/tasks/create`
- Allows administrators to create new tasks by providing task details.
- Only users with admin privileges can access this endpoint.

- **Get Task Details:**
- Endpoint: `GET /api/tasks/{taskId}`
- Retrieves detailed information about a specific task based on the provided task ID.

- **Assign Task to User (Admin Only):**
- Endpoint: `PUT /api/tasks/{taskId}/assign/{userId}`
- Permits administrators to assign a task to a specific user.
- Requires admin privileges for access.

#### Security:

- Task creation and assignment operations are restricted to users with admin privileges.
- This ensures that only authorized administrators can create tasks and assign them to users.

#### Usage:

- The `TaskService` plays a vital role in task management within the overall Task Management system.
- It offers endpoints for creating tasks, assigning tasks to users, and fetching detailed task information.
- Admin privileges are required for task creation and assignment, emphasizing role-based access control.

### TaskSubmissionService

The `TaskSubmissionService` microservice is dedicated to handling the submission of completed tasks within the Task Management system. It provides functionality for users to submit their completed tasks and retrieve details about task submissions.

#### Features:

- **Submit Completed Task:**
- Endpoint: `POST /api/submissions/submit`
- Allows users to submit completed tasks, providing necessary details about the submission.

- **Get Submission Details:**
- Endpoint: `GET /api/submissions/{submissionId}`
- Retrieves detailed information about a specific task submission based on the provided submission ID.

#### Security:

- Submission of completed tasks is open to all authenticated users.
- Authentication ensures that only authorized users can submit their completed tasks.

#### Usage:

- The `TaskSubmissionService` facilitates the submission of completed tasks, enhancing the user experience within the Task Management system.
- Users can utilize the provided endpoints to submit their completed tasks and retrieve details about their submissions.

### Eureka Server Configuration

The `Eureka Server` is a crucial component that enables service discovery within the Task Management system. It efficiently manages the UserService, TaskService, and TaskSubmissionService, allowing seamless communication between microservices.

#### Service Discovery:

- **Purpose:**
- Eureka Server facilitates service discovery, allowing microservices to register and discover each other dynamically.

- **Usage:**
- Each microservice (UserService, TaskService, TaskSubmissionService) registers itself with the Eureka Server during startup.
- Other microservices can discover and communicate with registered services using Eureka's service registry.

### OpenFeign for Microservice Communication

The `OpenFeign` library is employed to simplify communication between microservices in the Task Management system. It offers a declarative way to define web service clients.

#### Communication Features:

- **Declarative REST Clients:**
- OpenFeign allows the definition of declarative REST clients using annotations, reducing boilerplate code.

- **Microservice Communication:**
- Microservices, such as the API Gateway, can utilize OpenFeign to communicate with other services seamlessly.

#### Usage:

- Microservices can define Feign clients, specifying the target service and its API endpoints using annotated interfaces.
- This simplifies the communication process, enhancing the maintainability of the system.

### API Gateway

The `API Gateway` serves as the single entry point for the Task Management system, directing and managing requests to the corresponding microservices. This component is implemented using Spring Cloud Gateway for efficient routing.

#### Purpose:

- **Routing Requests:**
- Routes incoming requests to the appropriate microservices based on predefined patterns.

- **Centralized Entry Point:**
- Provides a centralized entry point for client applications to interact with the system.

#### Configuration:

- **Route Configuration:**
- Utilizes Spring Cloud Gateway to define routes for UserService, TaskService, and TaskSubmissionService.
- Enables seamless communication between microservices.

#### Security:

- **Endpoint Protection:**
- Implements security measures to protect API endpoints.
- Enforces authentication and authorization as configured in the microservices.

#### Usage:

- **Single Port Access:**
- The API Gateway is configured to run on a single port (e.g., 8080).
- Microservices communicate through the gateway using defined routes.

- **Simplified Communication:**
- Enhances the simplicity of communication between client applications and microservices.
- Utilizes Spring Cloud Gateway's flexibility for routing and load balancing.



## Getting Started

### Prerequisites
Welcome to the Task Management microservices project! Follow these steps to set up and run the project on your local machine.

- [Java](https://www.oracle.com/java/technologies/javase-downloads.html)
### Step 1: Clone the Project

### Running the Project Locally
1. Open a terminal on your computer.

2. Clone the project repository by running the following command:
```bash
git clone <repository-url>
cd task-management-microservices

### Step 2: Run Eureka Server

1. Navigate to the Eureka directory:.

2. Start the Eureka Server using the following command::
```bash
cd eureka
./gradlew bootRun
3.Open your web browser and visit http://localhost:8761 to access the Eureka Server dashboard.
1. Clone the repository:
### Step 3: Run Microservices
For each microservice (UserService, TaskService, TaskSubmissionService), navigate to its directory and run it. Here's an example for UserService:
1. Navigate to the Eureka directory:.
2. Start the Eureka Server using the following command::
```bash
git clone https://github.com/iammahesh123/Task-Management-System.git
cd Task-Management-System
cd UserService
./gradlew bootRun
3.Repeat the process for TaskService and TaskSubmissionService.
### Step 4: Run API Gateway
For each microservice (UserService, TaskService, TaskSubmissionService), navigate to its directory and run it. Here's an example for UserService:
1. Navigate to the API Gateway directory:
2. Start the API Gateway using the following command:
```bash
cd api-gateway
./gradlew bootRun
3.Repeat the process for TaskService and TaskSubmissionService.

### Step 5: Verify Local Setup
Open your web browser and visit http://localhost:8080 to access the API Gateway.
You've successfully set up the Task Management microservices project on your local machine! Feel free to explore and test the functionalities.
Feel free to copy and paste this version into your README file. Let me know if there's anything else I can help you with!




0 comments on commit 990f054

Please sign in to comment.