{"id":25813348,"url":"https://github.com/wildan3105/express-typescript-postgres-signup-login","last_synced_at":"2026-05-05T14:10:41.627Z","repository":{"id":223604258,"uuid":"757882274","full_name":"wildan3105/express-typescript-postgres-signup-login","owner":"wildan3105","description":"An example of implementations for signup and login flows using express, typescript, JWT, and postgre SQL and deployed on heroku","archived":false,"fork":false,"pushed_at":"2024-05-20T21:04:08.000Z","size":780,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T09:35:25.800Z","etag":null,"topics":["expressjs","heroku","jwt","login","postgresql","signup","typescript"],"latest_commit_sha":null,"homepage":"https://simple-signup-login-078d53a6175d.herokuapp.com/","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/wildan3105.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}},"created_at":"2024-02-15T07:19:12.000Z","updated_at":"2024-02-21T03:20:07.000Z","dependencies_parsed_at":"2024-02-21T05:27:48.263Z","dependency_job_id":"5db2fc5b-f66c-4de2-b8f7-55f2a3378d9d","html_url":"https://github.com/wildan3105/express-typescript-postgres-signup-login","commit_stats":null,"previous_names":["wildan3105/express-typescript-postgres-signup-login"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wildan3105/express-typescript-postgres-signup-login","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wildan3105%2Fexpress-typescript-postgres-signup-login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wildan3105%2Fexpress-typescript-postgres-signup-login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wildan3105%2Fexpress-typescript-postgres-signup-login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wildan3105%2Fexpress-typescript-postgres-signup-login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wildan3105","download_url":"https://codeload.github.com/wildan3105/express-typescript-postgres-signup-login/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wildan3105%2Fexpress-typescript-postgres-signup-login/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267779065,"owners_count":24143176,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["expressjs","heroku","jwt","login","postgresql","signup","typescript"],"created_at":"2025-02-28T02:37:47.568Z","updated_at":"2025-10-16T03:16:11.917Z","avatar_url":"https://github.com/wildan3105.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Express typescript postgres signup login\n\n### Tech stacks\n\n-   Language: TypeScript\n-   Framework: ExpressJS\n-   Database: PostgreSQL\n-   Auth: JSON web token (JWT)\n\n### [WIP] Features\n\n-   [x] Sign up\n-   [x] Verify email (sent via elastic email)\n-   [x] Login using JWT token\n-   [x] See logged user's profile\n-   [x] [Swagger UI](https://simple-signup-login-078d53a6175d.herokuapp.com/api-docs)\n\n## How to run\n\n### System requirement\n\n1. Node \u003e= 18.0.0\n2. NPM \u003e= 9.5.0\n3. Postgres \u003e= 12.0.0\n\n### Running locally\n\n**Prerequisites**\n\n1. Clone the project: `git clone git@github.com:wildan3105/express-typescript-postgres-signup-login.git`\n2. Install dependencies: `npm i`\n3. Copy the environment variable and adjust the value accordingly: `cp .env.example .env`\n4. Create a postgre user and then database in which you have full access to that DB (could [create extension](./src/libs/typeorm/migrations/1691117052407-create-user-table.ts#L5-L6)). And then specify the credentials in the `.env` file as `DATABASE_URL`\n\n```bash\nDATABASE_URL='postgres://user:password@host:port/database'\n```\n\n#### Using TypeScript (simulate development)\n\n1. Run the server `npm run start` (it will watch any `TS` file changes and re-spawn it automatically)\n\n#### Using JavaScript (simulate production)\n\n1. Build to JS files: `npm run build`\n2. Run the JS file: `node builds/src/server.js`\n\n#### Using docker\n\nTBD\n\n## Testing\n\n### Code format\n\n```bash\nnpm run format:check -\u003e to check format\nnpm run format -\u003e to automatically format the code\n```\n\n### Linter\n\n```bash\nnpm run lint -\u003e to check the lint error (prevent bugs early)\nnpm run lint:fix -\u003e to fix the lint error if it's fixable\n```\n\n### Test\n\n#### Integration test\n\nStill WIP\n\n#### Unit test\n\n```bash\nnpm run test\n```\n\n#### Postman test\n\nPlease go [here](./postman/)\n\n### Project structure\n\n#### Folder tree\n\n```md\n├── docs\n│   └── openapi.yaml\n├── postman\n├── src\n│   ├── app.ts\n│   ├── cmd\n│   │   └── generate-error-map\n│   │   ├── index.ts\n│   │   └── schema-http-code.json\n│   ├── config.ts\n│   ├── controllers\n│   │   ├── healthcheck.ts\n│   │   ├── middlewares\n│   │   │   ├── auth.ts\n│   │   │   └── handle-error-code.ts\n│   │   └── user.ts\n│   ├── db-connect.ts\n│   ├── domain\n│   │   ├── errors.ts\n│   │   ├── standard-error.ts\n│   │   ├── user-entity.ts\n│   │   ├── user-login.ts\n│   │   └── user-verification-code-entity.ts\n│   ├── events\n│   │   ├── index.ts\n│   │   └── listeners\n│   │   └── user-event.ts\n│   ├── init.ts\n│   ├── interfaces\n│   │   ├── user-verification-code.ts\n│   │   └── user.ts\n│   ├── libs\n│   │   ├── env\n│   │   │   └── index.ts\n│   │   ├── sleep\n│   │   │   └── index.ts\n│   │   └── typeorm\n│   │   ├── entities.ts\n│   │   ├── migrations\n│   │   │   ├── ... migration files\n│   │   │   └── index.ts\n│   │   ├── ormconfig-cli.ts\n│   │   ├── ormconfig.ts\n│   │   └── repository\n│   │   ├── user-verification-code.ts\n│   │   └── user.ts\n│   ├── server.ts\n│   ├── services\n│   │   ├── external\n│   │   │   └── email\n│   │   │   ├── config.ts\n│   │   │   ├── index.ts\n│   │   │   ├── interface.ts\n│   │   │   └── template.ts\n│   │   ├── healthcheck.ts\n│   │   └── user.ts\n│   └── utils\n│   └── index.ts\n├── tests\n│   ├── controllers\n│   │   └── healthcheck.test.ts\n│   └── utils\n│   └── index.test.ts\n```\n\n#### Explanation\n\n| Name                            | Description                                                                                                                           |\n| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |\n| **docs/**                       | Store Open API spec.                                                                                                                  |\n| **src/**                        | Source files.                                                                                                                         |\n| **src/cmd/**                    | All CLI-based files are stored here. In this specific case, it will generate error code based on Open API definition.                 |\n| **src/controllers/**            | REST API Controllers.                                                                                                                 |\n| **src/controllers/middlewares** | Store middlewares that are used to intercept, validate, add data to request/response and or perform authentication to certain routes. |\n| **src/domain**                  | Typescript classes to represent entities.                                                                                             |\n| **src/events/**                 | Event listeners.                                                                                                                      |\n| **src/interfaces/**             | A collection of interfaces, especially for HTTP request-response.                                                                     |\n| **src/libs/env/**               | Library to inject environment variable from an `.env` file.                                                                           |\n| **src/libs/sleep/**             | Library to add delay for a certain amount of time.                                                                                    |\n| **src/libs/typeorm/**           | All functionalities with regard to type ORM (SQL migration files, ORM config, and repository layer).                                  |\n| **src/services/**               | Service layer. Core business logics are stored here.                                                                                  |\n| **src/utils/**                  | This directory contains utility functions for generating random codes and validating strings against specific rules                   |\n| **tests/**                      | Test directory for both unit and integration tests.                                                                                   |\n\n### API Routes\n\nPlease head over to this URL: [swagger](https://simple-signup-login-078d53a6175d.herokuapp.com/api-docs)\n\n### Similar projects\n\n-   [mkosir/typeorm-express-typescript](https://github.com/mkosir/typeorm-express-typescript)\n-   [emangor/boilerplate-typescript-express-postgres](https://github.com/emangor/boilerplate-typescript-express-postgres)\n-   [leonardorb/backend-postgres-typescript-node-express](https://github.com/leonardorb/backend-postgres-typescript-node-express)\n-   [mikesparr/typescript-postgres-auth-example](https://github.com/mikesparr/typescript-postgres-auth-example)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildan3105%2Fexpress-typescript-postgres-signup-login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwildan3105%2Fexpress-typescript-postgres-signup-login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildan3105%2Fexpress-typescript-postgres-signup-login/lists"}