{"id":18350397,"url":"https://github.com/tnas/alticci-sequence","last_synced_at":"2026-05-05T14:02:51.860Z","repository":{"id":94324679,"uuid":"578166254","full_name":"tnas/alticci-sequence","owner":"tnas","description":"Altice Labs Technical Exercise","archived":false,"fork":false,"pushed_at":"2022-12-15T19:32:35.000Z","size":6150,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T23:52:21.955Z","etag":null,"topics":["angular-14","docker","docker-compose","java-17","spring-boot","swagger2"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tnas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-14T12:16:04.000Z","updated_at":"2022-12-15T19:22:14.000Z","dependencies_parsed_at":"2023-03-08T14:00:41.425Z","dependency_job_id":null,"html_url":"https://github.com/tnas/alticci-sequence","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tnas/alticci-sequence","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnas%2Falticci-sequence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnas%2Falticci-sequence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnas%2Falticci-sequence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnas%2Falticci-sequence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tnas","download_url":"https://codeload.github.com/tnas/alticci-sequence/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnas%2Falticci-sequence/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269933153,"owners_count":24499217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular-14","docker","docker-compose","java-17","spring-boot","swagger2"],"created_at":"2024-11-05T21:26:27.485Z","updated_at":"2026-05-05T14:02:46.807Z","avatar_url":"https://github.com/tnas.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Altice Labs Technical Exercise\n\n## Table of contents\n* [Description - In Portuguese](#description)\n* [Tech Stack](#tech-stack)\n* [Implementation](#implementation)\n* [Run Locally](#run-locally)\n* [Containerization](#containerization)\n* [API Documentation](#api-documentation)\n\n## Description\n\nDeverá ser implementado um serviço REST utilizando uma framework JAVA que devolve um\nvalor da sequência **Alticci**.\n\nOpcionalmente poderá ser implementado um GUI web simples em JavaScript para consultar o\nserviço.\n\nA sequência Alticci - a(n) - é definida da seguinte forma:\n\nn=0 =\u003e a(0) = 0\u003cbr\u003e\nn=1 =\u003e a(1) = 1\u003cbr\u003e\nn=2 =\u003e a(2) = 1\u003cbr\u003e\nn\u003e2 =\u003e a(n) = a(n-3) + a(n-2)\n\nExemplo dos primeiros valores da sequência:\n\n0\u003cbr\u003e\n1\u003cbr\u003e\n1\u003cbr\u003e\n1\u003cbr\u003e\n2\u003cbr\u003e\n2\u003cbr\u003e\n3\u003cbr\u003e\n4\u003cbr\u003e\n5\u003cbr\u003e\n7\u003cbr\u003e\n9\u003cbr\u003e\n[…]\n\nO endpoint a criar será da forma `\u003cbaseurl\u003e/alticci/{n}` em que o `{n}` representa o\níndice da sequência para o qual pretendemos obter o valor.\n\nO serviço implementado deverá tirar partido de cálculos passados para acelerar cálculos\nfuturos (caching).\n\nResposta deverá incluir:\n\n- Código fonte\n- Documentação das APIs ReST – formato Open API (Swagger)\n- Instruções para execução (em containers ou outra)\n\nCaso existam dúvidas em relação a qualquer ponto que possa influenciar a implementação, o\ncandidato deverá tomar decisões e avançar de acordo com os pressupostos assumidos (que\ndevem ser incluídos na resposta ao exercício).\n\n## Tech Stack\n\n- JDK 17\n- Spring Boot 2.7.6 (Java framework)\n- Maven 3.6.3\n- Swagger 2\n- Angular 14\n- Junit 5 (Unit tests)\n- Docker 20.10.21\n\n## Implementation\n\nThe API computes the Alticci sequence up to the limit of **1000 elements**.\n\n## Run Locally\n\nTo **run the application locally**, execute both the front-end (SPA application) and back-end (Restful API).\n\n### Restful API\n\nIn the `backend` folder, run the command `mvn install` to build the application.\nSuch a command also prepares the application for the containerization.\n\nIn the `backend/target` folder, execute the command `java -jar alticci-0.0.1-SNAPSHOT.jar` to run the API on port `8080`.\n\n### Single Page Application\n\nIn the `frontend` folder, execute the command `ng serve --open` to run the application.\n\nTo build the application in preparation for containerization, run the command\n`ng build --configuration=production`.\n\n## Containerization\n\nThe application can be run in three ways.\n\n### Docker\n\nA `Dockerfile` was created for each application part - back-end and front-end. A bash script has been prepared to facilitate the Docker image building and container creation. \n\nInside each application folder (`backend` and `frontend`), run the script through the `./docker_build_run.sh` command.\n\n**Note 1:** You must give execution permission to the bash script.\nFor this, run the command `chmod +x docker_build_run.sh`.\n\n**Note 2:** The application build is not part of the Docker image building and container creation phases. It means that, **before run** `docker` or `docker-compose` commands, both applications must be built. In other words, the Restful API `.jar` file must be generated, as well as the SPA static files. \n\n### Docker Compose\n\nAnother way to run the application is using the `docker-compose.yml` file available in the root folder of the project. In that \nfolder run the command `docker-compose up`. Once both containers are running, access the application via the URL\n[http://localhost:8000](http://localhost:8000).\n\n### Docker Hub\n\nThe simplest way to have the application running on localhost is using the Docker images\navailable on the Docker Hub. Again, the Docker Compose can be used for this.\n\nIn the `dockerhub` folder, just run the `docker-compose up` command.\n\n**Note:** This way to run the application eliminates the need to build\nthe back-end (`.jar`file) and the front-end (SPA static files) locally.\n\n### API Documentation\n\nThe Restful API has been documented following the Open API\nstandard. The Swagger was employed for such documentation.\nIt is available at [http://localhost:8080/swagger-ui/](http://localhost:8080/swagger-ui/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftnas%2Falticci-sequence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftnas%2Falticci-sequence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftnas%2Falticci-sequence/lists"}