/ufpa-algorithm-analysis

This project is a work requested for the discipline of Algorithm Analysis (Mathematical Analysis) taught in the Bachelor's Degree in Information Systems at UFPA.

Primary LanguageTypeScriptMIT LicenseMIT

UFPA Algorithms analysis

This project is a work requested for the discipline of Algorithm Analysis taught in the Bachelor's Degree in Information Systems at UFPA.

This work aims to analyze the complexities and imply some tests on top of the BucketSort, CountingSort, HeapSort, QuickSort and RadixSort algorithms. The full requirements are described in the file in this link.

Technologies

The technologies used in the project were the most recent versions of:

  • Javascript, Typescript and Jest
  • NodeJS and NPM
  • Docker and Docker Compose
  • Visual Studio Code 1.78.2
  • Git version 2.34.1
  • Github and Github CLI.
  • ViaCEP API

Installation

This project requires you have installed in your machine the most recent version of Docker and Docker Compose, so make sure that you have them.

First of all, clone the repository in your local environment. You could use the Github or Github CLI, or simple run git clone https://github.com/eng-gabrielscardoso/ufpa-algorithms-analysis.git. After it you have three options to configure the project, with SDK, with Docker only or using the Docker Compose (recommended).

Before the installation, make sure to copy the .env.example file as your .env. Actually there area two variables:

  • APP_ENV: this is the environment that will be ran when the project were executed. There are two values possible here: local and `test
  • API_BASE_URL: this is the environment that will describe the API url that will be called by Axios when the project were use the Services.

With SDK (NodeJS stack)

Install necessary dependencies with the following command:

npm i

Essential Commands

  • Build: npm run build
  • Run development scripts: npm run dev
  • Run unit tests: npm run test
  • Clear dist (build assets): npm run clear

Docker

Docker Configuration

First of all you need to build the image using the following command:

docker build -t app .

Essential Commands

  • Build: docker run -v .:/var/www/app -it app build
  • Run development scripts: docker run -v .:/var/www/app -it app dev
  • Run unit tests: docker run -v .:/var/www/app -it app test
  • Clear dist (build assets): docker run -v .:/var/www/app -it app clear

Docker Compose Configuration

You could use the following command to configure and start the containers:

docker-compose up -d --build

Essential Commands

  • Build: docker-compose exec app npm run build
  • Run development scripts: docker-compose exec app npm run dev
  • Run unit tests: docker-compose exec app npm run test
  • Clear dist (build assets): docker-compose exec app npm run clear

Github Codespaces

A simple way to test project is using Github Codespaces. You could just press "." key in your keyboard and a web instance of Visual Studio Code will open in your Github with the project. To run commands the Github will recommend you to instance a Virtual Machine (for free) and will provide all resources to use, code and test the project via web. After create your Github Codespace you could follow the instructions of SDK installation.

Repl.it

If you really haven't Docker or haven't installed in your machine the necessary SDK to run the application you still could use the public Repl.it feature to see in live. Just go to the following link.

Authors

The work was done by students:

Licence

This project is licenced under the MIT licence. See the Licence file for details here.