{"id":25994754,"url":"https://github.com/mthszr/transactions-api","last_synced_at":"2026-04-10T13:31:02.839Z","repository":{"id":278811897,"uuid":"936842828","full_name":"mthszr/transactions-api","owner":"mthszr","description":"A RESTful API for managing financial transactions with user authentication and balance tracking.","archived":false,"fork":false,"pushed_at":"2025-03-04T14:46:11.000Z","size":528,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T14:11:08.723Z","etag":null,"topics":["backend","fastify","javascript","knexjs","nodejs","postgresql","rest-api","sqlite","typescript","vitest","zod"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/mthszr.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-21T19:33:47.000Z","updated_at":"2025-03-04T15:00:01.000Z","dependencies_parsed_at":"2025-07-10T19:35:22.538Z","dependency_job_id":"bd514b0c-cccd-4bce-ac4a-71c65ac79b38","html_url":"https://github.com/mthszr/transactions-api","commit_stats":null,"previous_names":["mthszr/api_rest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mthszr/transactions-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthszr%2Ftransactions-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthszr%2Ftransactions-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthszr%2Ftransactions-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthszr%2Ftransactions-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mthszr","download_url":"https://codeload.github.com/mthszr/transactions-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthszr%2Ftransactions-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31645170,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: 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":["backend","fastify","javascript","knexjs","nodejs","postgresql","rest-api","sqlite","typescript","vitest","zod"],"created_at":"2025-03-05T15:16:48.678Z","updated_at":"2026-04-10T13:31:02.830Z","avatar_url":"https://github.com/mthszr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🚀 Project Overview\na RESTful API built with Node.js and Fastify, for efficient transaction management. Users can create, list, and view transactions while maintaining account balance summaries. Each request is strictly tied to the user’s identity, ensuring that data remains private and users can only interact with their own transactions.\n\n## 🔧 Getting Started\n\n### Prerequisites\n- Node.js 18+\n- PostgreSQL\n\n### Installation\n```bash\n# Clone the repository\ngit clone https://github.com/mthszr/transactions-api.git\n\n# Install dependencies\nnpm install\n\n# Set up environment variables\ncp .env.example .env\n# Edit .env with your database credentials\n\n# Run migrations\nnpx prisma migrate dev\n\n# Start development server\nnpm run start:dev\n```\n\n### Testing\n\n```bash\n# Run all tests\nnpm test\n\n# Run tests in watch mode\nnpm test -- --watch\n```\n\n## 🚦 API Routes\n\n### Transactions\n- `POST /transactions` - Create a new transaction\n- `GET /transactions` - List all transactions\n- `GET /transactions/:id` - Get transaction details\n- `GET /transactions/summary` - Get account balance\n\n## 🛠 Technologies\n- Node.js\n- TypeScript\n- Fastify\n- Knex\n- SQLite/PostgreSQL\n- Vitest\n- Supertest\n- Zod\n- ESLint\n- Biome\n\n## ✅ Functional Requirements (FR)\n- (✓) **Create Transaction:** The user must be able to create a new transaction.\n- (✓) **Account Summary:** The system must provide a summary (balance) of the user's account.\n- (✓) **List Transactions:** The user can list all transactions that have occurred.\n- (✓) **View Single Transaction:** The user can access the details of a specific transaction.\n\n## 📋 Business Rules (BR)\n- (✓) **Transaction Type:** Each transaction can be a credit (which adds to the total) or a debit (which subtracts from the total).\n- (✓) **User Identification:** It is necessary to identify the user in every request, ensuring that actions and data are linked to them.\n- (✓) **View Permission:** The user can only view the transactions they have created.\n\n## 📝 What I Learned\n\n### 1. Environment Configuration \u0026 Validation\n- Managing environment variables with `dotenv`\n- Implementing strong typing and validation using `zod`\n- Handling different environments (development, test, production)\n\n### 2. TypeScript Best Practices\n- Type safety and validation\n- Interface definitions\n- Environment type checking\n- Error handling with type safety\n\n### 3. Database Management\n- Working with multiple database clients (PostgreSQL and SQLite)\n- Database migrations using Knex\n- Query building and data access patterns\n\n### 4. API Development with Fastify\n- Route handling\n- Middleware implementation\n- Cookie management\n- Request/Response lifecycle\n- Error handling\n\n### 5. Testing Practices\n- Unit testing with Vitest\n- Integration testing with Supertest\n- Test environment setup\n- Database seeding for tests\n\n### 6. Development Tools\n- Code formatting with Biome\n- ESLint configuration\n- npm scripts for automation\n- Git version control\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthszr%2Ftransactions-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmthszr%2Ftransactions-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthszr%2Ftransactions-api/lists"}