How rparit-stacks/formfree works
Project Type and Purpose
• This is a Spring Boot–based REST API (“FormFree”) for dynamic form creation and submission.
• Key capabilities: project creation (with API key), form submission, submission retrieval, and health checking.
Main Architectural Layers (Left to Right)
• FormController
– POST /api/create-project
– POST /api/form/submit/{apiKey}
– GET /api/form/result/{projectId}
• Health
– GET /api/health
• FormService
– Handles business logic for creating projects, validating API keys, processing submissions, retrieving results.
• ProjectRepository (CRUD on Project entities)
• SubmissionsRepository (CRUD on FromSubmission entities)
• Underlying relational database (e.g., H2, MySQL, PostgreSQL) used by Spring Data JPA
Optional/Supporting Components
– Projects.java
– FromSubmission.java
• DTOs (Data Transfer Objects)
– e.g., ProjectCreationRequest, FormSubmissionRequest, ProjectResponse
– @ControllerAdvice class to catch validation errors, invalid API key, not found errors
1. Client → Controller: HTTP request
2. Controller → Service: call business method
3. Service → Repository: save or fetch data
4. Repository → Database: SQL operations
5. Database → Repository → Service → Controller → Client: response path
6. On errors: Service throws exception → Exception Handler intercepts → Controller returns error response