Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mariadb
DB_HOST=127.0.0.1
DB_HOST=ranqueamento_mariadb
DB_PORT=3306
DB_DATABASE=ranqueamento
DB_USERNAME=admin
DB_PASSWORD=admin
DB_USERNAME=ranqueamento
DB_PASSWORD=ranqueamento

SESSION_DRIVER=database
SESSION_LIFETIME=120
Expand All @@ -36,7 +36,7 @@ SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
QUEUE_CONNECTION=sync

CACHE_STORE=database
CACHE_PREFIX=
Expand All @@ -48,9 +48,9 @@ REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=log
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Expand All @@ -71,15 +71,29 @@ SENHAUNICA_CALLBACK_ID=
SENHAUNICA_ADMINS=
SENHAUNICA_CODIGO_UNIDADE=8

# senha unica faker
SENHAUNICA_KEY=faker
SENHAUNICA_SECRET=faker
SENHAUNICA_CALLBACK_ID=1
SENHAUNICA_ADMINS=1111
SENHAUNICA_DEV="http://auth.local:3141/wsusuario/oauth"
SENHAUNICA_USAR_REPLICADO=false

REPLICADO_HOST=
REPLICADO_PORT=
REPLICADO_DATABASE=
REPLICADO_USERNAME=
REPLICADO_PASSWORD=
REPLICADO_CODUNDCLG=
REPLICADO_SYBASE=

USP_THEME_SKIN=fflch
REPLICADO_FAKE=1

LARAVEL_TOOLS_FORCAR_HTTPS=false
LARAVEL_TOOLS_DEBUG=false

APP_URL=http://ranqueamento
DUSK_DRIVER_URL='http://selenium:4444/wd/hub'
DUSK_START_MAXIMIZED=true
DUSK_HEADLESS_DISABLED=true

USP_THEME_SKIN=fflch
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ yarn-error.log
/.idea
/.vscode
/.zed

/.phpunit.cache
public/vendor
.env.dusk.local
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM uspdev/uspdev-php-apache:8.3

RUN sed -i 's|/var/www/html|/var/www/html/public|' \
/etc/apache2/sites-available/000-default.conf

USER www-data

COPY --chown=www-data . .

RUN composer install \
--no-dev \
--optimize-autoloader \
--no-interaction

CMD ["apache2-foreground"]
96 changes: 95 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## ranqueamento
# ranqueamento

Sistema para ranqueamento das habilitações do curso de letras

Expand All @@ -7,3 +7,97 @@ Falta verificar para reranqueamento:
- Alunos com trancamento total podem ou não participarem
- pegar exemplo de alunos com mais de 8 créditos que não poderiam participar

## Instalação

### 1. Clone o repositório

```bash
git clone LINK

cd ranqueamento
```

### 2. Build da imagem Docker

```bash
docker build --no-cache -t ranqueamento .
```

### 3. Configure o ambiente

```bash
cp .env.example .env
```

Edite o `.env` e ajuste as variáveis necessárias, especialmente:

```env
DB_HOST=mariadb # nome do serviço no docker-compose
DB_DATABASE=ranqueamento
DB_USERNAME=ranqueamento
DB_PASSWORD=ranqueamento

SENHAUNICA_KEY= # credenciais da Senha Única USP
SENHAUNICA_SECRET=
SENHAUNICA_CALLBACK_ID=
SENHAUNICA_ADMINS= # número(s) USP dos administradores
```

### 4. Suba os containers

```bash
docker compose up -d
```

### 5. Gere a chave da aplicação

```bash
docker exec -it ranqueamento php artisan key:generate
```

### 6. Execute as migrations

```bash
docker exec -it ranqueamento php artisan migrate
```

A aplicação estará disponível em **http://127.0.0.1:8000**.

---

## Testes com Dusk

### 1. Crie o banco de dados de testes

```bash
docker compose exec mariadb mariadb -u root -pranqueamento \
-e "CREATE DATABASE IF NOT EXISTS ranqueamento_dusk;"

docker compose exec mariadb mariadb -u root -pranqueamento \
-e "GRANT ALL PRIVILEGES ON ranqueamento_dusk.* TO 'ranqueamento'@'%'; FLUSH PRIVILEGES;"
```

### 2. Configure o ambiente Dusk

```bash
cp .env.dusk.local.example .env.dusk.local
```

Edite o `.env.dusk.local` e cole o valor de `APP_KEY` do seu `.env`:

```env
APP_KEY= # copie do seu .env
```

### 3. Instale o Dusk

```bash
docker exec -it ranqueamento composer require --dev laravel/dusk
docker exec -it ranqueamento php artisan dusk:install
```

### 4. Execute os testes

```bash
docker exec -it ranqueamento php artisan dusk
```
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/dusk": "^8.6",
"laravel/pail": "^1.1",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
Expand Down
Loading
Loading