/Todo-List-Microservices

This project follows a microservices, client-server architectures, consisting of separate services for authentication and managing to-do items, each exposing RESTful APIs

Primary LanguageJava

Todo-List-Microservices

This project follows a microservices, client-server architectures, consisting of separate services for authentication and managing to-do items, each exposing RESTful APIs.

Demo

Demo

Application Architecture

  • discovery-service - Eureka server
  • api-gateway - API gateway that proxies all the micro-services
  • authentication-service - user authentication microservice
  • task-service - task management microservice
  • web-portal - client Application that provides the UI

Getting Started

  • Clone the repository: git clone https://github.com/amira921/Todo-List-Microservices
  • Navigate to the project directory: cd ./Todo-List-Microservices
  • Start Apache, MySQL, from Xampp Install dependencies: mvn install
  • Update application.properties files
  • Run discovery-service project
  • Run api-gateway project
  • Run authentication-service project
  • Run task-service project
  • Run web-portal project

Microservices Overview

1. Authentication Service

Features

1. Registration Process

  • User provides email, password, and username.
  • Verification email is sent to the provided email address.
  • User is required to navigate to the verification link included in the email to activate the account.
  • Without activating the account through the provided link, the user cannot log in.

2. Authentication Process

  • User provides email and password.
  • If the account is not found, the user cannot access the app and needs to register.
  • If the account is found but not active, the user cannot access the app and needs to check the inbox for activation instructions.
  • If the account is found, active, and the password is incorrect, the user cannot access the app and needs to try again or reset the password.
  • If the account is found, active, and the password is correct, the user can access the app.

3. Reset Password Process

  • User provides their email address.
  • If the account is not found, the user cannot access the app and is prompted to register.
  • If the account is found, a password reset email is sent to the provided email address.
  • User receives an email with link to reset their password and clicks on the link provided.
  • Token is expired after 30 minutes, if it expired, user can't reset the password and need to send another request
  • If token is valid, user is directed to a page where they can enter their email address and set a new password.
  • After submitting the new password, the user's password is updated and can now log in.

Technologies Used

  • Spring Boot Starter Web
  • Spring Boot Starter Data JPA
  • MySQL Connector/J
  • Spring Boot Starter Validation
  • Spring Boot Starter Security
  • JWT API and Jackson Integration
  • Spring Boot Starter Mail
  • Project Lombok (with Lombok MapStruct Binding)
  • MapStruct (with MapStruct Processor)
  • Spring Boot Starter Test
  • Mockito Core
  • Spring Cloud Netflix Eureka Client
  • Springdoc OpenAPI Starter WebMVC UI

Swagger end-points

2. Task Service

Features

To access all features, user should authenticate first

  • Get all tasks by user's email
  • Retrieves personal tasks
  • Retrieves work-related tasks
  • Retrieves tasks that are scheduled for today
  • Retrieves tasks scheduled for the upcoming week
  • Retrieves tasks that are currently in progress
  • Retrieves tasks that have been completed
  • Retrieves tasks that are overdue
  • Add tasks
  • Update tasks
  • Delete tasks

Technologies Used

  • Spring Cloud Netflix Eureka Client
  • Spring Boot Starter Web
  • Spring Boot Starter Data JPA
  • MySQL Connector
  • Springdoc OpenAPI Starter WebMVC UI
  • Spring Boot Starter Validation
  • Project Lombok (with Lombok MapStruct Binding)
  • MapStruct (with MapStruct Processor)
  • Spring Boot Starter Test

Swagger end-points

3. Web Portal

Features

  • Authentication: Secure login system to access the portal
  • Task Microservices: Utilizes task microservices through an API Gateway for seamless integration and functionality

Technologies Used

  • Spring Boot Starter Web
  • Spring Boot Starter Thymeleaf
  • Springdoc OpenAPI Starter WebMvc UI
  • Project Lombok
  • Spring Cloud Starter Netflix Eureka Client
  • OAuth2 Client

Swagger end-points

4. Discovery Service

Technologies Used

  • Spring Cloud Netflix Eureka Server
  • Spring Cloud Config

5. API Gateway

Technologies Used

  • Spring Boot Starter Webflux
  • Spring Cloud Starter Gateway
  • Spring Cloud Starter Netflix Eureka Client
  • Project Lombok
  • JWT API
  • JSON Web Token

Postman Testing

The application handles various types of validation and exceptions. Below are a few test cases:

Registration Process

1. invalid data

2. valid data

3. user exists

4. verification email to activate account

5. account activation

Reset Password Process

1. user is not found

2. user is found

3. verify email - token is expired

4. verify email- token is valid

5. send new password

Authentication Process

2. account is not found

3. password is incorrect

4. valid login

Filter Tasks Feature

2. get all tasks

3. filter tasks: completed tasks

Tasks: CRUD Operations

2. update task - user is authorized

3. update task - user is unauthorized

4. update task - user is authorized - data is invalid

5. delete task - user authorized

Future Work

  • Enhance interactivity: Display feedback messages for user actions.
  • Implement OAuth2 authentication with Google API.
  • Strengthen security with additional layers.
  • Introduce a notification system to alert users before tasks expire.