Table of Contents
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 'csharp-minitwit' application is a miniature version of X (formerly known as Twitter).
- 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).
This project can be run in two ways:
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
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
Service | Endpoint |
---|---|
Built-in metrics | http://localhost:5000/metrics |
Prometheus | http://localhost:9090 |
Grafana | http://localhost:3000 |
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
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
Shout out to ChatGPT for help with debugging.