{"id":19467111,"url":"https://github.com/yhagio/rest-api-et","last_synced_at":"2026-04-15T10:32:38.995Z","repository":{"id":97007173,"uuid":"131438997","full_name":"yhagio/rest-api-et","owner":"yhagio","description":"Boilerplate: Express, Typescript, Knex, Postgres API","archived":false,"fork":false,"pushed_at":"2019-02-12T03:42:54.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-08T04:32:14.627Z","etag":null,"topics":["docker","express","knex","nodejs","postgressql","prettier","travis-ci","tslint","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/yhagio.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":"2018-04-28T19:41:55.000Z","updated_at":"2022-11-10T17:37:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"3dcd08c9-642d-4417-8032-09ceb31bc0bf","html_url":"https://github.com/yhagio/rest-api-et","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/yhagio%2Frest-api-et","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhagio%2Frest-api-et/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhagio%2Frest-api-et/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhagio%2Frest-api-et/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yhagio","download_url":"https://codeload.github.com/yhagio/rest-api-et/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240680827,"owners_count":19840314,"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":["docker","express","knex","nodejs","postgressql","prettier","travis-ci","tslint","typescript"],"created_at":"2024-11-10T18:33:21.016Z","updated_at":"2026-04-15T10:32:33.944Z","avatar_url":"https://github.com/yhagio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/yhagio/rest-api-et.svg?branch=master)](https://travis-ci.org/yhagio/rest-api-et)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/yhagio/rest-api-et/blob/master/LICENSE)\n\n# Express, Typescript, Knex, Postgres boilerplate\n\n### Set up (Docker)\n```bash\n# Build image and run the app (development)\ndocker-compose up\n\n# Show running containers\ndocker ps\n\n# Insert an user manually (if you want to)\ndocker exec -it \u003cpostgres container id\u003e psql -h postgres -U postgres\n\u003e \\c rest_api_dev\n\u003e INSERT INTO users (first_name, last_name, username, email, password) VALUES ('Alice', 'Smith', 'asmith', 'asmith@test.com', 'password');\n\n# run lint \ndocker ps # Find the container id like b724d5365915\ndocker exec b724d5365915 npm run lint\n```\n\n\n### Set up (Non Docker)\n\n1. Postgres setup (Create database called `rest_api_dev` with\nuser: `dev_user` and password: `password`\n\n```\npsql\n\u003e create database rest_api_dev;\n\u003e create user dev_user with password 'password';\n\u003e grant all privileges on database rest_api_dev to dev_user;\n```\n\n2. Install dependencies\n\n```bash\nnvm use\nyarn       # or npm i\n```\n\n3. Available commands\n\n```bash\nnpm start       # Start application\nnpm run lint    # Lint\nnpm run fixlint # Fix lint\nnpm run unit    # Run unit tests\nnpm test        # Unit tests + coverage by Istanbul\n```\n\n### Test API endpoint\n\nAdd an user to DB\n\n```sql\nINSERT INTO users (first_name, last_name, username, email, password) VALUES\n ('Alice', 'Smith', 'asmith', 'asmith@test.com', 'password');\n```\nTry to get the user via REST API endpoint (`GET /api/users/:uuid`)\n```bash\ncurl -i -H \"Accept: application/json\" -H \"Content-Type: application/json\" http://localhost:3000/api/users/\u003cuuid\u003e\n```\n\n### Production\n\nSetup environmental variables for Postgres in `/app/config/config.ts`\n```\nPG_HOST\nPG_PORT\nPG_DATABASE\nPG_USER\nPG_PASSWORD\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhagio%2Frest-api-et","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyhagio%2Frest-api-et","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhagio%2Frest-api-et/lists"}