Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

76 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧩 Exercise Part 1: Automation

This project is the first step in developing a simple social media application.
The goal of this exercise is to design a small Python program that stores and retrieves social media posts from a database and to automate testing using GitHub Actions.


πŸ“˜ Exercise Description

Objective

Develop a Python application that can:

  • Store social media posts in a database containing:
    • πŸ–ΌοΈ Image
    • πŸ’¬ Text (comment)
    • πŸ‘€ User
  • Retrieve the latest post from the database.

βš™οΈ Steps to Complete

1. Develop Python Application

  • Define the post information (image, text, user).
  • Store multiple posts in a SQLite database.
  • Implement functionality to retrieve the latest post.

2. Test the Application

  • Write unit tests to verify database storage and retrieval logic.
  • Ensure the program runs correctly and returns the expected data.

3. Configure GitHub Actions

  • Create a GitHub Actions workflow that:
    • Automatically runs tests on pull requests.
    • Ensures all tests pass before merging.

4. Final Steps

  • Commit all developed code and workflow configurations.
  • Push the final version to GitHub.

πŸ‘₯ Contribution

Task Area Angelo Ottendorfer Martin Ferschl
1. Python Application Implement database.py (SQLite setup, add/retrieve posts) Support by testing functions manually, react setup
3. Testing Provide testable database functions Create tests/test_app.py using pytest
4. GitHub Actions Review pipeline configuration Create .github/workflows/ci.yml and ensure CI runs only on pull requests
5. Final Steps Commit app code Commit tests + CI config and verify all tests pass
Branch feature/backend react

🧩 Exercise Part 2: REST API

This project is the next step in developing the simple social media application.
The goal of this exercise is to create a REST API to expose the functionality developed in Part 1 and integrate it with a React web frontend.


πŸ“˜ Exercise Description

Objective

Develop a REST API and a web application that can:

  • Send, retrieve, and search social media posts via API endpoints.
  • Expose the functionality of the Python application from Part 1.
  • Provide a React frontend to interact with the API.

βš™οΈ Steps to Complete

1. Develop REST API

  • Implement API endpoints to:
    • Submit a new post
    • Retrieve posts
    • Search posts by user or content
  • Provide an FastAPI specification for your REST API.

2. Expand Testing

  • Extend the testing framework to include API tests (e.g., using pytest + requests).
  • Ensure all API endpoints work as expected.

3. Create Web Application

  • Develop a React frontend that can:
    • Submit a post
    • List and display all posts
    • Search and display posts by user

4. Git & GitHub Workflow

  • Commit code frequently.
  • Track feature requests in GitHub issues.
  • Use feature branches and pull requests to integrate changes.

πŸ‘₯ Contribution

Task Area Martin Ferschl
1. REST API Implement all endpoints for submitting, retrieving, and searching posts
2. OpenAPI Spec Create OpenAPI/Swagger documentation for the API
3. Testing Expand testing framework to cover all API functionality
4. React Frontend Develop web frontend to submit, list, and search posts
5. Git & GitHub Commit frequently, track features, manage feature branches & pull requests
Branch feature/react

🧩 Exercise Part 3: Docker / Container Creation

This project focuses on containerizing the social media application to make it easy to deploy and compatible with other REST API definitions.
The goal is to package the REST API as a Docker container and automate container workflows with GitHub Actions.


πŸ“˜ Exercise Description

Objective

Develop a Docker container for the REST API and integrate GitHub Actions to automate the build and deployment process.
The application should be easy to deploy and run in any environment.


βš™οΈ Steps to Complete

1. Docker Containerization

  • Create a Dockerfile for the REST API including:
    • All necessary libraries and dependencies
    • Configuration for executing the API from Docker
  • Ensure the container can be built and run locally using Docker commands.

2. Automate with GitHub Actions

  • Create a GitHub Actions workflow that:
    • Automatically builds the Docker container on push or pull request
    • Pushes the container to a container registry (e.g., Docker Hub or GitHub Container Registry)
  • Verify that the workflow runs correctly and the container is available in the registry.

πŸ‘₯ Contribution

Task Area Angelo Ottendorfer Martin Ferschl
1. Docker Container Create Dockerfile and configure container to run REST API -
2. GitHub Actions - Implement CI workflow to build and push Docker container
Branch feature/docker feature/docker-ci

🧩 Exercise Part 4: Container Orchestration

This project focuses on orchestrating the social media application using Docker Compose.
The goal is to separate the application logic from the data, persist data across releases, and allow environment-specific configuration.


πŸ“˜ Exercise Description

Objective

Develop a Docker Compose setup that:

  • Separates containers for the REST API, database, and any other required infrastructure
  • Persists data during container re-deployment
  • Supports environment-specific configurations using a .env file

This allows the application to be easily deployed and updated without losing data.


βš™οΈ Steps to Complete

