{"id":22547580,"url":"https://github.com/firmanjs/fastify-template","last_synced_at":"2025-03-28T09:11:49.333Z","repository":{"id":116873794,"uuid":"594907164","full_name":"firmanJS/fastify-template","owner":"firmanJS","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-31T06:32:54.000Z","size":41,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T09:41:35.992Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/firmanJS.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":"2023-01-30T00:59:37.000Z","updated_at":"2023-05-25T04:46:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c46e90e-e592-4858-a370-5563c716bc52","html_url":"https://github.com/firmanJS/fastify-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firmanJS%2Ffastify-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firmanJS%2Ffastify-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firmanJS%2Ffastify-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firmanJS%2Ffastify-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firmanJS","download_url":"https://codeload.github.com/firmanJS/fastify-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245999595,"owners_count":20707568,"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":"2024-12-07T15:12:22.777Z","updated_at":"2025-03-28T09:11:49.324Z","avatar_url":"https://github.com/firmanJS.png","language":"JavaScript","readme":"# Fastify Template\n[![Node.js CI](https://github.com/firmanJS/fastify-template/actions/workflows/nodejs.yml/badge.svg?branch=main)](https://github.com/firmanJS/fastify-template/actions/workflows/nodejs.yml)\n[![Maintainability](https://api.codeclimate.com/v1/badges/a4821ab8ae6ff29792a0/maintainability)](https://codeclimate.com/github/firmanJS/fastify-template/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/a4821ab8ae6ff29792a0/test_coverage)](https://codeclimate.com/github/firmanJS/fastify-template/test_coverage)\n[![made-with-nodejs](https://img.shields.io/badge/Made%20with-Nodejs-1f425f.svg)](https://nodejs.org)\n[![made-with-fastify](https://img.shields.io/badge/Made%20with-Fastify-1f425f.svg)](https://www.fastify.io/)\n[![Ask Me Anything !](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg)](https://github.com/firmanJS)\n[![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/firmanJS/fastify-template/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/firmanjs/fastify-template.svg)](https://github.com/firmanJS/fastify-template/releases)\n[![Github all releases](https://img.shields.io/github/downloads/firmanjs/fastify-template/total.svg)](https://github.com/firmanJS/fastify-template/releases)\n[![GitHub issues](https://img.shields.io/github/issues/firmanjs/fastify-template.svg)](https://github.com/firmanJS/fastify-template/issues/)\n[![GitHub pull-requests](https://img.shields.io/github/issues-pr/firmanjs/fastify-template.svg)](https://github.com/firmanJS/fastify-template/pulls/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\n**Default branch** :\n * default template clean no db configuration\n \n**More Feature Checkout the branch** :\n * [x] `main` no db configuration\n * [ ] `feature/knex` using knex orm default postgre\n * [ ] `feature/mongo` using mongoose orm\n\nThis project has 3 Domain layer :\n * Repository Layer\n * Usecase Layer  \n * Transport Layer\n\n## How To use\nyou must click the button use this template\n- **using template** - create name of your repository\n- **rename link readme** - change link repo default `github/firmanJS/fastify-template` to your repo\n- **codeclimate** - you must integrate repo to codeclimate don't forget set your repo is public for integrated and in github repo settings create secret key with name `CC_TEST_REPORTER_ID` and value from code climate `REPORTER ID` in [https://codeclimate.com/](https://codeclimate.com/)\n\nor clone this repository via https : \n```bash\nhttps://github.com/firmanJS/fastify-template.git\n```\n\n## Core Stack\n- **Node.js** - [http://nodejs.org/](http://nodejs.org/)\n- **Express** - [https://www.fastify.io/](https://www.fastify.io/)\n\n## Feature\n1. * [x] **error handling**\n1. * [x] **clean architecture folder**\n1. * [x] **testing with jest**\n1. * [x] **coverage use jest**\n1. * [x] **with docker example**\n1. * [x] **validiation, use express-valdator**\n1. * [x] **pagination example**\n1. * [x] **custom message api response**\n1. * [x] **eslint airbnb base**\n\n## Unit testing\n- **jestjs** - [https://jestjs.io/](https://jestjs.io/)\n\n## How To run\n\n### copy environment variable\n\n```sh\ncp .env-sample .env\n```\n\n### run manualy\n\n* via yarn or npm :\n\n```sh\n# install package\nnpm install or yarn install\n\n#  running app\nnpm run dev or yarn dev\n\n# running unit tetsing\nnpm run test or yarn test\n```\n\n* via make :\n\n```sh\n# start aplication with docker\nmake docker-start \n\n# stop docker container\nmake docker-stop \n\n# remove docker container\nmake docker-down \n```\n\n### fill in the copied environment earlier\n\n```sh\n#NODEJS\nAPP_PORT=8000\nNODE_ENV=development\nCLUSTER_MODE=off\nJWT_SECRET_KEY=\n\n#DB\nDB_USERNAME=\nDB_PASSWORD=\nDB_PORT=\nDB_DATABASE=\nDB_DRIVER='postgres'\nDB_HOST=\nDB_NAME=\nMONGO_URL=\n```\n\n### run with docker-compose\n\n```sh\ndocker-compose up --build\n```\n\n### or run with background process\n\n```sh\ndocker-compose up --build -d\n```\n### execution npm with container docker\n```sh\n# install package\ndocker-compose exec boillerplate-typescript npm install\n\n# running unit testing\ndocker-compose exec boillerplate-typescript npm run test\n```\n\n## Project Structure\n```\n.\n├── .github/            * all workflows github actions\n├── caprover/           * for deployment in caprover\n├── coverage/           * all output coverage\n├── build/              * all output build source code\n├── docker/             * all dockerfile\n├── src/                * all source code here\n  └── config/           * folder for configuration\n  |  └── *.ts           * all configuration like db, awes redis etc.\n  └── db/               * folder for database\n  |  └── *.ts           * all database files\n  └── interface/        * folder for interface\n  |  └── *.ts           * all interface files\n  └── lang/             * folder for language message\n  |  └── *.ts           * all language message files en, id etc.\n  └── middlewares/      * folder for middlewares\n  |  └── *.ts           * all middlewares files\n  └── repository/       * folder for repository / query logic\n  |  └── *.ts           * all utility files\n  └── transport/        * folder for transport / api, grpc or graphql\n  |  └── *.ts           * all transport files\n  └── usecase/          * folder for usecase / busines logic\n  |  └── *.ts           * all usecase files\n  └── utils/            * folder for utility\n  |  └── *.ts           * all utility files\n```\n\n## Code Style Guides\n* Guideline:\n  * Use camelCase for variable name, naming function\n  * Use UpperCase for Constant Variable\n  * Use PascalCase for class name, models, interface\n  * Use snake_case for file name \n  * Function name use Verb\n  * Variable name use Noun\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirmanjs%2Ffastify-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirmanjs%2Ffastify-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirmanjs%2Ffastify-template/lists"}