From 070bc8e5750167bd250e47f0b3dd33eb31174eeb Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 12 Jul 2026 06:34:58 +0000 Subject: [PATCH] docs: add AGENTS.md with Cursor Cloud dev environment instructions Co-authored-by: JClemente-web --- AGENTS.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..f14038a --- /dev/null +++ b/AGENTS.md @@ -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"}' + ```