An open API service indexing awesome lists of open source software.

https://github.com/yuribodo/spendify

Spendify is a modern personal finance API built with Fastify. It tracks expenses, revenues, and financial categories via RESTful endpoints with JWT authentication for secure, user-specific data. Optimized for performance, Spendify simplifies managing your finances.
https://github.com/yuribodo/spendify

fastify node typescript vitest

Last synced: about 2 months ago
JSON representation

Spendify is a modern personal finance API built with Fastify. It tracks expenses, revenues, and financial categories via RESTful endpoints with JWT authentication for secure, user-specific data. Optimized for performance, Spendify simplifies managing your finances.

Awesome Lists containing this project

README

          

# Spendify ๐Ÿ’ฐ

A personal financial management application built with Fastify, following SOLID principles.

## ๐Ÿ“ About the Project

Spendify is a complete API for personal finance management, allowing users to track expenses and income, categorize transactions, generate reports, and gain financial insights. Built with a focus on development best practices and security.

## ๐Ÿš€ Features

### User Management
- โœ… User registration with email and password
- โœ… User login
- โœ… Password recovery via email
- โœ… Profile updates (name, email, and password)

### Expense Management
- โœ… Create expenses (description, date, value, category, payment method)
- โœ… View all expenses with pagination
- โœ… Filter expenses (by date, category, payment method, amount)
- โœ… View specific expense details
- โœ… Update existing expenses
- โœ… Delete expenses

### Revenue Management
- โœ… Add income (description, date, value, category, income source)
- โœ… View all revenue with pagination
- โœ… Filter revenue (by date, category, income source, amount)
- โœ… View specific revenue details
- โœ… Update existing revenue
- โœ… Delete revenue

### Category Management
- โœ… Create categories for both expenses and revenue
- โœ… View all available categories
- โœ… Update categories
- โœ… Delete unused categories

### Reports and Insights
- โœ… Financial summary with selectable period
- โœ… Categorized reports (monthly expenses, expense categories, income sources)
- โœ… Export financial data to CSV or JSON

### Security and Authentication
- โœ… JWT authentication for protected endpoints
- โœ… Restricted access to users' own financial data

## ๐Ÿ”’ Business Rules

- โœ… Revenue cannot have negative values
- โœ… Revenue cannot be created without a category
- โœ… Expenses cannot have negative values
- โœ… Expenses cannot be created without a category
- โœ… Categories in use cannot be deleted
- โœ… Financial records older than 6 months cannot be edited or deleted
- โœ… Notification when monthly expenses exceed 80% of income
- โœ… Calculation and display of remaining monthly budget

## ๐Ÿ› ๏ธ Technologies Used

- [Node.js](https://nodejs.org/)
- [Fastify](https://www.fastify.io/)
- [TypeScript](https://www.typescriptlang.org/)
- [Vitest](https://vitest.dev/) (for testing)
- SOLID principles, Clean Architecture, and DDD

## ๐Ÿ—๏ธ Non-Functional Requirements

- High concurrency (efficiently handling multiple requests)
- Pagination for expense and revenue listings
- Optimization with caching for repeated queries
- ACID-compliant database
- Error handling for failed requests
- Encryption of sensitive data
- Rate limiting to prevent abuse
- Logging of failed login attempts
- Modular code following SOLID principles and DDD
- Unit and integration tests

## ๐Ÿ“‹ Prerequisites

- Node.js (v14+)
- NPM or Yarn
- Database (PostgreSQL, MySQL, etc.)

## ๐Ÿš€ How to Run

1. Clone the repository:
```bash
git clone https://github.com/yuribodo/spendify.git
cd spendify
```

2. Install dependencies:
```bash
npm install
# or
yarn install
```

3. Configure environment variables:
```bash
cp .env.example .env
# Edit the .env file with your settings
```

4. Run database migrations:
```bash
npm run migrate
# or
yarn migrate
```

5. Start the frontend:
```bash
cd frontend

npm run dev
```

6. Start the backend:
```bash
cd backend

npm run start:dev
```

## ๐Ÿงช Tests

Run tests with the command:
```bash
npm run test
# or
yarn test
```

## ๐Ÿค Contributing

1. Fork the project
2. Create a new branch (`git checkout -b feature/new-feature`)
3. Commit your changes (`git commit -m 'Add new feature'`)
4. Push to the branch (`git push origin feature/new-feature`)
5. Open a Pull Request following the project pattern

### Pull Request Pattern
- ๐Ÿ• Feature
- ๐Ÿ› Bug Fix
- ๐ŸŽจ Style
- ๐Ÿง‘โ€๐Ÿ’ป Code Refactor
- ๐Ÿ”ฅ Performance Improvements
- โœ… Test
- ๐Ÿค– Build
- ๐Ÿ“ฆ Chore
- โฉ Revert