Skip to content

Mevryk/Skylab

Repository files navigation

Skylab Testbed

Skylab was created to serve as a testbed for technical experiments. It is a simple PHP application built on top of Laravel Lumen with a single endpoint, mock token validation, and proper request filtering.

Installation

Prerequisites

Ensure the following are installed:

  • Docker (to run the container)
  • GitLab Account (to access the GitLab Container Registry)
  • Git (if you need to clone the repository)

1. Clone the GitLab Repository (if not already cloned)

Clone the repository with

git clone https://gitlab.com/Mevryk/skylab.git
cd skylab

2. Login to GitLab Container Registry

Before pulling or pushing images to the GitLab Container Registry, authenticate using:

docker login registry.gitlab.com

Use your GitLab username and Personal Access Token (PAT) instead of your password. To generate a PAT, refer to this guide.

3. Build and Run the Docker Container

Run the following commands to pull and start the container:

docker-compose pull 
docker-compose up -d

To verify the container is running:

docker ps

Cleanup

To stop and remove the container along with associated volumes:

docker-compose down --volumes

Usage

The API requires a mock authentication token in the Authorization header:

Authorization: Bearer mock-valid-token

You can access the endpoint via cURL, a web browser, Postman, or any other HTTP client. The service runs on port 8000

API Endpoint:

/api/movements/:id/ranking

:id is a numeric identifier for the movement whose ranking you want to retrieve.

example request:

curl -H "Authorization: Bearer mock-valid-token" http://localhost:8000/api/movements/1/ranking

Final considerations

JWT authorization and role-based access control were intentionally omitted to maintain database simplicity due to the reduced scope. This allows database reconstruction without reliance on the Docker volume. However, basic scaffolding for these features remains in place.

Teste Técnico - Skylab Testbed

Instalação

Pré-requisitos

Certifique-se de que os seguintes softwares estão instalados:

  • Docker (para executer o container)
  • Conta no GitLab (para acessar o GitLab Container Registry)
  • Git (para clonar o repositório)

1. Clonar o repositório

git clone https://gitlab.com/Mevryk/skylab.git
cd skylab

2. Login no Container Registry do GitLab

docker login registry.gitlab.com

Use seu usuário do GitLab e um Personal Access Token (PAT) em vez de senha. Para gerar um PAT, consulte este guia.

3. Construir e rodar o container

docker-compose pull 
docker-compose up -d

Verifique se o container está rodando corretamente:

docker ps

Limpeza

Para parar e remover o container e seus volumes associados

docker-compose down --volumes

Uso

O endpoint precisa do seguinte token de autenticação:

Authorization: Bearer mock-valid-token

O serviço é executado na porta 8000

Endpoint disponível

/api/movements/:id/ranking

:id é um identificador numérico do movimento desejado.

Exemplo de requisição:

curl -H "Authorization: Bearer mock-valid-token" http://localhost:8000/api/movements/1/ranking

Considerações finais

A autenticação JWT completa e o controle de acesso baseado em funções não foram implementados para evitar um aumento na complexidade do banco de dados. Isso foi feito para preservar o esquema original, permitindo sua reconstrução sem depender exclusivamente do volume do Docker.

No entanto, a estrutura básica para essa funcionalidade foi mantida, permitindo futuras extensões sem a necessidade de uma reestruturação significativa.

About

Skylab technical testbed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages