DevopsGroupC / 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. How to contribute
  4. 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 three main folders:

  • csharp-minitwit, which is a ported version of itu-minitwit, made in C#.
  • infrastructure, Containing shell and Terraform scripts for provisioning.
  • report, Containing a report written in LaTex, generated as a pdf in the build folder.

The application

The 'csharp-minitwit' application is a miniature version of X (formerly known as Twitter).

Prerequisites

  • Linux. It is also possible to work on the project using MacOS, Windows has a few Git issues with the 'infrastructure/secrets:Zone.Identifier' file.
  • The .NET 8.0 SDK. There are multiple options for downloading depending on your operating system. If on linux, we recommend the scripted install.
  • SQLite, multiple guides can be found online on how to install, this highly depends on which operating system is used.
  • Docker
  • Python with the pytest and request pip-packages installed (only needed for testing).

Running the project

This project can be run in two ways:

Run using docker (the prefered method):

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).

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

docker-compose up

Run using the dotnet runtime directly:

This firstly requires a few changes to the code. The default connection string points to a folder which will be generated in the docker container normally. Change the connection string in 'appsettings.Development.json', from 'Data Source=/app/Databases/volume/minitwit.db' to 'Data Source=./Databases/volume/minitwit.db' DO NOT COMMIT THIS.

cd into the correct folder:

cd csharp-minitwit

Run using dotnet:

dotnet run

Monitoring

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

Testing

When developing APIs locally, Swagger is setup at http://localhost:5000/swagger/index.html for easy manual testing.

Unit 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
pytest minitwit_sim_api_test.py

How to contribute

For this repository we try to follow the GitFlow workflow:

  • Create an issue
  • Create a branch using the GitHub issue tracker to ensure correct naming (remember to prefix the branch name with feature/{issue_name})
  • Develop feature
  • Create a pull request

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# 61.2%Language:HCL 10.4%Language:HTML 9.0%Language:Python 8.4%Language:Shell 6.0%Language:CSS 3.9%Language:JavaScript 0.6%Language:Dockerfile 0.5%