{"id":19924059,"url":"https://github.com/maciejkuran/forms-validation-api","last_synced_at":"2025-07-25T13:35:46.438Z","repository":{"id":181691430,"uuid":"667050270","full_name":"maciejkuran/forms-validation-API","owner":"maciejkuran","description":"Introducing the Lightning Fast Free Form Validation REST API! 🚀 This API effortlessly takes care of all your validation needs! 🎁","archived":false,"fork":false,"pushed_at":"2023-07-21T15:38:06.000Z","size":195,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T00:21:29.740Z","etag":null,"topics":["email-validation","form-validation","forms","password-validation","rest-api","restful-api","validation-api"],"latest_commit_sha":null,"homepage":"https://forms-validation-api.vercel.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maciejkuran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-16T13:30:44.000Z","updated_at":"2023-07-16T19:19:32.000Z","dependencies_parsed_at":"2023-07-16T21:48:48.889Z","dependency_job_id":null,"html_url":"https://github.com/maciejkuran/forms-validation-API","commit_stats":null,"previous_names":["maciejkuran/forms-validation-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciejkuran%2Fforms-validation-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciejkuran%2Fforms-validation-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciejkuran%2Fforms-validation-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciejkuran%2Fforms-validation-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maciejkuran","download_url":"https://codeload.github.com/maciejkuran/forms-validation-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241350558,"owners_count":19948513,"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":["email-validation","form-validation","forms","password-validation","rest-api","restful-api","validation-api"],"created_at":"2024-11-12T22:16:17.222Z","updated_at":"2025-03-01T10:23:59.843Z","avatar_url":"https://github.com/maciejkuran.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Forms Validation API ⚡\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"200\" src=\"/public/icon.png\"\u003e\n\u003c/p\u003e\n\nYou don't have to worry about form validation anymore, and write boilerplate code 😩. This API handles validation out-of-the-box 📦! It's as simple as that.\n\n---\n\n**Current version: 1.0**\n\n🔗 API Base URL: `https://forms-validation-api.vercel.app/api/v1.0`\n\n[🔗 Documentation](https://forms-validation-api.vercel.app)\n\n---\n\n## API Endpoints\n\nThere are 4 endpoints to choose from.\nYou can expect a response with a status code of `400` (if validation failed), and `200` if succeded. More in the examples section.\n\n| Description            | Method | Expected req.body                                            | Endpoint    |\n| ---------------------- | ------ | ------------------------------------------------------------ | ----------- |\n| Validate password      | `POST` | `{password: $value}`                                         | `/password` |\n| Validate email address | `POST` | `{email: $value}`                                            | `/email`    |\n| Sign In Form           | `POST` | `{email: $value, password: $value}`                          | `/sign-in`  |\n| Sign Up Form           | `POST` | `{email: $value, password: $value, confirmPassword: $value}` | `/sign-up`  |\n\n### Validating Only Password 🔑\n\n👉 Endpoint: `/password`\n\nWe check whether the password:\n\n- is not empty,\n- contains at least 8 characters,\n- contains at least 1 digit,\n- contains at least 1 capital letter,\n- contains at least 1 special character.\n\n### Validating Only Email Address 📧\n\n👉 Endpoint: `/email`\n\nWe check whether the email address:\n\n- is not empty,\n- doesn't contain special characters such as `!#$%^\u0026\\*(),?\\\":{}|\u003c\u003e~^+/=`,\n- has no spaces,\n- contains the `@` symbol,\n- does not have an additional `@` in the username portion,\n- does not contain offensive, vulgar, or inappropriate content (example words will not be mentioned here for ethical reasons).\n\n### Sign In Form Validation\n\n👉 Endpoint: `/sign-in`\n\n- validating both: email \u0026 password.\n\n### Sign Up Form Validation\n\n👉 Endpoint: `/sign-up`\n\n- validating: email, password \u0026 password match.\n\n## Example\n\nIn the example provided below, I am validating the user's password. The same analogy applies to each available form of validation.\n\n```\nconst url = 'https://form-validation-api.vercel.app/api';\n\n  const reqConfig = (method: string, body: {}): {} =\u003e {\n    return {\n      method: 'POST',\n      body: JSON.stringify(body),\n      headers: {\n        'Content-Type': 'application/json',\n      },\n    };\n  };\n\n  const validatePassword = async (password: string) =\u003e {\n    try {\n      const res = await fetch(`${url}/password`, reqConfig('POST', { password }));\n      const validationResult = await res.json();\n\n      if (!res.ok) throw new Error(validationResult.error); // if 400 code, 'error' key is available on the response object\n\n      //If we got here, it means that validation is successful\n      console.log(validationResult.success); //if 200 code, 'success' key is available on the res. object\n    } catch (error) {\n      console.log((error as Error).message);\n    }\n  };\n\n```\n\n## Rate Limit Middleware\n\nRate limiting is a strategy employed to restrict network traffic and prevent potential abuse of APIs. Each API route is equipped with its own `rateLimiter` variable, which records the `timestamps` of user requests. That, in essence, summarizes the concept.\n\nThe number of permitted requests per user, per minute for each API route is set at `10`.\n\n## Contribution\n\nHey there, awesome folks! 👋 I am on a mission to make magic happen, and I may need your collaboration superpowers! Let's team up, share ideas, and pool our talents to create something useful 🚀💫. Feel free to `fork` repo and `pull requests` or submit your request via `issues`.\n\n#CollaborationNation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaciejkuran%2Fforms-validation-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaciejkuran%2Fforms-validation-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaciejkuran%2Fforms-validation-api/lists"}