{"id":18056297,"url":"https://github.com/monteiro/phoval","last_synced_at":"2025-10-09T16:04:45.745Z","repository":{"id":61625706,"uuid":"158064412","full_name":"monteiro/phoval","owner":"monteiro","description":"phone validation API to verify phone numbers or do 2FA","archived":false,"fork":false,"pushed_at":"2018-12-07T10:37:54.000Z","size":2922,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T21:05:59.325Z","etag":null,"topics":["2fa","2factor","aws-ses","go","golang","sms-api"],"latest_commit_sha":null,"homepage":"","language":"Go","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/monteiro.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}},"created_at":"2018-11-18T08:37:59.000Z","updated_at":"2023-11-10T16:23:05.000Z","dependencies_parsed_at":"2022-10-19T18:45:45.353Z","dependency_job_id":null,"html_url":"https://github.com/monteiro/phoval","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monteiro%2Fphoval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monteiro%2Fphoval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monteiro%2Fphoval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monteiro%2Fphoval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monteiro","download_url":"https://codeload.github.com/monteiro/phoval/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318721,"owners_count":20919483,"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":["2fa","2factor","aws-ses","go","golang","sms-api"],"created_at":"2024-10-31T01:14:34.404Z","updated_at":"2025-10-09T16:04:40.694Z","avatar_url":"https://github.com/monteiro.png","language":"Go","readme":"# Phone validation API using Go\n\n[![Build Status](https://travis-ci.org/monteiro/phoval.svg?branch=master)](https://travis-ci.org/monteiro/phoval)\n\n## Motivation\n\nEvery business has the need to verify phone numbers in order to guarantee that they exist or in case we need to contact a specific customer or send a marketing SMS.\nThe goal with this tool is to allow all businesses to deploy this solution in-house.\n\n## Install\n\nTesting locally:\n\n```\nmake docker-up \nmake migrate\n```\n\nYou can now call the API using curl or any other tool.\n\nIt will instantiate 2 containers (one _MySQL_ and one executing the binary with the tool in development mode).\nIn **Development mode** you can test the API and see the results in the output of `docker-compose`:\n\n```\nphovalapp_1_d00e1ca2feb7 | 2018/12/07 09:56:58 172.21.0.1:36848 - \"HTTP/1.1 POST /phone/verification?phone_number=963695658\u0026country_code=351\"\nphovalapp_1_d00e1ca2feb7 | 2018/12/07 09:56:58 SMS was sent: '{351 9611111111 This is your code: 799184\nphovalapp_1_d00e1ca2feb7 |  phoval}'\n``` \n\n## Run the http server on your machine or in production\n\nDefine the following environment variables for _AWS SES_ and _MySQL_ Database configuration:\n\n```\nexport AWS_SDK_LOAD_CONFIG=1\nexport AWS_ACCESS_KEY_ID=XXXXXX\nexport AWS_SECRET_ACCESS_KEY=XXXXXX\nexport AWS_DEFAULT_REGION=XXXXXX\nexport DB_USER=XXXXXX\nexport DB_PASSWORD=XXXXXX\nexport DB_HOST=XXXXXX\nexport DB_PORT=3306\nexport DB_NAME=XXXXXX\n```\n\n```\nmake build\nmake migrate\n./bin/phoval-{linux,mac} or ./bin/phoval-windows.exe {flags}\n```\n\n### Usage\n\n- `addr`: Http network address and port to bind (e.g. 192.168.0.1:4000)\n- `userdb`: database user\n- `passworddb`: database user password\n- `hostdb`: database host\n- `namedb`: database name\n- `env`: environment (\"prod\", \"dev\" or testing) - it will use a different SMS implementation according to the environment value.\n- `brand`: brand name used in the SMS to specify the where it comes (e.g. phoval-brand)\n- `apikey`: api key to protect the service. By default it's `changeme`. Better to change it in production.\n- `template-folder`: template folder where are the SMS templates. Currently it's in `messages` folder.  \n\nExample:\n\n```\nbin/phoval-linux -addr=phoval-app.com:4000 -userdb=myDbUser -passworddb=myDbPassword -hostdb=phovaldb.com -namedb=phoval -env=prod -brand=phoval -apikey=secret -template-folder=/usr/messages/\n```\n\n## API usage\n\nArguments:\n- phone_number (string): phone number \n- country code (string): needs to exist (it does not include the 00 or + as prefix)\n- locale (optional, string): locale used to fetch the right message translation inside `pkg/phoval/messages` (only en locale supported at this moment)\n\n### Create a new phone number verification\n\nPOST `/phone/verification\u0026phone_number=919999999\u0026country_code=351\u0026locale=en`\n\n#### Responses\n\n`204`: Verification was created with success. `verification_id` is in the header.\n\n`400`: There is validation error with the arguments that were passed.\n\n### Phone number validation\n\nPUT `/phone/verification\u0026phone_number=919999999\u0026country_code=351\u0026code=768782`\n\n`204`: Verification was validated with success\n\n`409`: Verification does not exist or Verification exists and it was already validated\n\n### Contribution\n\nHow can you help and contribute to this tool:\n\n- [Creating issues](https://github.com/monteiro/phoval/issues/new) with ideas\n- Creating PRs of those ideas\n\n#### Development environment: \n\nSet the environment variables:\n\n```bash\nexport DB_USER=root\nexport DB_PASSWORD=root\nexport DB_HOST=127.0.0.1\nexport DB_PORT=3306\nexport DB_NAME=verif2fa\n```\n\n```\nmake docker-up\nmake migrate\nmake deps\nmake run\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonteiro%2Fphoval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonteiro%2Fphoval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonteiro%2Fphoval/lists"}