{"id":15552784,"url":"https://github.com/bahmutov/verify-code-example","last_synced_at":"2025-09-28T23:31:34.361Z","repository":{"id":38849056,"uuid":"400536239","full_name":"bahmutov/verify-code-example","owner":"bahmutov","description":"Example web application with MySQL database to verify the user phone number","archived":false,"fork":false,"pushed_at":"2024-12-18T05:40:26.000Z","size":1000,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T20:08:04.892Z","etag":null,"topics":["cypress-example"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/bahmutov.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-27T14:28:57.000Z","updated_at":"2023-09-08T18:25:53.000Z","dependencies_parsed_at":"2024-01-17T06:36:05.252Z","dependency_job_id":"e9ab0974-e6a7-4bca-b12c-a9bcb086021a","html_url":"https://github.com/bahmutov/verify-code-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fverify-code-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fverify-code-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fverify-code-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fverify-code-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bahmutov","download_url":"https://codeload.github.com/bahmutov/verify-code-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234571025,"owners_count":18854263,"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":["cypress-example"],"created_at":"2024-10-02T14:22:14.641Z","updated_at":"2025-09-28T23:31:33.844Z","avatar_url":"https://github.com/bahmutov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# verify-code-example [![ci status][ci image]][ci url] [![renovate-app badge][renovate-badge]][renovate-app] ![cypress version](https://img.shields.io/badge/cypress-8.3.1-brightgreen)\n\n\u003e Example web application with MySQL database to verify the user phone number\n\n## Blog posts\n\nThis example was used in the following blog posts\n\n- [How To Verify Phone Number During Tests Part 1](https://glebbahmutov.com/blog/verify-phone-part-one/) shows how to use a test phone prefix\n- [How To Verify Phone Number During Tests Part 2](https://glebbahmutov.com/blog/verify-phone-part-two/) shows how to query MySQL database from the test\n\n## Install\n\n```bash\n$ npm install\n# should install the web application dependencies\n# then switch to the \"api\" folder and install its dependencies\n# if this does not happen, run yourself:\n$ cd api\n$ npm install\n```\n\nNote that the [api](./api) folder has its own [package.json](./api/package.json) file with its own dependencies, including the `mysql` module that allows Cypress here to connect and query the MySQL database.\n\n## Start\n\nYou can start the API and the web application using two terminals:\n\n```bash\n# starts the web application\n$ npm run dev\n# from another terminal start the API\n$ npm run dev:api\n```\n\n**Note:** to connect to the database, the API requires certain environment variable or `.env` file, see the [API README](./api/README.md).\n\nThen from the third terminal open Cypress\n\n```bash\n$ npm run cy:open\n```\n\n### Start all\n\nAlternatively, you can start the application, the api, and open Cypress using a single command that uses [start-server-and-test](https://github.com/bahmutov/start-server-and-test) utility.\n\n```bash\n$ npm run cy\n```\n\nIf everything starts correctly, you should see Cypress Desktop GUI window.\n\n![The app, api, and Cypress started](./images/cy.png)\n\n## Tests\n\nFind the end-to-end tests in the folder [cypress/integration](./cypress/integration). Read the blog posts linked above for details.\n\n## Small print\n\nAuthor: Gleb Bahmutov \u0026lt;gleb.bahmutov@gmail.com\u0026gt; \u0026copy; 2021\n\n- [@bahmutov](https://twitter.com/bahmutov)\n- [glebbahmutov.com](https://glebbahmutov.com)\n- [blog](https://glebbahmutov.com/blog)\n\nLicense: MIT - do anything with the code, but don't blame me if it does not work.\n\nSupport: if you find any problems with this module, email / tweet /\n[open issue](https://github.com/bahmutov/verify-code-example/issues) on Github\n\n## MIT License\n\nCopyright (c) 2021 Gleb Bahmutov \u0026lt;gleb.bahmutov@gmail.com\u0026gt;\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\n[ci image]: https://github.com/bahmutov/verify-code-example/workflows/ci/badge.svg?branch=main\n[ci url]: https://github.com/bahmutov/verify-code-example/actions\n[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg\n[renovate-app]: https://renovateapp.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Fverify-code-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahmutov%2Fverify-code-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Fverify-code-example/lists"}