ebrvc / Minitwit

This project is part of the course DevOps, Software Evolution and Software Maintenance, MSc (Spring 2024)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


DevOps-GroupC

Table of Contents
  1. About The Project
  2. Running the project
  3. Acknowledgments

About The Project

This project is part of the course DevOps, Software Evolution and Software Maintenance, MSc (Spring 2024)

The project currently consists of two folders:

  • itu-minitwit, which is a small Twitter copy made in Python.
  • csharp-minitwit, which is a ported version of itu-minitwit, made in C#.

Built With

  • .Net 8
  • ASP.NET
  • SQLite

Prerequisites

  • A modern Python, i.e., version >= 3.10,

    • There are various ways of installing it, either via the system's package manager (apt search python3)
    • manually from python.org
    • via pyenv
    • via Anaconda
  • The Python dependencies from itu-minitwit:

  • A current C compiler, e.g., gcc

    • Likely it is already part of your Linux installation.
    • You can check that, for example with:
    gcc --version
    • Since the flag_tool is a C program, you have to compile it again:
      • flag_tool includes sqlite3.h, which is likely not yet installed on your system.
      • It can be installed (together with the required shared library) via:
      sudo apt install libsqlite3-dev
  • To work with the database, you likely need sqlite3 ((apt search sqlite3))

    • To inspect the database file while refactoring, you might want to use a tool to "look into" your database file, such as the DB Browser for SQLite, which you can install via:
    sudo apt install sqlitebrowser
  • The .NET 8.0 SDK. There are multiple options for downloading depending on your operating system. If on linux, we recommend the scripted install.

Usage

itu-minitwit

This project can be run using a terminal. cd into the correct folder:

cd itu-minitwit

Run using Python:

python minitwit.py

itu-minitwit tests

Tests for itu-minitwit can be run by opening a new terminal and cd into correct folder:

cd itu-minitwit

And running the tests using Pytest:

pytest minitwit_tests.py

At this point, the application can be accessed using the link provided in the terminal (http://127.0.0.1:5000).

csharp-minitwit

This project can be run using a terminal. cd into the correct folder:

cd csharp-minitwit

Run using dotnet:

dotnet run

Run using docker - runs only the app:

docker build -t csharp-minitwit .
docker run -p 5000:8080 csharp-minitwit

At this point, the application can be accessed using the link provided in the terminal (http://localhost:5000). Furthermore, API documentation can be accessed at http://localhost:5000/swagger.

Run using docker-compose - runs multiple development services, such as Prometheus, Grafana, etc.:

docker-compose up

Monitoring

Service Endpoint
Built-in metrics http://localhost:5000/metrics
Prometheus http://localhost:9090
Grafana http://localhost:3000

csharp-minitwit tests

Tests for csharp-minitwit can be run by opening a new terminal and cd into the test folder:

cd csharp-minitwit/Tests

And running the tests using Pytest:

pytest refactored_minitwit_tests.py

Acknowledgments

Shout out to Chatgpt for help with debugging.

About

This project is part of the course DevOps, Software Evolution and Software Maintenance, MSc (Spring 2024)


Languages

Language:C# 62.9%Language:HTML 12.0%Language:Python 11.1%Language:Ruby 7.1%Language:CSS 5.1%Language:JavaScript 0.7%Language:Dockerfile 0.7%Language:Shell 0.3%