{"id":20851071,"url":"https://github.com/naveteam/back-boilerplate","last_synced_at":"2025-05-12T04:31:55.653Z","repository":{"id":40399966,"uuid":"167720663","full_name":"naveteam/back-boilerplate","owner":"naveteam","description":"A boilerplate for building RESTful APIs using Node.js, PostgreSQL, koa, knex, bookshelf. ","archived":false,"fork":false,"pushed_at":"2022-05-12T20:49:46.000Z","size":352,"stargazers_count":35,"open_issues_count":9,"forks_count":19,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T00:42:51.625Z","etag":null,"topics":["knex","koa"],"latest_commit_sha":null,"homepage":null,"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/naveteam.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}},"created_at":"2019-01-26T17:58:53.000Z","updated_at":"2024-04-20T08:22:42.000Z","dependencies_parsed_at":"2022-08-09T19:20:43.643Z","dependency_job_id":null,"html_url":"https://github.com/naveteam/back-boilerplate","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/naveteam%2Fback-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naveteam%2Fback-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naveteam%2Fback-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naveteam%2Fback-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naveteam","download_url":"https://codeload.github.com/naveteam/back-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253675506,"owners_count":21945933,"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":["knex","koa"],"created_at":"2024-11-18T03:12:20.164Z","updated_at":"2025-05-12T04:31:55.393Z","avatar_url":"https://github.com/naveteam.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node API boilerplate by nave.rs\n\nA boilerplate for building RESTful APIs using Node.js, PostgreSQL, koa, knex, objection.\n\n# Getting started\n\n## Installation\n\n1. Install [Node.JS](https://nodejs.org/en/) LTS version\n2. Install PostgreSQL\n3. Clone this repository and enter on the respective folder\n4. Install dependencies running: `yarn` or `npm install`\n\n## Things to do before run the project:\n\n1. Create database (by follow the commands):\n\n- CREATE USER `user` WITH PASSWORD `password`\n- CREATE DATABASE `database`\n- GRANT ALL PRIVILEGES ON DATABASE `database` to `user`\n\n2. Install `citext` extension on your database with the command `CREATE EXTENSION citext;`\n3. Change name value of .env.example to .env and set the key SECRET to any value you wish\n4. Change DATABASE_URL to postgress://`user`:`password`@`localhost`/`database`\n5. Run migrations: `yarn db:migrate`\n6. Run seeds: `yarn db:seed`\n\n7. Install [Docker](https://docs.docker.com/engine/install/)\n\n- Pull redis: `docker pull redis`\n- Create image: `docker run --name your-image-name -d redis`\n- Start redis: `docker start your-image-name`\n\n8. Run `yarn start` or `yarn dev` to start server\n\n## Testing\n\n1. Run tests: `yarn test`\n\n## Directory Structure\n\n```\n├── /src\n|   ├── /controllers\n|   ├── /database\n|   |    ├── /migrations\n|   |    ├── /seeds\n|   ├── /helpers\n|   ├── /middleware\n|   ├── /models\n|   ├── /routes\n|   ├── /validators\n├── /test\n```\n\n## Postman\n\n[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/aba33a508a2c4dff0754)\n\n## Styleguide\n\n[![Standard - JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\n## Nodemailer\n\nTo use the nodemailer helper in a non-production environment, you need to set the variable in .env `ALLOW_LIST` and assign an array with the domains allowed for sending e-mail. This domain must start with an `@`, followed by a minimum of 2 characters, a `.` and 2 characters in the end.\nIn case the informed email is not part of any informed domain, the email will not be sent.\n\n### Examples:\n\n- ALLOW_LIST=[\"@nave.rs\"]\n- EMAIL_1: gustavo@nave.rs - `ALLOWED`\n- EMAIL_2: gcdpinho@gmail.com - `NOT ALLOWED`\n\nThe following domains: `nave.rs` and`@nave` are not allowed as they do not satisfy the domain description, given above.\n\n## Database\n\nThis project uses objection.js as ORM and knex as query builder.\n\n### Migrations:\n\nIn order not to use before update hooks on our models, we decided to create a function and trigger via migration, everytime you create a table with updated_at add the trigger to it. (an example is in the file: \"src/database/migrations/20180910221504_init.js\")\n\n## Steps to use Queue UI\n\n1. After adding a new queue, need to add in queue.js a new `adapter`\n2. Acess UI on http://localhost:3001/v1/queues/dashboards\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaveteam%2Fback-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaveteam%2Fback-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaveteam%2Fback-boilerplate/lists"}