Skip to content

mahsahakimi/form_manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Form Builder API Documentation

This document describes the REST API for managing forms and their fields.

Base URL

http://localhost:8080/forms

Endpoints

Method Path Description Request Body
GET / Retrieves a list of all forms. None
POST / Creates a new form. Form object (without id). Example:
{"name": "New Form", "published": false}
GET /{id} Retrieves a specific form by its ID. None
PUT /{id} Updates an existing form by its ID. Form object (without id). Example:
{"name": "Updated Form Name", "published": true}
DELETE /{id} Deletes a form by its ID. None
GET /{id}/fields Retrieves fields of a specific form by its ID. None
PUT /{id}/fields Updates fields of a specific form by its ID. Array of Field objects (include id for updates, omit for new fields). Example:
[
{
"id": 1,
"name": "Updated Field Name",
"label": "Updated Label",
"type": "TEXT",
"defaultValue": "New Value"
},
{
"name": "New Field",
"label": "New Label",
"type": "NUMBER",
"defaultValue": "0"
}
]
POST /{id}/publish Toggles form's publication status. None
GET /published Retrieves all published forms. None

Usage

1. Database Setup

  • Install and configure a PostgreSQL database server.
  • Update the application.properties file (located in src/main/resources) with your database connection details (host, port, username, password, etc.).

2. Run the Application

  • Ensure you have Maven installed.
  • Run the application:
    • Open a terminal and navigate to your project's root directory.
    • Run mvn spring-boot:run.
  • Alternatively, run the main class (src/main/java/edu/sharif/web/Main.java) directly in your IDE.

About

This project is a Spring Boot backend designed to manage dynamic forms. It provides a RESTful API for creating, retrieving, updating, and deleting forms and their associated fields.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages