# README
ITU MiniTwit WEB application
This repository is used as a student project for the DevOps, Software Evolution and Software Maintenance course, at ITU. Course description. Original files can be found on this branch
This project contains a refactored Python Flask WEB application, which has been changed to Go.
API: Expansive features added to the application, include an API which other systems can interact with(user registration, user following, message posting).
Public server:
The system has also been deployed on a publicly accessible server, through Digital Ocean. This deployment has been automated to create a CI/CD pipeline. This pipeline is activated through github actions, when main
is modified (typically through a pull request). The CI/CD also handles releases, and will publish a minor release every time the pipeline is activated.
Monitoring: Further more, a monitoring system has been added to the application, using prometheus and grafana.
Database migration: Finally, the database has been migrated from a SQLite database, running on the same droplet as the website, to a PostgreSQL database running on a separate droplet.
Topics
Requirements with Docker 🐳
- Docker CLI
Requirements for Go and React ⚙️
- go-lang
- psql
- node.js v20.11.1
Environments and Links 🔗
- Public timeline: http://minitwit.fun/public
- prometheus: http://minitwit.fun:9090
- Grafana: http://minitwit.fun:8080
- username: admin
- password: mrt3ukb5yvr@XFU*qgh
- API link:
http://159.89.4.152:5000/sim/<Endpoint>
Starting the project 🛠
- Firstly, pull the repository, and navigate to the minitwit folder:
git clone [email protected]:DevOps-Ben11/minitwit.git
cd minitwit
- Here you have 2 options for how to run the application. Run the go-lang file or create an image and run that:
With Docker
- Start the PostgreSQL database:
docker run --name my_postgres_db -e POSTGRES_PASSWORD=mysecretpassword -d -p 5431:5432 postgres
- Build the image:
docker build -t minitwit-image .
- Run the application:
docker compose -f scripts/docker-compose.local.yml up
- Open http://localhost:5000/ to see the application.
With Go and React
- Navigate to the
backend
folder and create.env
file based on.env.example
:
cd backend
-
Start the server by running
go run main.go
-
To start the client on a different terminal go to the client folder:
cd client
and runnpm run dev
-
Open http://localhost:3000/ to see the application.
If all responses are 500, try clearing the browser cookies to regenerate new ones on the current encryption.
Deployment
Deployments happen through CI/CD using GitHub Actions when merging to main
.
The WEB application can be found here http://minitwit.fun/.