Skip to content

Commit ef58c52

Browse files
authored
Merge branch 'main' into 1-feat-create-frontend-api-to-connect-frontend-and-backend-for-form-templates
2 parents 9b248cb + 4b9c162 commit ef58c52

6 files changed

Lines changed: 263 additions & 2 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Description
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] This change requires a documentation update
15+
16+
## How Has This Been Tested?
17+
18+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
19+
20+
- [ ] Test A
21+
- [ ] Test B
22+
23+
**Test Configuration**:
24+
* Firmware version:
25+
* Hardware:
26+
* SDK:
27+
28+
## Checklist:
29+
30+
- [ ] My code follows the style guidelines of this project
31+
- [ ] I have performed a self-review of my own code
32+
- [ ] I have commented my code, particularly in hard-to-understand areas
33+
- [ ] I have made corresponding changes to the documentation
34+
- [ ] My changes generate no new warnings
35+
- [ ] I have added tests that prove my fix is effective or that my feature works
36+
- [ ] New and existing unit tests pass locally with my changes
37+
- [ ] Any dependent changes have been merged and published in downstream modules

CITATION.cff

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
authors:
4+
- family-names: "Álvarez Sánchez"
5+
given-names: "Juan"
6+
- family-names: "Carriedo Garrido"
7+
given-names: "Manuel"
8+
- family-names: "Harkins"
9+
given-names: "Vincent"
10+
- family-names: "Vergés Santiago"
11+
given-names: "Marc"
12+
- family-names: "Sans Domingo"
13+
given-names: "Jan"
14+
title: "FireForm"
15+
version: 1.0.0
16+
url: "https://github.com/juanalvv/FireForm"
17+
abstract: "FireForm is a Digital Public Good (DPG) designed to solve administrative overhead for first responders by automating PDF form filling using AI."
18+
keywords:
19+
- "firefighter"
20+
- "first responder"
21+
- "AI"
22+
- "automated reporting"
23+
- "digital public good"
24+
license: MIT

