Skip to content

About

🏦 Fintech Wallet API β€” ASP.NET Core (.NET 10) with JWT auth, Paystack payment integration, generic repository pattern, and EF Core SQLite.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Fintech Wallet API

.NET License Build

A backend API for a fintech wallet system built with ASP.NET Core and Entity Framework Core. The system allows users to register, create wallets, deposit and withdraw funds, transfer money, and fund wallets via Paystack payment gateway.


πŸš€ Features

  • User registration and login with secure password hashing
  • JWT-based authentication
  • Create and manage digital wallets
  • Deposit and withdraw funds
  • Transfer money between wallets
  • Fund wallets via Paystack payment gateway
  • Payment verification with automatic wallet crediting
  • Transaction history
  • Generic repository pattern
  • RESTful API design with Swagger documentation
  • Unit tests with xUnit and Moq

🧰 Tech Stack

Layer Technology
Framework ASP.NET Core (.NET 10)
Language C#
Database SQLite (via Entity Framework Core)
Authentication JWT (JSON Web Token)
Payment Paystack
Testing xUnit, Moq
Documentation Swagger / Swashbuckle

πŸ— Architecture

The project follows a layered architecture with a factory pattern for payment processing.

Controller β†’ Service β†’ Repository β†’ Database
                 β†˜
            PaymentFac β†’ IPayment (Paystack)
  • Controllers β€” handle HTTP requests and responses
  • Services β€” contain business logic
  • Repositories β€” generic data access via IRepository<T>
  • Payments β€” payment gateway integration using factory pattern
  • Models β€” domain entities and DTOs

πŸ“‚ Project Structure

FintechWallet/
β”‚
β”œβ”€β”€ Controllers/
β”‚   β”œβ”€β”€ AuthController.cs          # Registration & login endpoints
β”‚   └── WalletController.cs        # Wallet, transaction & payment endpoints
β”‚
β”œβ”€β”€ Services/
β”‚   β”œβ”€β”€ IAuthService.cs            # Auth service interface
β”‚   β”œβ”€β”€ AuthService.cs             # JWT token generation, password hashing
β”‚   β”œβ”€β”€ IWalletService.cs          # Wallet service interface
β”‚   └── WalletService.cs           # Deposit, withdraw, transfer logic
β”‚
β”œβ”€β”€ Repositories/
β”‚   β”œβ”€β”€ IRepository.cs             # Generic repository interface
β”‚   └── Repository.cs              # Generic repository implementation
β”‚
β”œβ”€β”€ Payments/
β”‚   β”œβ”€β”€ IPayment.cs                # Payment provider interface
β”‚   β”œβ”€β”€ PaymentFac.cs              # Payment factory
β”‚   └── Paystack/
β”‚       └── PaystackPayment.cs     # Paystack payment implementation
β”‚
β”œβ”€β”€ Models/
β”‚   β”œβ”€β”€ User.cs                    # User entity
β”‚   β”œβ”€β”€ Wallet.cs                  # Wallet entity
β”‚   β”œβ”€β”€ Transaction.cs             # Transaction entity & enum
β”‚   β”œβ”€β”€ Payment.cs                 # Payment request model
β”‚   β”œβ”€β”€ PaymentLog.cs              # Payment audit log entity
β”‚   └── Dtos.cs                    # Data transfer objects
β”‚
β”œβ”€β”€ Data/
β”‚   └── WalletDbContext.cs         # EF Core database context
β”‚
β”œβ”€β”€ Tests/
β”‚   └── WalletServiceTests.cs      # Unit tests for WalletService
β”‚
β”œβ”€β”€ Program.cs                     # App configuration & DI setup
β”œβ”€β”€ appsettings.json               # App settings & connection strings
└── README.md

βš™οΈ Getting Started

Prerequisites

  • .NET SDK 10 or later
  • Visual Studio, VS Code, or Rider

Installation

# Clone the repository
git clone https://github.com/muisoft/fintech-wallet-dotnet.git

# Navigate to the project folder
cd fintech-wallet-dotnet

# Restore dependencies
dotnet restore

# Run the application
dotnet run

The API will be available at http://localhost:5000 with Swagger UI at /swagger.


πŸ“˜ API Endpoints

Auth

Method Endpoint Description
POST /api/auth/register Register a new user
POST /api/auth/login Login and receive JWT token

Wallets

Method Endpoint Description
POST /api/wallets Create a new wallet
GET /api/wallets List all user wallets
GET /api/wallets/{id} Get wallet details
POST /api/wallets/{id}/deposit Deposit funds
POST /api/wallets/withdraw Withdraw funds
POST /api/wallets/transfer Transfer between wallets
GET /api/wallets/{id}/transactions Get transaction history

Payments

Method Endpoint Description
POST /api/wallets/fund-with-payment Initialize Paystack payment
POST /api/wallets/verify-funding Verify payment & credit wallet

πŸ” Authentication

The API uses JWT Bearer authentication. Include the token in the Authorization header:

Authorization: Bearer <your_token>

πŸ§ͺ Running Tests

dotnet test

πŸ“„ License

This project is licensed under the MIT License.


πŸ‘€ Author

Muideen Adewale β€” Senior Software Engineer

LinkedIn Email

About

🏦 Fintech Wallet API β€” ASP.NET Core (.NET 10) with JWT auth, Paystack payment integration, generic repository pattern, and EF Core SQLite.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages