{"id":24746577,"url":"https://github.com/samuelmarks/restify-orm-scaffold","last_synced_at":"2025-10-25T08:33:10.903Z","repository":{"id":150265415,"uuid":"45541122","full_name":"SamuelMarks/restify-orm-scaffold","owner":"SamuelMarks","description":"REST API scaffold with auth and user admin; built on Node.JS in TypeScript with restify and any ORM (waterline, TypeORM, sequelize).","archived":false,"fork":false,"pushed_at":"2024-10-17T03:41:32.000Z","size":2039,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T06:00:08.545Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SamuelMarks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2015-11-04T13:36:31.000Z","updated_at":"2024-10-17T03:41:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"3cea9b43-72be-45c3-9c0d-486a4427033d","html_url":"https://github.com/SamuelMarks/restify-orm-scaffold","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/SamuelMarks%2Frestify-orm-scaffold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelMarks%2Frestify-orm-scaffold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelMarks%2Frestify-orm-scaffold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelMarks%2Frestify-orm-scaffold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamuelMarks","download_url":"https://codeload.github.com/SamuelMarks/restify-orm-scaffold/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235964707,"owners_count":19073476,"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":[],"created_at":"2025-01-28T04:29:28.618Z","updated_at":"2025-10-09T16:16:23.749Z","avatar_url":"https://github.com/SamuelMarks.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"restify-orm-scaffold\n====================\n[![License](https://img.shields.io/badge/license-Apache--2.0%20OR%20MIT-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Coverage Status](https://coveralls.io/repos/github/SamuelMarks/restify-orm-scaffold/badge.svg)](https://coveralls.io/github/SamuelMarks/restify-orm-scaffold)\n![TypeScript build](https://github.com/SamuelMarks/restify-orm-scaffold/workflows/TypeScript%20build/badge.svg)\n\nSimple baseline scaffold to get you started using [TypeORM](https://github.com/typeorm/typeorm) and/or [Sequelize](https://github.com/sequelize/sequelize) and/or [Waterline](https://github.com/balderdashy/waterline) on [restify](https://github.com/restify/node-restify) with [TypeScript](https://github.com/Microsoft/TypeScript).\n\n## Install prerequisites\n\n### Node\n\n  0. node \u0026 npm (tested with node v10.16.0 \u0026 npm v6.10.1)\n  1. Run: `npm install -g typings typescript bunyan`\n  2. `cd` to directory you've cloned this repo into\n  3. Run: `typings install`\n  4. Run: `npm install`\n\n### External\n\n  - Database, e.g.: Postgres. Set `RDBMS_URI` env var accordingly, e.g.: `postgres://username:password@hostname:port/database_name`. Modify [config.ts](https://github.com/SamuelMarks/restify-orm-scaffold/blob/master/config.ts) to use a different database.\n  - Redis. Set `REDIS_URL` env var accordingly; otherwise defaults are used.\n  - Set: `DEFAULT_ADMIN_EMAIL` and `DEFAULT_ADMIN_PASSWORD` env vars\n\n## Docker / Podman\n\nAlternatively there is a `Dockerfile` and `docker-compose.yml`, so rather than installing dependencies (other than [Docker](https://docs.docker.com/install/#supported-platforms)), you can run:\n\n### 0. Build image for this repo\n\n    docker build -t restify-orm-scaffold_api_1 .\n\n### 1. Docker Compose\n\n    docker-compose up\n\n### Kubernetes\nIf you'd rather use Kubernetes to Docker Compose, then:\n\u003cTODO\u003e\n\n### Docker\n\nIf you don't want to use Docker Compose, then assuming you have Redis and Postgresql running independently of Docker, or exposed in Docker through ports, you can then run:\n\n    docker run -e RDBMS_URI=\"$RDBMS_URI\" \\\n               -e REDIS_HOST=\"$REDIS_HOST\" \\\n               -e DEFAULT_ADMIN_EMAIL=foo \\\n               -e DEFAULT_ADMIN_PASSWORD=bar \\\n               -p 3000:3000 \\\n               --name \"${PWD##*/}\" \\\n               \"${PWD##*/}_api\"  # Name of the Docker image, the `_api` is suffixed by Docker Compose\n\nWhere `RDBMS_URI` and `REDIS_HOST` environment variables are set correctly for your system, in the form:\n\n    export RDBMS_URI='postgres://username:password@hostname:port/database_name'\n    export REDIS_HOST='host'\n\n## Configure a reverse proxy for server \u0026 static website files\n\nUse a long [nginxctl](https://github.com/offscale/nginxctl) CLI command to create an nginx config and server it:\n\n    python -m nginxctl serve --temp_dir '/tmp' -b 'server' --server_name 'localhost' --listen '8080' -b 'location' '/api' --proxy_pass 'http://localhost:3000' --proxy_redirect 'off' -} -b 'location' '/' --root '/tmp/wwwroot' --try_files '$uri$args $uri$args/ /index.html' -} -}\n\nOr just write a config (below is what the command generates… with 2 newlines thrown in):\n\n    server {\n        server_name localhost;\n        listen 8080;\n\n        location /api {\n            proxy_pass http://localhost:3000;\n            proxy_redirect off;\n        }\n\n        location / {\n            root /tmp/wwwroot;\n            try_files $uri$args $uri$args/ /index.html;\n        }\n    }\n\n## Compile+run app\n\n    tsc\n    node main.js\n\n## Misc\n\n### Cleanup compiled output\n\nWhen `*.js` isn't present in `.gitignore`, clean out compiled js with this GNU findutils \u0026 Bash solution:\n\n    find -name '*.js.map' -type f -exec bash -c 'rm \"${1}\" \"${1%????}\"' bash {} \\;\n\nTo delete all `*.js` outside of `node_modules`, use:\n\n    find \\( -name node_modules -prune \\) -o -name '*.js' -type f -exec rm {} \\;\n\nMore complicated solution handling \"foo.ts\" \u0026 \"foo.js\" without \"foo.js.map\" coming at some point.\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttps://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelmarks%2Frestify-orm-scaffold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelmarks%2Frestify-orm-scaffold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelmarks%2Frestify-orm-scaffold/lists"}