Note
This project is a submission.
- Framework: Python/Flask
- Database: MongoDB
- Ensure Docker is installed on your machine.
- Clone the repository:
git clone https://github.com/johnkayode/formplus.git
- Configure environment:
cp .env.template .env
- Build and run the services:
docker-compose up --build
- The API will be running on
http://localhost:5500
Swagger Docs: http://localhost:5500/swagger/ui
Test environment is set up with Github Actions. Run locally by setting up a test database and running the tests:
pytest- Create A New Form:
POST /forms/
Request Body:{ "title": "Sample Form", "description": "Sample Description", "metadata": { "theme": "#000000" }, "quota": 1000, "sections": [ { "title": "Section A", "description": "Description", "fields": [ { "description": "", "field_type": "short_text", "label": "First Name", "required": true }, { "description": "", "field_type": "short_text", "label": "Last Name", "required": true }, { "description": "Gender", "field_type": "dropdown", "label": "Gender", "options": ["Male", "Female", "Other"], "required": true } ] } ] } - Submit response to a form:
POST /forms/{form-id}/submit
Request Body:{ "sections": { "section_id": { "field_id_1": "Dwight", "field_id_2": "Shrute", "field_id_3": 0 } } }