1. Container Orchestration

  • Create a Docker Compose file that defines services for:
    • Backend REST API
    • Frontend web application
    • Database (SQLite persisted via Docker volume)
  • Configure volumes to persist data across container restarts.
  • Ensure services can communicate through the Docker network.

2. Environment Configuration

  • Create a .env file to define environment-specific variables:
    • Backend and frontend ports
    • Database URL
    • Other configuration options
  • Ensure backend reads database configuration from environment variables.

πŸ‘₯ Contribution

Task Area Angelo Ottendorfer Martin Ferschl
1. Docker Compose Orchestration Configure backend, frontend, and volumes for data persistence Adapted files for postgres addition
2. Environment Configuration Setup .env file and configure backend to use environment variables Added postgres as seperate container for data storage
3. Testing Test container orchestration and persistence Tested orchestration with now 3 containers, persistent data
Branch feature-testing 'feature-postgres'
Time Required 1h ~1h

🧩 Exercise Part 5: Event-Driven Architecture

This exercise extends the social media application with an event-driven architecture to improve image loading performance.
Instead of serving only full-size images, the application now processes images asynchronously to generate reduced-size versions using a dedicated microservice triggered by a message queue.


πŸ“˜ Exercise Description

Objective

Enhance the application by introducing an image processing microservice that:

  • Stores both full-size and reduced-size images
  • Uses a message queue to trigger image resizing asynchronously
  • Separates image processing logic into an independent container
  • Updates the REST API and frontend to support optimized image delivery

This approach improves scalability, performance, and user experience.


βš™οΈ Steps to Complete

1. Event-Driven Image Processing

  • Store both original and resized versions of uploaded images
  • Submit image-processing tasks to a message queue after image upload
  • Implement a separate image resize service that:
    • Listens to the queue
    • Processes images asynchronously
    • Stores the resized image

2. Microservice Architecture

  • Provide the image resize functionality as a dedicated container
  • Integrate the image processing service into the existing Docker Compose setup
  • Ensure services communicate via the message queue

3. API and Frontend Updates

  • Extend the REST API to:
    • Serve full-size images
    • Serve reduced-size images
  • Update the REST API + WebApp as needed to enable reduced-size + full-size images

4. Automation with GitHub Actions

  • Add unit and integration tests for:
    • Backend API
    • Image processing service
  • Create GitHub Actions workflows to:
    • Automatically test all services
    • Build and push Docker images for:
      • Backend
      • Frontend
      • Image processing service

πŸ‘₯ Contribution

Task Area Angelo Ottendorfer Martin Ferschl
1. Event-Driven Design - Design message queue integration
2. Image Processing Service Implement image resize microservice -
3. REST API & Frontend Updates Extend API and frontend for image handling -
4. GitHub Actions - Configure CI workflows for testing and container publishing
Branch feature-messagequeue feature-messagequeue, feature-testing
Time Required 4h ~3h

🧩 Exercise Part 6: Event-Driven Machine Learning Services

This exercise extends the social media application by introducing machine-learning–based microservices to enhance user experience.
Pre-trained GPT-2 / DistilGPT-2 models are integrated into the system to provide sentiment analysis and text generation, leveraging an event-driven architecture for asynchronous processing.


πŸ“˜ Exercise Description

Objective

Enhance the application by introducing ML-powered microservices that:

  • Analyze user-generated content using sentiment analysis
  • Generate context-aware reply suggestions
  • Process ML tasks asynchronously using a message queue
  • Store additional ML metadata in the database
  • Integrate seamlessly into the existing microservice architecture

This approach improves scalability, responsiveness, and user engagement while demonstrating real-world ML system design.


βš™οΈ Steps to Complete

1. Event-Driven ML Processing

  • Submit text-analysis tasks to a message queue after post creation
  • Perform sentiment analysis asynchronously using a pre-trained GPT-2 model
  • Compute and store a confidence score for the sentiment prediction
  • Generate reply suggestions using a GPT-based language model

Sentiment analysis is handled asynchronously via RabbitMQ, ensuring non-blocking API responses.


2. Microservice Architecture

  • Implement ML inference as a dedicated GPT-2 worker service
  • Separate ML logic from the main backend service
  • Integrate the ML worker into the existing Docker Compose setup
  • Ensure services communicate exclusively via a message queue

3. API, Database, and Frontend Updates

  • Extend the database schema to store:
    • Sentiment label
    • Sentiment confidence score
  • Adapt REST API endpoints to expose ML-enriched post data
  • Add a sentiment badge to the frontend UI
  • Enable on-demand reply suggestion generation from the frontend
  • Display AI-generated suggestions directly in the WebApp

4. Container Orchestration

  • Add ML worker service to container orchestration
  • Ensure reproducible environments for:
    • Backend
    • Frontend
    • GPT-2 worker
    • Message broker (RabbitMQ)

🧠 ML Models Used

  • DistilGPT-2
    • Faster inference
    • Lower memory footprint
    • Suitable for real-time applications
  • Hugging Face transformers library

πŸ‘₯ Time Required ~6–8 hours

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages