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.
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)
Clone the repository with
git clone https://gitlab.com/Mevryk/skylab.git
cd skylab
Before pulling or pushing images to the GitLab Container Registry, authenticate using:
docker login registry.gitlab.comUse your GitLab username and Personal Access Token (PAT) instead of your password. To generate a PAT, refer to this guide.
Run the following commands to pull and start the container:
docker-compose pull
docker-compose up -dTo verify the container is running:
docker psTo stop and remove the container along with associated volumes:
docker-compose down --volumesThe 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/rankingJWT 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.
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)
git clone https://gitlab.com/Mevryk/skylab.git
cd skylabdocker login registry.gitlab.comUse seu usuário do GitLab e um Personal Access Token (PAT) em vez de senha. Para gerar um PAT, consulte este guia.
docker-compose pull
docker-compose up -dVerifique se o container está rodando corretamente:
docker psPara parar e remover o container e seus volumes associados
docker-compose down --volumesO 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/rankingA 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.