Skip to content

Milestone report

Doruk Büyükyıldırım edited this page Apr 29, 2024 · 1 revision

Milestone report

SWE573 Software Development Practice Spring 2024

Doruk Büyükyıldırım - 2022719033
Date: 29.04.2024

1. Introduction

This report goes through the current state of, and planned improvements for, the project CISM (Community Specific Information Management System).

1.1 List of related links:

2. Infrastructure & Deployment

2.1. The following diagram illustrates the network architecture and infrastructure behind the cloud deployment:

Infrastructure and network diagram

2.2. Steps taken for cloud deployment in detail:
  • A free tier Ec2 instance is started in Amazon Web Services (AWS).
  • The instance is attached to a Virtual Private Cloud (VPC) with Internet Gateway and a Security Group (SG).
  • The SG is configured to allow traffic from the internet on ports 22 (for ssh connection), 80 (for http requests), and 443 (for https requests).
  • A DNS record (A record) is created to point to the public IP of the Ec2 instance inside AWS
  • An Nginx Web Server service is created and run inside the Ec2 instance to provide TLS termination and reverse proxying the traffic to the Django project listening on port 8000.
  • The required TLS ceritificate is generated automatically by Certbot software for the DNS record (swe573.dorukb.com).
  • The project is pulled from the git repository.
  • A Linux systemd service is generated and started to run docker compose up command as a daemon service.

3. Building The Application Locally

Requirements to run locally:

  • docker version 20.10.x or greater
  • docker compose version v2.2.x or greater

To build the application locally:

  • The docker compose up command should be executed inside the csims directory (/swe573/tree/main/csims).
  • The required software packages will be downloaded during the initial docker compose up run, which may take some time during the first run. Following runs will take much less time due to Docker's caching feature.
  • The PostgreSQL database will run automatically and create /db_data folder for database files.
  • During the docker compose up the database migrations required by Django will run automatically.
  • Execute docker compose down to stop the project. After shutting down data in the database will be persistent under /db_data folder. Any user, user, community, etc. created in a previous run will be available if data under /db_data is not deleted.

Note: /db_data is added to .gitignore so that database data is not pushed to remote repository.

4. Navigation & Usage of the Platform (CISM - UI)

Navigating inside the platform is intuitive and easy. Links at the top navigation bar can direct the user to the desired page.

The only thing to point out is that the user will see different options available when logged in, such as:

  • Posts page to create posts
  • Option to join or create a community

At this point I invite the reader to go to this link and experience the platform if not already. At this juncture, I encourage the reader to visit the provided link and explore the platform firsthand, if they haven't already done so.

Main Page View of a Guest User (not logged in):

Main page as seen by the guest user

Main Page View of a Logged in User:

Main page as seen by the logged in user

Communities Page View of a Guest User (not logged in):

Communities page as seen by the guest user

Communities Page View of a Logged in User:

Communities page as seen by the logged in user

5. Reflections & Notes

This section is dedicated to highlighting the key points deemed significant during the creation of the project.

5.1 Development/ Implementation:

  • Django backend configuration should be looked into.
  • CSRF token and TLS termination by Nginx caused a cross site scripting protection error which is resolved by changing allowed hosts parameter in Django project and reverse proxy headers in Nginx configuration.

5.2 Infrastructure & Deployment:

  • The instance class t2.micro from AWS with 1 vcpu and 1gb ram is enough to run all components (Nginx, Docker Compose with PostgreSQL & Django project) which is both surprising and convenient since it is a free solution.
  • The type A DNS record became valid in just around a minute, which differs from what many documentations suggest.

6. Planned Improvements

The following improvements are planned to be achieved before the final milestone (Final Deliverable - 20 May 2024, 17:00). Corresponding issues are created in the repository and linked to the mentioned milestone.

6.1 Development/ Implementation:

  • Styling and aesthetics can be improved. A .js dynamic rendering file should be added.
  • Post creation should only be limited to members of a community.
  • Community ownership and managership should be implemented.
  • Other types of post templates must be supported, and created by the community managers/ owners.
  • A community page should display the member list.
  • The main page of the platform should display a list of popular posts with their content.

6.2 Infrastructure & Deployment:

  • The infrastructure should be configured as Infrastructure as Code (IaC)
  • The Docker container generated shoud be saved to a private container registry, and pulled rather than building the container at every run.
  • A deployment pipeline with different steps (ifrastructure creation, continuous integration, continuous delivery) should be implemented.
  • The public IPv4 of the Ec2 instance is dependent on the instance state. If the instance stops the IP will be dropped. A more permanent solution should be found. Load balancers managed by the cloud can be a viable option.
  • Multi tier software architecture can be implemented (not a must).

6.3 Other:

  • A better name should be found for the project.
  • The project requires a logo.

Clone this wiki locally