Skip to content
@Fawry-Intern-Round4

Fawry-Intern-Round4

Organization Microservices System

Overview

This repository contains a collection of microservices that make up the organization's system. It includes services for managing users, orders, products, stores, coupons, and notifications, along with an Angular frontend. The system leverages Kubernetes (K8s) with Minikube for local deployment and orchestration, as well as a microservices architecture to achieve modularity and scalability.

Services Included

  • API Gateway
  • User API
  • Order API
  • Product API
  • Store API
  • Coupon API
  • Notification API
  • Angular Frontend (Front-End)

Each microservice has its own Kubernetes configuration files (deployment.yml and service.yml) for deploying and managing resources.

Prerequisites

Ensure you have the following installed:

Deployment Instructions

Step 1: Start Minikube

To start a Minikube cluster, run:

minikube start

Step 2: Deploy All Services

Place all service directories in the same folder. Use the following script to automatically deploy all services using their respective Kubernetes manifests:

Deploy Script (deploy_services.sh):

BASE_DIR="." 
for dir in "$BASE_DIR"/*/; do
  if [ -d "$dir" ]; then
    echo "Deploying service in $dir"
    if [ -f "${dir}service.yml" ] && [ -f "${dir}deployment.yml" ]; then
      echo "Applying Deployment and Service for $dir..."
      kubectl apply -f "$dir/deployment.yml"
      kubectl apply -f "$dir/service.yml"
      echo "Successfully deployed service in $dir."
    else
      echo "Missing service.yml or deployment.yml in $dir."
    fi
  fi
done
echo "Waiting for all services to be deployed..."
kubectl wait --for=condition=available --all deployments --timeout=600s
echo "All services deployed successfully!"
read -p "Press any key to exit..."

Step 3: Run the Deployment Script

Navigate to the folder containing all your service directories and run the script:

chmod +x deploy_services.sh
./deploy_services.sh

Step 4: Configure the Database for Local Development

To configure the database for local development, update the application.properties file in each microservice. Here is an example of configuring it for a local MySQL database:

Example application.properties configuration:

# Database Configuration
spring.datasource.url=jdbc:mysql://localhost:3306/your_database_name
spring.datasource.username=your_db_username
spring.datasource.password=your_db_password

# Hibernate Configuration
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect

Adjust spring.datasource.url, spring.datasource.username, and spring.datasource.password to match your local database setup.

Step 5: Running the Angular Frontend

To run the Angular frontend locally:

  1. Navigate to the Front-End directory:

    cd Front-End
  2. Install dependencies using npm:

    npm install
  3. Start the Angular development server:

    ng serve

The Angular frontend will be accessible at http://localhost:4200/ by default.

Accessing the System

The API Gateway serves as the main entry point for accessing the microservices. Forward its port locally using the following command:

kubectl port-forward service/api-gateway 8080:8080

Access your APIs via http://localhost:8080.

Microservice Details

  • Description: Routes requests to other services, handles authentication, and provides centralized entry.
  • Description: Manages user operations (e.g., registration, login, profile).
  • Description: Handles order creation, updates, and retrieval.
  • Description: Provides CRUD operations for products and inventory.
  • Description: Manages store data and related operations.
  • Description: Creates and manages discount coupons.
  • Description: Sends notifications (e.g., email, SMS).
  • Description: Web interface for interacting with the microservices.

Pinned Loading

  1. Bank-System-Api Bank-System-Api Public

    This is a Spring Boot application for a banking system. It provides functionality for managing user accounts, transactions, and user information. The application is built using the Spring Boot fram…

    Java 1 1

  2. Coupon-API Coupon-API Public

    The coupon API

    Java

Repositories

Showing 10 of 12 repositories
  • User-Api Public
    Fawry-Intern-Round4/User-Api’s past year of commit activity
    Java 0 0 0 0 Updated Nov 11, 2024
  • .github Public

    Fawry Project Description

    Fawry-Intern-Round4/.github’s past year of commit activity
    0 0 0 0 Updated Nov 11, 2024
  • Coupon-API Public

    The coupon API

    Fawry-Intern-Round4/Coupon-API’s past year of commit activity
    Java 0 0 0 0 Updated Nov 11, 2024
  • Store-Api Public
    Fawry-Intern-Round4/Store-Api’s past year of commit activity
    Java 0 0 0 0 Updated Nov 11, 2024
  • Order-API Public
    Fawry-Intern-Round4/Order-API’s past year of commit activity
    Java 0 MIT 0 0 0 Updated Nov 11, 2024
  • Product-Api Public
    Fawry-Intern-Round4/Product-Api’s past year of commit activity
    Java 0 0 0 0 Updated Nov 11, 2024
  • Bank-System-Api Public

    This is a Spring Boot application for a banking system. It provides functionality for managing user accounts, transactions, and user information. The application is built using the Spring Boot framework and utilizes a database to store banking data.

    Fawry-Intern-Round4/Bank-System-Api’s past year of commit activity
    Java 1 1 0 1 Updated Dec 3, 2023
  • Front-End Public

    The front end part for fawry project

    Fawry-Intern-Round4/Front-End’s past year of commit activity
    TypeScript 0 0 0 0 Updated Oct 31, 2023
  • Fawry-Intern-Round4/Bank-System-UI’s past year of commit activity
    TypeScript 0 1 0 0 Updated Oct 28, 2023
  • Fawry-Intern-Round4/Notfication-API’s past year of commit activity
    Java 0 0 0 0 Updated Oct 27, 2023

Top languages

Loading…

Most used topics

Loading…