Skip to content
Draft
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
44 changes: 44 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# AGENTS.md

## Cursor Cloud specific instructions

This is a Spring Boot 4 (Java 17, runs on JDK 21) REST API — "Sistema de Eventos
Acessíveis" — backed by PostgreSQL. It is a single service. Standard commands live
in `pom.xml` / the Maven wrapper; see `README.md` for the product overview.

### Services / dependencies
- **App**: single Spring Boot service, listens on **port 8081** (see
`src/main/resources/application.properties`).
- **PostgreSQL 16** is required to build, test, and run — the app connects at
startup and Hibernate creates the schema (`spring.jpa.hibernate.ddl-auto=update`).
System packages (JDK 21, Maven, PostgreSQL) are already provisioned in the VM;
the update script only refreshes Maven dependencies.

### Starting PostgreSQL (not automatic on boot)
PostgreSQL does not auto-start in the VM. Start it before building/testing/running:
```bash
sudo pg_ctlcluster 16 main start
```
The app expects DB `eventos_db`, user `postgres`, password `Jv374315.` (hardcoded
in `application.properties`). If the cluster is freshly provisioned, ensure the
role password and database exist:
```bash
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'Jv374315.';"
sudo -u postgres psql -c "CREATE DATABASE eventos_db;" # ignore error if it already exists
```

### Build / test / run
- Build: `mvn -DskipTests clean compile`
- Test: `mvn test` — note `EventosApplicationTests` uses `@SpringBootTest` and loads
the full context, so **PostgreSQL must be running** for tests to pass.
- Run (dev): `mvn spring-boot:run`

### Verifying the API
- Swagger UI: http://localhost:8081/swagger-ui/index.html
- OpenAPI JSON: http://localhost:8081/v3/api-docs
- Example smoke test:
```bash
curl -X POST http://localhost:8081/participantes \
-H "Content-Type: application/json" \
-d '{"nome":"Maria Silva","email":"maria.silva@example.com"}'
```