A comprehensive web application that connects customers with junkyards and auto parts sellers, enabling online purchase of used and new car parts from multiple vendors.
- Backend: Spring Boot 3.2.0 with Java 21
- Frontend: Thymeleaf for server-side rendering
- Database: PostgreSQL 15+ with Supabase (production) and local PostgreSQL (development)
- Database Migrations: Flyway
- Caching: Redis (optional)
- Build Tool: Gradle 8.5
- Containerization: Docker & Docker Compose
- Security: Spring Security with role-based access control
- Deployment: Northflank with Supabase database
- Java 21 or higher
- Docker and Docker Compose
- Git
-
Clone the repository
git clone https://github.com/oricha/recicar.git cd recicar -
Start the database and Redis
docker compose up -d # new style -
Run the application
For local development: ./gradlew runLocal For test environment: ./gradlew runTest For production environment: ./gradlew runProd
3. **Run the Cucumber tests**
```bash
- Local: ./gradlew cukeLocalRun
- Remote: ./gradlew cukeRemote
- Access the application
- Application: http://localhost:8080
- Health Check: http://localhost:8080/actuator/health
-
Local Development (local PostgreSQL):
./gradlew runLocal
-
Test Environment (perfil
test+ PostgreSQL en Dokploy o local):- En Dokploy test: Postgres en la misma red;
SPRING_PROFILES_ACTIVE=testyDATABASE_*al servicio interno. - Localmente: credenciales en
.envcomoTEST_DATABASE_*(ver.env.example). ./gradlew runTest
- En Dokploy test: Postgres en la misma red;
-
Production Environment (perfil
prod+ PostgreSQL gestionado):- Credenciales en
.envcomoPROD_DATABASE_URL,PROD_DATABASE_USERNAME,PROD_DATABASE_PASSWORD. ./gradlew runProd
- Credenciales en
En PostgreSQL 15+ muchos usuarios no tienen CREATE en el esquema public. La app en perfil dev usa el esquema recicar: Flyway lo crea (create-schemas) y las migraciones/JPA escriben ahí. Requisito: marketplace_user debe ser dueño de la base (o tener CREATE en la base), por ejemplo:
CREATE DATABASE marketplace_dev OWNER marketplace_user;Si defines DATABASE_URL en .env, añade el esquema en la URL, p. ej.
...?currentSchema=recicar (o ¤tSchema=recicar si ya hay parámetros).
Conéctate como superusuario a marketplace_dev y ejecuta:
GRANT CREATE, USAGE ON SCHEMA public TO marketplace_user;
ALTER SCHEMA public OWNER TO marketplace_user;Script de referencia: docs/postgres-local-dev-setup.sql (ajusta si CREATE USER / CREATE DATABASE ya existen).
- Development DB:
./gradlew flywayMigrateDev - Test DB:
./gradlew flywayMigrateTest - Production DB:
./gradlew flywayMigrateProd
src/
├── main/
│ ├── java/com/recicar/marketplace/
│ │ ├── config/ # Configuration classes
│ │ ├── controller/ # Web controllers
│ │ ├── service/ # Business logic
│ │ ├── repository/ # Data access layer
│ │ ├── entity/ # JPA entities
│ │ └── dto/ # Data transfer objects
│ └── resources/
│ ├── db/migration/ # Flyway database migrations
│ ├── templates/ # Thymeleaf templates
│ └── static/ # Static web assets
Run tests with:
./gradlew test- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License.