Backend service for property inspection platform. Handles user authentication, professional profiles, credential verification, and subscription-based feature access.
- Java 21 with Spring Boot 4.0.1
- PostgreSQL 16 - Primary database
- Redis 7 - Session management and caching
- Docker & Docker Compose - Containerization
- JWT - Authentication (15min access + 7day refresh tokens)
- BCrypt - Password hashing (cost factor 12)
- Docker & Docker Compose installed
- Port 8080, 5433, 6379 available
# Clone repository
git clone https://github.com/AngeloMancilla/InspectPro.git
cd InspectPro
# Start all services (PostgreSQL + Redis + App)
docker compose up -d
# Wait ~30 seconds for app to start
docker compose logs -f app
# Verify it's running
curl http://localhost:8080/api/v1/auth/register -X POST \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"Test1234","displayName":"Test User"}'The application will be available at http://localhost:8080
Swagger UI is available at: http://localhost:8080/swagger-ui.html
Features:
- Try all endpoints interactively
- View request/response schemas
- JWT authentication support (click "Authorize" button)
Quick test:
- Go to
http://localhost:8080/swagger-ui.html - Try
POST /api/v1/auth/registerto create a user - Copy the
accessTokenfrom response - Click "Authorize" button (top right) and paste token
- Now you can test authenticated endpoints
POST /api/v1/auth/register- Create user + default BASIC profilePOST /api/v1/auth/login- Login and get JWT tokensPOST /api/v1/auth/refresh- Refresh access tokenPOST /api/v1/auth/logout- Revoke refresh token
GET /api/v1/profiles/me- Get current active profilePUT /api/v1/profiles/me- Update current profileGET /api/v1/profiles- List all user profilesPOST /api/v1/profiles- Create new profilePOST /api/v1/profiles/switch/{profileId}- Switch active profile contextPOST /api/v1/profiles/{id}/upgrade- Upgrade to VERIFIED_PROFESSIONALPOST /api/v1/profiles/{id}/downgrade- Downgrade to BASIC
POST /api/v1/credentials- Submit credential for reviewGET /api/v1/credentials- List credentials for current profileGET /api/v1/credentials/{id}- Get credential detailsPOST /api/v1/credentials/{id}/approve- Approve credential (admin)POST /api/v1/credentials/{id}/reject- Reject credential (admin)DELETE /api/v1/credentials/{id}- Delete credential
GET /api/v1/subscriptions/current- Get active subscriptionPOST /api/v1/subscriptions/check-feature- Check feature accessPOST /api/v1/subscriptions/webhooks/stripe- Stripe webhook handler
- BASIC - Default profile for all users
- VERIFIED_PROFESSIONAL - Requires ≥2 approved credentials
PENDING→APPROVED/REJECTED→EXPIRED- Credentials auto-expire based on
expiresAtdate - Grace period: VP keeps status if renewal is PENDING
- 2:00 AM UTC - Expire credentials past expiresAt date
- 3:00 AM UTC - Downgrade VP profiles without active/pending credentials
See DECISIONS.md for:
- Challenge A: Profile context switching (Redis-based solution)
- Challenge B: Credential expiration grace period
- Challenge C: Feature gating edge cases
- Database design rationale
# Start only PostgreSQL and Redis
docker compose up -d postgres redis
# Copy environment template
cp .env.example .env
# Run Spring Boot locally
./mvnw spring-boot:runSee .env.example for all configuration options.
Key variables:
SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5433/inspectpro
SPRING_DATASOURCE_USERNAME=postgres
SPRING_DATASOURCE_PASSWORD=postgres
SPRING_DATA_REDIS_HOST=localhost
SPRING_DATA_REDIS_PORT=6379
JWT_SECRET=your-256-bit-secret-key-change-this-in-productionusers
├── id (PK)
├── email (unique)
├── password_hash
└── created_at
profiles
├── id (PK)
├── user_id (FK)
├── display_name
├── type (BASIC | VERIFIED_PROFESSIONAL)
└── created_at
credentials
├── id (PK)
├── profile_id (FK)
├── type (HVAC_LICENSE | EPA_CERTIFICATION | INSURANCE | STATE_LICENSE)
├── status (PENDING | APPROVED | REJECTED | EXPIRED)
├── expires_at
└── created_at
subscriptions
├── id (PK)
├── user_id (FK)
├── tier (BASIC | ENHANCED | PROFESSIONAL)
├── status
└── expires_at
# Run tests
./mvnw test
# Build without tests
./mvnw clean package -DskipTestssrc/main/java/com/_9/inspect_pro/
├── controller/ # REST endpoints
├── service/ # Business logic
├── repository/ # JPA repositories
├── model/ # Domain entities
├── security/ # JWT & authentication
├── scheduler/ # Scheduled jobs
├── dto/ # Request/Response objects
├── exception/ # Custom exceptions
└── config/ # Configuration classes
# Check logs
docker compose logs app
# Restart services
docker compose restart# Stop all services
docker compose down
# Change ports in docker-compose.yml if needed# Check PostgreSQL is healthy
docker compose ps postgres
# Reset database
docker compose down -v
docker compose up -d© 2025 - 309 Technology Inc