CODE_OF_CONDUCT.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and unwelcome sexual attention
31+
or advances
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsibles.
63+
All complaints will be reviewed and investigated promptly and fairly.
64+
65+
All community leaders are obligated to respect the privacy and security of the
66+
reporter of any incident.
67+
68+
## Enforcement Guidelines
69+
70+
Community leaders will follow these Community Impact Guidelines in determining
71+
the consequences for any action they deem in violation of this Code of Conduct:
72+
73+
### 1. Correction
74+
75+
**Community Impact**: Use of inappropriate language or other behavior deemed
76+
unprofessional or unwelcome in the community.
77+
78+
**Consequence**: A private, written warning from community leaders, providing
79+
clarity around the nature of the violation and an explanation of why the
80+
behavior was inappropriate. A public apology may be requested.
81+
82+
### 2. Warning
83+
84+
**Community Impact**: A violation through a single incident or series of
85+
actions.
86+
87+
**Consequence**: A warning with consequences for continued behavior. No
88+
interaction with the people involved, including unsolicited interaction with
89+
those enforcing the Code of Conduct, for a specified period of time. This
90+
includes avoiding interactions in community spaces as well as external channels
91+
like social media. Violating these terms may lead to a permanent ban.
92+
93+
### 3. Harassment
94+
95+
**Community Impact**: A serious violation of community standards, including
96+
sustained harassing behavior.
97+
98+
**Consequence**: A temporary ban from any sort of interaction or public
99+
communication with the community for a specified period of time. No unsolicited
100+
interaction with the people involved, including unsolicited interaction with
101+
those enforcing the Code of Conduct, is allowed. Violating these terms may lead
102+
to a permanent ban.
103+
104+
### 4. Suspension
105+
106+
**Community Impact**: A violation of community standards that is either
107+
extremely severe or part of a pattern of behavior.
108+
109+
**Consequence**: A permanent ban from any sort of public interaction within the
110+
community.
111+
112+
## Attribution
113+
114+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
115+
version 2.1, available at
116+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
117+
118+
Community Impact Guidelines were inspired by
119+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
120+
121+
For answers to common questions about this code of conduct, see the FAQ at
122+
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
123+
[https://www.contributor-covenant.org/translations][translations].
124+
125+
[homepage]: https://www.contributor-covenant.org
126+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
127+
[Mozilla CoC]: https://github.com/mozilla/active-participation/blob/master/Code-of-Conduct-Enforcement-Ladder.md
128+
[faq]: https://www.contributor-covenant.org/faq
129+
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing to FireForm
2+
3+
First of all, thank you for considering contributing to FireForm! It's people like you that make FireForm a great tool for first responders.
4+
5+
FireForm is a Digital Public Good (DPG) designed to reduce administrative overhead for firefighters and other emergency services. By contributing, you are helping us build a more efficient future for emergency response.
6+
7+
>**NOTE: Before you contribute!**
8+
>Please note that this project is still under early development. Because of this you may find many bugs caused either by cases yet unaddressed that we are aware of. Reports on these bugs will be dismissed to remove clutter, so please don't feel discouraged if your issue is dismissed quickly, it just means we were already aware of the bug.
9+
10+
## 🌈 Code of Conduct
11+
12+
This project and everyone participating in it is governed by the [FireForm Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to juanalvarez_san@protonmail.com.
13+
14+
## 🚀 How Can I Contribute?
15+
16+
### Reporting Bugs
17+
18+
Before creating bug reports, please check the [issues list](https://github.com/juanalvv/FireForm/issues) to see if the problem has already been reported.
19+
20+
When you are creating a bug report, please include as many details as possible:
21+
* **Use a clear and descriptive title** for the issue to identify the problem.
22+
* **Use the bug report template** to ensure you include all the necessary information.
23+
* **Describe the exact steps which reproduce the problem** in as many details as possible.
24+
* **Explain which behavior you expected to see instead and why.**
25+
* **Include screenshots** if applicable.
26+
27+
### Suggesting Enhancements
28+
29+
If you have a great idea for FireForm, we'd love to hear it! Please open an issue and include:
30+
* **A clear and descriptive title.**
31+
* **A step-by-step description of the suggested enhancement** in as many details as possible.
32+
* **Explain why this enhancement would be useful** to the users.
33+
34+
### Pull Requests
35+
36+
1. Fork the repo and create your branch from `main`.
37+
2. If you've added code that should be tested, add tests.
38+
3. Ensure the test suite passes.
39+
4. Make sure your code lints.
40+
5. Issue that pull request!
41+
42+
## 🛠️ Local Development Setup
43+
44+
FireForm uses Docker and Docker Compose for development to ensure a consistent environment.
45+
46+
### Prerequisites
47+
48+
- [Docker](https://docs.docker.com/get-docker/)
49+
- [Docker Compose](https://docs.docker.com/compose/install/)
50+
- `make` (optional, but recommended)

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,31 @@ The result is hours of time saved per shift, per firefighter.
2424

2525
Open-Source (DPG): Built 100% with open-source tools to be a true Digital Public Good, freely available for any department to adopt and modify.
2626

27+
## 🤝 Code of Conduct
28+
29+
We are committed to providing a friendly, safe, and welcoming environment for all. Please see our [Code of Conduct](CODE_OF_CONDUCT.md) for more information.
30+
31+
## 🚀 Contributing
32+
33+
Contributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) to learn how you can help.
34+
2735
## ⚖️ License
2836

37+
38+
2939
This project is licensed under the MIT License. See the LICENSE file for details.
3040

3141
## 🏆 Acknowledgements and Contributors
3242
This project was built in 48 hours for the Reboot the Earth 2025 hackathon. Thank you to the United Nations and UC Santa Cruz for hosting this incredible event and inspiring us to build solutions for a better future.
3343

44+
## 📜 Citation
45+
46+
If you use FireForm in your research or project, please cite it using the following metadata:
47+
48+
[![Cite this repository](https://img.shields.io/badge/Cite-FireForm-blue.svg)](CITATION.cff)
49+
50+
You can also use the "Cite this repository" button in the GitHub repository sidebar to export the citation in your preferred format.
51+
3452
__Contributors:__
3553
- Juan Álvarez Sánchez (@juanalvv)
3654
- Manuel Carriedo Garrido

src/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def input_fields(num_fields: int):
1111
fields.append(field)
1212
return fields
1313

14-
def run_pdf_fill_process(user_input: str, definitions: list, pdf_form_path: str):
14+
def run_pdf_fill_process(user_input: str, definitions: list, pdf_form_path: Union[str, os.PathLike]):
1515
"""
1616
This function is called by the frontend server.
1717
It receives the raw data, runs the PDF filling logic,
@@ -21,6 +21,9 @@ def run_pdf_fill_process(user_input: str, definitions: list, pdf_form_path: str)
2121
print("[1] Received request from frontend.")
2222
print(f"[2] PDF template path: {pdf_form_path}")
2323

24+
# Normalize Path/PathLike to a plain string for downstream code
25+
pdf_form_path = os.fspath(pdf_form_path)
26+
2427
if not os.path.exists(pdf_form_path):
2528
print(f"Error: PDF template not found at {pdf_form_path}")
2629
return None # Or raise an exception
@@ -77,4 +80,4 @@ def run_pdf_fill_process(user_input: str, definitions: list, pdf_form_path: str)
7780
num_fields = 0
7881

7982
controller = Controller()
80-
controller.fill_form(user_input, fields, file)
83+
controller.fill_form(user_input, fields, file)

0 commit comments

Comments
 (0)