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.
- Host: GitHub
- URL: https://github.com/yuribodo/spendify
- Owner: yuribodo
- Created: 2025-02-24T23:18:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-19T02:17:29.000Z (over 1 year ago)
- Last Synced: 2025-03-19T03:24:20.364Z (over 1 year ago)
- Topics: fastify, node, typescript, vitest
- Language: TypeScript
- Homepage: https://spendify-39pp.onrender.com/docs
- Size: 360 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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