Today, i’m updating the readme.md on github. I used notion for eveything and the readme was completly empty.

I managed my time and remaining tasks in a way that prioritized first what I knew how to do and what was mandatory for the submission. I left the 'tests, coverage, API monitoring, and linting' part for the last few days. I knew the tests parts needed to be added all along the project but i didn’t know how to implement those and don’t want to waste too much time on it since i had other things to cover.

I also wanted to work on my algorithm, i know this is not the simplest and sometimes the spaces between the words are not always well spread. I think when the paragraph begins by a space, it doesn’t really outputs the same as the others justify text tools.

AWS - online deploiement of API

But before all, i need to do one constraint of the subject that is mandatory: the code must be deployed on a public URL or IP.

I will use AWS to deploy my api online. So i followed these steps:

  1. create an account on AWS
  2. create virtual machine for docker
  3. create key pairs (for the proctection ssh)
  4. allow https for my instance
  5. expose my port of my api

Untitled

  1. connect by ssh with a the key given

    ssh -i "api_justify_text_key.pem" [user][@](<mailto:[email protected]>)[domain-given-by-aws].com
    
  2. install docker and give permissions

    sudo yum update
    sudo yum search docker
    sudo yum info docker
    sudo yum install docker
    sudo usermod -a -G docker ec2-user
    id ec2-user
    
    # need to reload session
    logout
    
    newgrp docker
    wget <https://github.com/docker/compose/releases/latest/download/docker-compose-$>(uname -s)-$(uname -m)
    sudo mv docker-compose-$(uname -s)-$(uname -m) /usr/local/bin/docker-compose
    sudo chmod -v +x /usr/local/bin/docker-compose
    sudo systemctl enable docker.service
    sudo systemctl start docker.service
    sudo systemctl status docker.service
    sudo yum search git
    sudo yum info git
    sudo yum install git
    
  3. git clone my repo and build the containers

    git clone <https://github.com/trobert42/API_JustifyText.git>
    cd API_JustifyText/
    docker-compose up --build -d 
    
  4. test with curl/browser/imsonia if its working!

    Untitled

Day 5 - 10/03/2024 - more tests + READme + linting + API monitoring + reworking algo