{"id":17651741,"url":"https://github.com/diegovictor/fastify-api","last_synced_at":"2026-04-11T14:01:50.863Z","repository":{"id":98963978,"uuid":"600148011","full_name":"DiegoVictor/fastify-api","owner":"DiegoVictor","description":"Project built during Rocketseat's Ignite","archived":false,"fork":false,"pushed_at":"2026-01-01T13:52:03.000Z","size":1218,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-06T16:01:12.541Z","etag":null,"topics":["fastify","javascript","js","knex","node","nodejs","postgres","rocketseat","sqlite","tests","ts","typescript","vitest"],"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/DiegoVictor.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-02-10T17:35:20.000Z","updated_at":"2026-01-01T13:52:07.000Z","dependencies_parsed_at":"2026-01-02T00:11:13.568Z","dependency_job_id":null,"html_url":"https://github.com/DiegoVictor/fastify-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DiegoVictor/fastify-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoVictor%2Ffastify-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoVictor%2Ffastify-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoVictor%2Ffastify-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoVictor%2Ffastify-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DiegoVictor","download_url":"https://codeload.github.com/DiegoVictor/fastify-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoVictor%2Ffastify-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31682953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["fastify","javascript","js","knex","node","nodejs","postgres","rocketseat","sqlite","tests","ts","typescript","vitest"],"created_at":"2024-10-23T11:43:28.002Z","updated_at":"2026-04-11T14:01:50.837Z","avatar_url":"https://github.com/DiegoVictor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fastify API\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/DiegoVictor/fastify-api/config.yml?logo=github\u0026style=flat-square)](https://github.com/DiegoVictor/fastify-api/actions)\n[![postgres](https://img.shields.io/badge/postgres-8.11.5-326690?style=flat-square\u0026logo=postgresql\u0026logoColor=white)](https://www.postgresql.org/)\n[![sqlite3](https://img.shields.io/badge/sqlite-5.1.7-003b57?style=flat-square\u0026logo=sqlite\u0026logoColor=white)](https://www.sqlite.org)\n[![typescript](https://img.shields.io/badge/typescript-5.4.5-3178c6?style=flat-square\u0026logo=typescript)](https://www.typescriptlang.org/)\n[![eslint](https://img.shields.io/badge/eslint-8.57.0-4b32c3?style=flat-square\u0026logo=eslint)](https://eslint.org/)\n[![airbnb-style](https://flat.badgen.net/badge/style-guide/airbnb/ff5a5f?icon=airbnb)](https://github.com/airbnb/javascript)\n[![vitest](https://img.shields.io/badge/vitest-1.5.2-6e9f18?style=flat-square\u0026logo=vitest)](https://vitest.dev/)\n[![coverage](https://img.shields.io/codecov/c/gh/DiegoVictor/fastify-api?logo=codecov\u0026style=flat-square)](https://codecov.io/gh/DiegoVictor/fastify-api)\n[![MIT License](https://img.shields.io/badge/license-MIT-green?style=flat-square)](https://raw.githubusercontent.com/DiegoVictor/fastify-api/main/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\u003cbr\u003e\n[![Run in Insomnia}](https://insomnia.rest/images/run.svg)](https://insomnia.rest/run/?label=Fastify%20API\u0026uri=https%3A%2F%2Fraw.githubusercontent.com%2FDiegoVictor%2Ffastify-api%2Fmain%2FInsomnia_2024-12-16.json)\n\nSmall and simple transactions API developed with [Fastify](https://www.fastify.io/).\n\n## Table of Contents\n* [Installing](#installing)\n  * [Configuring](#configuring)\n    * [.env](#env)\n    * [Migrations](#migrations)\n* [Usage](#usage)\n  * [Routes](#routes)\n    * [Requests](#requests)\n* [Running the tests](#running-the-tests)\n  * [Coverage report](#coverage-report)\n\n# Installing\nEasy peasy lemon squeezy:\n```\n$ yarn\n```\nOr:\n```\n$ npm install\n```\n\u003e Was installed and configured the [`eslint`](https://eslint.org/) and [`prettier`](https://prettier.io/) to keep the code clean and patterned.\n\n## Configuring\nThe application use just one database, you can choose between: [SQLite](https://www.sqlite.org/index.html) and [Postgres](https://www.postgresql.org/), look to [env](#env) to see how.\n\n### .env\nIn this file you may configure the environment, your app's port and a url to documentation (this will be returned with error responses, see [error section](#error-handling)). Rename the `.env.example` in the root directory to `.env` then just update with your settings.\n\n|key|description|default\n|---|---|---\n|NODE_ENV|App environment.|`development`\n|DATABASE_CLIENT|Postgres (`pg`) or SQLite (`sqlite`).|`sqlite`\n|DATABASE_URL|If `DATABASE_CLIENT` is `sqlite` this should be the path to the database file, but if `DATABASE_CLIENT` is `pg` it should be the URL to connect to the database.|`./db/fastify-api.sqlite`\n|PORT|Port number where the app will run (optional).|`3000`\n\n### Migrations\nRemember to run the migrations:\n```\n$ yarn knex:migrate\n```\nOr:\n```\n$ npx knex migrate:latest\n```\n\u003e See more information on [Knex Migrations](https://knexjs.org/guide/migrations.html).\n\n\n# Usage\nTo start up the app run:\n```\n$ yarn dev:server\n```\nOr:\n```\nnpm run dev:server\n```\n\n## Routes\n|route|HTTP Method|params|description\n|:---|:---:|:---:|:---:\n|`/transactions`|POST|Body with user transaction `type`, `title` and `amount`.|Create a new transaction (`credit` or `debit`).\n|`/transactions`|GET| - |Get all transactions.\n|`/transactions/:id`|GET|`id` of the transaction|Get one transaction.\n|`/transactions/summary`|GET| - |Return transactions summary.\n\n### Requests\n* `POST /transactions`\n\nRequest body:\n```json\n{\n  \"type\": \"credit\",\n  \"title\": \"Deposit\",\n  \"amount\": 1000\n}\n```\n\n# Running the tests\n[Vitest](https://vitest.dev) was the choice to test the app, to run:\n```\n$ yarn test\n```\nOr:\n```\n$ npm run test\n```\n\n## Coverage report\nYou can see the coverage report inside `tests/coverage`. They are automatically created after the tests run.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegovictor%2Ffastify-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiegovictor%2Ffastify-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegovictor%2Ffastify-api/lists"}