Skip to content

gui-alves-oliveira/valutty

Repository files navigation

Welcome to Valutty 👋

Version License: MIT

A web app that allows users to track their income and expenses. Users can add, categorize, edit, and delete transactions, view a summary of their finances, and set monthly budgets for different categories like "Food," "Entertainment," and "Bills."

Install

install node dependencies:

npm install

set-up the database:

docker compose up -d
npx drizzle-kit push

Usage

npm run dev

Run tests

npm run test

Documentation

http://locahost:{PORT}/documentation

Features

User Registration

  • Allow account creation with name, email, and password.
  • Secure password storage (encryption).

Authentication and Authorization

  • Implement login with email and password.
  • Session or JWT-based authorization.
  • Route authentication to ensure only authenticated users access protected resources.

Expense Tracking

  • Allow users to create a new expense entry with:
    • Amount
    • Date
    • Description (optional)
  • Each expense should be associated with the user who created it.

Expense Categorization

  • Allow user to create categories.

Expense Viewing

  • View expenses in a list.
  • Filter and group expenses by date and category.

Profile Management

  • Allow profile information updates (name and email).

Non-Functional Requirements

Security

  • Secure password storage (e.g., bcrypt).
  • Secure authentication using JWT tokens.
  • Data validation to prevent attacks like SQL Injection and XSS.

Maintenance and Scalability

  • Modular structure following best development practices to facilitate maintenance.
  • Clear documentation for code and APIs.

Project Architecture

1. Domain Layer (Business Rules)

  • Contents: Contains entities, value objects, and business rules that represent the core business logic. These are pure classes and functions that describe "what" the business does, independent of "how" it’s done or "who" uses it.
  • Responsibilities: Enforces and encapsulates the business rules, ensuring that the essential business logic remains consistent. This layer defines "what" happens in the business, independent of application use cases or infrastructure.
  • Dependencies: Completely independent of other layers. The Domain layer has no dependencies on Application, Infrastructure, or Presentation.

2. Application Layer (Use Cases)

  • Contents: Contains services, use case classes, and application-specific logic. These elements define the steps necessary to execute a use case or workflow, such as "Create User" or "Process Payment."
  • Responsibilities: Orchestrates and executes use cases, coordinating actions across entities and resources. This layer controls how the business rules (from the Domain layer) interact to achieve specific application goals.
  • Dependencies: Depends on the Domain layer for business logic. It should only have interface contracts (e.g., repositories) for any external dependencies (like data storage or APIs), keeping the layer independent of the Infrastructure layer.

3. Infrastructure Layer (Technical Implementation)

  • Contents: Implements the actual infrastructure components, like database repositories, data mappers, external API clients, and other resources needed by the Application layer.
  • Responsibilities: Provides concrete implementations of the interfaces required by the Application layer. For example, if the Application layer needs to retrieve a list of users, the Infrastructure layer would provide a repository that fetches data from a database.
  • Dependencies: Implements interfaces or adapters defined in the Application layer, following dependency inversion. This layer can depend on Application interfaces but should avoid referencing specific Application or Domain logic.

4. Presentation Layer (Web API / REST Interface)

  • Contents: Controllers, routing, serializers, and response handlers that create a RESTful API for the application. Each route or controller method represents an endpoint (e.g., POST /accounts or GET /transaction/{id}).
  • Responsibilities: Exposes the Application layer’s use cases to external clients via HTTP. The API receives HTTP requests, translates them into application use cases, and returns HTTP responses with the appropriate status codes and data.
  • Dependencies: Depends on the Application layer, as it calls application use cases and receives data structures or response objects for clients. It follows dependency inversion, ensuring the Web API only depends on the use case interfaces, keeping business rules and core logic shielded.

Author

👤 Guilherme Oliveira

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published