Skip to content

kras2v/MoneyCount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’° MoneyCount

A full-stack personal finance management application that helps you track your income and expenses, categorize transactions, and visualize your spending patterns.

πŸ“‹ Table of Contents

✨ Features

  • User Authentication & Authorization

    • Secure user registration and login
    • Cookie-based authentication
    • Role-based access control (Admin/User)
    • Password requirements enforcement
  • Transaction Management

    • Add, edit, view, and delete financial transactions
    • Track transaction date, amount, description
    • Categorize transactions for better organization
    • Soft delete functionality
  • Category Management

    • Create custom categories for transactions
    • Upload and manage category icons
    • Edit and delete categories
    • User-specific categories
  • Statistics & Visualization

    • View spending patterns with charts
    • Date range filtering for analytics
    • Visual insights into financial data
  • Admin Panel

    • User management dashboard
    • View all registered users
    • Monitor user activity

πŸ›  Tech Stack

Backend

  • Framework: ASP.NET Core 8.0
  • Database: SQL Server (LocalDB)
  • ORM: Entity Framework Core 9.0
  • Authentication: ASP.NET Core Identity with Cookie Authentication
  • API Documentation: Swagger/OpenAPI
  • Mapping: AutoMapper

Frontend

  • Framework: React 18.3
  • Build Tool: Vite 6.0
  • UI Framework: Bootstrap 5.3 + React Bootstrap
  • Routing: React Router DOM 6.28
  • Charts: Chart.js 4.4
  • Date Handling: Moment.js + DateRangePicker
  • HTTP Client: Fetch API

πŸ“¦ Prerequisites

Before you begin, ensure you have the following installed:

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/kras2v/MoneyCount.git
cd MoneyCount

2. Backend Setup

cd money-count-backend

# Restore NuGet packages
dotnet restore

# Update database with migrations
dotnet ef database update

3. Frontend Setup

cd money-count-frontend

# Install dependencies
npm install

βš™οΈ Configuration

Backend Configuration

  1. Database Connection

    Update appsettings.json or appsettings.Development.json in the money-count-backend directory:

    {
      "ConnectionStrings": {
        "SqlServerConnection": "Server=(localdb)\\MSSQLLocalDB;Database=aspnet-PaymentAPI;Trusted_Connection=True;MultipleActiveResultSets=True"
      }
    }
  2. CORS Settings

    The backend is configured to allow requests from http://localhost:5173 (default Vite dev server). Modify in Program.cs if needed:

    builder.Services.AddCors(opt => opt.AddPolicy("AllowFrontend",
        p => p.WithOrigins("http://localhost:5173")
            .AllowAnyMethod()
            .AllowAnyHeader()
            .AllowCredentials()));
  3. Identity Configuration

    Password requirements and lockout settings are configured in Program.cs. Adjust as needed:

    • Minimum password length: 6 characters
    • Requires digit, non-alphanumeric, and uppercase
    • Lockout: 5 failed attempts = 5-minute lockout

Frontend Configuration

Create a .env file in the money-count-frontend directory:

VITE_REACT_APP_API_URL=http://localhost:5000/api/

Update the URL to match your backend server address.

πŸƒ Running the Application

Start the Backend

cd money-count-backend
dotnet run

The API will be available at http://localhost:5000 (or the port specified in launchSettings.json).

Access Swagger documentation at: http://localhost:5000/swagger (in development mode)

Start the Frontend

cd money-count-frontend
npm run dev

The application will be available at http://localhost:5173.

Building for Production

Backend:

cd money-count-backend
dotnet publish -c Release

Frontend:

cd money-count-frontend
npm run build

The production build will be in the dist folder.

πŸ“ Project Structure

MoneyCount/
β”œβ”€β”€ money-count-backend/          # ASP.NET Core API
β”‚   β”œβ”€β”€ Controllers/              # API Controllers
β”‚   β”‚   β”œβ”€β”€ AccountController.cs  # Authentication & user management
β”‚   β”‚   β”œβ”€β”€ CategoryController.cs # Category CRUD operations
β”‚   β”‚   └── TransactionController.cs # Transaction CRUD operations
β”‚   β”œβ”€β”€ Data/                     # Database context and migrations
β”‚   β”‚   └── MoneyCountDbContext.cs
β”‚   β”œβ”€β”€ Entities/                 # Database models
β”‚   β”‚   β”œβ”€β”€ User.cs
β”‚   β”‚   β”œβ”€β”€ Category.cs
β”‚   β”‚   └── Transaction.cs
β”‚   β”œβ”€β”€ Models/                   # DTOs and view models
β”‚   β”œβ”€β”€ MappingProfiles.cs        # AutoMapper configuration
β”‚   └── Program.cs                # Application entry point
β”‚
β”œβ”€β”€ money-count-frontend/         # React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/           # Reusable React components
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/             # Authentication components
β”‚   β”‚   β”‚   β”œβ”€β”€ category/         # Category components
β”‚   β”‚   β”‚   β”œβ”€β”€ transaction/      # Transaction components
β”‚   β”‚   β”‚   └── protected-routes.jsx # Route protection
β”‚   β”‚   β”œβ”€β”€ pages/                # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ authentication/   # Login & register pages
β”‚   β”‚   β”‚   β”œβ”€β”€ users/            # User & admin pages
β”‚   β”‚   β”‚   β”œβ”€β”€ categories.jsx    # Category management
β”‚   β”‚   β”‚   β”œβ”€β”€ transactions.jsx  # Transaction management
β”‚   β”‚   β”‚   └── statistics.jsx    # Analytics dashboard
β”‚   β”‚   β”œβ”€β”€ App.jsx               # Main app component
β”‚   β”‚   └── main.jsx              # Application entry point
β”‚   β”œβ”€β”€ public/                   # Static assets
β”‚   β”œβ”€β”€ index.html                # HTML template
β”‚   β”œβ”€β”€ vite.config.js            # Vite configuration
β”‚   └── package.json              # Dependencies
β”‚
└── README.md                     # This file

πŸ“– API Documentation

Authentication Endpoints

Method Endpoint Description Auth Required
POST /api/account/register Register a new user No
POST /api/account/login Login user No
POST /api/account/logout Logout user Yes
GET /api/account/checkuser Check if user is authenticated Yes
GET /api/account/admin Access admin panel Yes (Admin)

Transaction Endpoints

Method Endpoint Description Auth Required
GET /api/transactions Get paginated transactions Yes
GET /api/transactions/get-all-transactions Get all transactions Yes
GET /api/transactions/{id} Get specific transaction Yes
POST /api/transactions Create new transaction Yes
POST /api/transactions/post-transactions Bulk create transactions Yes
PUT /api/transactions Update transaction Yes
DELETE /api/transactions Delete transaction Yes

Category Endpoints

Method Endpoint Description Auth Required
GET /api/categories Get all categories Yes
GET /api/categories/{id} Get specific category Yes
POST /api/categories Create new category Yes
POST /api/categories/upload-category-icon Upload category icon Yes
PUT /api/categories Update category Yes
DELETE /api/categories Delete category Yes

🀝 Contributing

Contributions are welcome! Please follow these steps:

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

Development Guidelines

  • Follow existing code style and conventions
  • Write meaningful commit messages
  • Update documentation as needed
  • Test your changes thoroughly before submitting

πŸ‘¨β€πŸ’» Author

kras2v

πŸ™ Acknowledgments


Note: This application is designed for personal use. Always keep your database credentials and sensitive configuration secure.

About

Full-stack web application for managing budget

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published