{"id":16998350,"url":"https://github.com/nguyenhongthe/contact_form_api","last_synced_at":"2026-05-09T17:34:43.260Z","repository":{"id":234404434,"uuid":"788496532","full_name":"nguyenhongthe/contact_form_api","owner":"nguyenhongthe","description":"This is an API based on FastAPI designed to send contact forms via SMTP and Discord Webhooks, then receive notifications through Email and Discord, while also storing the information in PostgreSQL.","archived":false,"fork":false,"pushed_at":"2024-09-23T11:21:43.000Z","size":35,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-20T23:32:54.884Z","etag":null,"topics":["contact","contact-api","contact-form","discord-webhook","fastapi","postgresql","pydantic-settings","python-multipart","python3","smtp","smtplib","sqlalchemy"],"latest_commit_sha":null,"homepage":"https://nhtdev-contact-api.vnscdn.com/api/redoc","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nguyenhongthe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-18T14:27:48.000Z","updated_at":"2025-01-09T19:32:27.000Z","dependencies_parsed_at":"2024-07-08T22:27:26.933Z","dependency_job_id":"357b9810-f8df-4ba7-92c2-ca51b22ddde3","html_url":"https://github.com/nguyenhongthe/contact_form_api","commit_stats":null,"previous_names":["nguyenhongthe/contact_form_api"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenhongthe%2Fcontact_form_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenhongthe%2Fcontact_form_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenhongthe%2Fcontact_form_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenhongthe%2Fcontact_form_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nguyenhongthe","download_url":"https://codeload.github.com/nguyenhongthe/contact_form_api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246209541,"owners_count":20741068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contact","contact-api","contact-form","discord-webhook","fastapi","postgresql","pydantic-settings","python-multipart","python3","smtp","smtplib","sqlalchemy"],"created_at":"2024-10-14T04:04:57.759Z","updated_at":"2026-05-09T17:34:38.227Z","avatar_url":"https://github.com/nguyenhongthe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contact Form API\n\nThis is FastAPI-based API is designed for submitting contact forms and receiving notifications. Follow the instructions below to install and use the API.\n\n## Table of Contents\n\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Configuration](#configuration)\n- [License](#license)\n\n## Features\n\n- Submit contact forms with the following fields:\n  - Name\n  - Email\n  - Phone\n  - Title\n  - Message\n- Send email notifications to the recipient using an SMTP server\n- Send Discord notifications to a Discord webhook\n- Store contact form submissions in a PostgreSQL database\n- API documentation using Swagger UI and ReDoc\n\n## Requirements\n\n- Python 3.8+\n\nThe API is built using the following libraries:\n\n- [FastAPI](https://fastapi.tiangolo.com/) - Web framework\n- [Pydantic](https://pypi.org/project/pydantic-settings/) - Settings management using Pydantic\n- [SQLAlchemy](https://www.sqlalchemy.org/) - Database ORM\n- [PostgreSQL](https://www.postgresql.org/) - Database\n- [Psycopg](https://pypi.org/project/psycopg2-binary/) - psycopg2 - Python-PostgreSQL Database Adapter\n- [smtp](https://docs.python.org/3/library/smtplib.html) - Email sending\n- [uvicorn](https://www.uvicorn.org/) - ASGI server\n- [python-dotenv](https://pypi.org/project/python-dotenv/) - Environment variables\n- [httpx](https://www.python-httpx.org/) - HTTP client\n- [Discord Webhooks](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) - Discord Webhooks\n\n## Installation\n\n### Running Locally\n\nTo run the API locally, follow these steps:\n\n**Note:**\n\n   - Make sure you have Python 3.8+ installed on your system.\n   - You need to have a PostgreSQL database running on your system and create a database for the API. Refer to the [PostgreSQL documentation](https://www.postgresql.org/docs/) for more information.\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/nguyenhongthe/contact_form_api.git\n   cd contact_form_api\n   ```\n\n2. Install the required dependencies:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. Create a `.env` file in the root directory and set the necessary environment variables. Refer to the `.env.example` file for guidance.\n\n4. Run the API server:\n\n   ```bash\n   uvicorn main:app --host 0.0.0.0 --port 8000 --reload\n   ```\n\nThe API should now be up and running at http://localhost:8000.\n\n## Usage\n\nAPI documentation can be accessed through the following URLs:\n\n- Swagger UI - [http://localhost:8000/api/docs](http://localhost:8000/api/docs)\n- ReDoc - [http://localhost:8000/api/redoc](http://localhost:8000/api/redoc)\n- OpenAPI JSON - [http://localhost:8000/api/openapi.json](http://localhost:8000/api/openapi.json)\n\n### Submitting a Contact Form\n\nTo submit a contact form, send a POST request to the `/submit-contact-form` endpoint with the following form parameters:\n\n- `name`: Name of the sender\n- `email`: Email of the sender\n- `phone`: Phone number of the sender\n- `title`: Title of the message\n- `message`: Message content\n\nExample using cURL:\n\n```bash\ncurl -X 'POST' \\\n  'http://localhost:8000/submit-contact-form' \\\n  -H 'accept: application/json' \\\n  -H 'Content-Type: application/x-www-form-urlencoded' \\\n  -d 'name=My%20Name\u0026email=myname%40gmail.com\u0026phone=0123456789\u0026title=Hello\u0026message=Hello%20World'\n```\n\n## Configuration\n\nThe application uses environment variables for configuration. Make sure to define these variables in the `.env` file before running the application. Refer to the `.env.example` file for a list of required variables.\n\nFor detailed configuration options, consult the `Settings` class in the `main.py` file.\n\n## Contributing\n\nContributions are welcome! Feel free to [open an issue](https://github.com/nguyenhongthe/contact_form_api/issues) or submit a [pull request](https://github.com/nguyenhongthe/contact_form_api/pulls) if you find a bug or want to improve the API.\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](LICENSE) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnguyenhongthe%2Fcontact_form_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnguyenhongthe%2Fcontact_form_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnguyenhongthe%2Fcontact_form_api/lists"}