Skip to content

Banking system with Next.js & TypeScript & Docker & Prisma & Postgresql πŸ’³πŸ’΅

Notifications You must be signed in to change notification settings

MooudMohammady/banking-system

Repository files navigation

Screenshot 2024-12-04 193405 Screenshot 2024-12-04 193455 Screenshot 2024-12-04 193522

Banking system with Next.js & TypeScript

This project is a simple Next.js application integrated with Docker for easy deployment and management. It includes features like a form for adding bank accounts with validation and a backend connection for fetching and displaying account data.

Features

  • 🏦 Add bank accounts with validation (e.g., IBAN format).
  • πŸ“‹ Fetch and display a list of bank accounts.
  • πŸ”’ Built with Next.js and React Hook Form for efficient form handling.
  • 🐳 Dockerized for seamless deployment.
  • ⚑ Fully customizable and easy to extend.

Getting Started

Prerequisites

Ensure you have the following installed on your system:

Installation

  1. Clone the repository:

    git clone https://github.com/MooudMohammady/banking-system.git
    cd banking-system
    
  2. Install dependencies:

npm install --force
  1. Set up environment variables: Create a .env file in the root directory and add the necessary environment variables:
DATABASE_URL=your-postgresql-database-url

Running Locally

  1. Development server: Start the Next.js development server:
npm run dev
  1. Access the application: Open your browser and visit: http://localhost:3000

Using Docker

  1. Build the Docker image:
docker build -t banking-system .
  1. Run the Docker container:
docker run -p 3000:3000 banking-system
  1. Access the application: Open your browser and visit: http://localhost:3000

⚠ Running Only the Database Service with Docker Compose

If you want to run only the PostgreSQL database using Docker Compose, use the following command:

docker-compose up postgres

This will start only the postgres service defined in docker-compose.yml file. Ensure that your .env file contains the correct DATABASE_URL pointing to this database instance.


Project Structure

banking-system/
β”œβ”€β”€ public # Public assets
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ actions/ # API actions for data fetching and mutations
β”‚ β”œβ”€β”€ app/ # Next.js pages
β”‚ β”œβ”€β”€ components/ # Shared UI components
β”‚ β”‚ β”œβ”€β”€ ui/ # Reusable UI elements (Button, Input, etc.)
β”‚ β”œβ”€β”€ lib/ # additional features
β”œβ”€β”€ docker-compose.yml # Docker configuration for postgres DB
β”œβ”€β”€ dockerfile # Docker configuration
β”œβ”€β”€ README.md # Project documentation
β”œβ”€β”€ .env # Environment variables (not exist by default)
β”œβ”€β”€ package.json # Project dependencies and scripts
└── tsconfig.json # TypeScript configuration

Scripts

  • If this is the first time you run the project, be sure to execute this command first:
npm run prisma:prepare
  • Enter this command if you need sample information:
npm run prisma:seed
  • Start development server:
npm run dev
  • Build the application:
npm run build
  • Run production server:
npm run start

Form Validation

The project uses zod and react-hook-form for validation. The bank account form includes:

  • Bank Name: Minimum 3 characters.
  • IBAN: Matches the standard IBAN format.
  • Balance: Valid numeric value.

Design System

This project utilizes TailwindCSS and ShadCN to build a scalable and reusable design system.

TailwindCSS

  • A utility-first CSS framework for rapid UI development.
  • Provides a consistent and highly customizable styling system.
  • Enables responsive design and theming with ease.

ShadCN

  • A collection of accessible and customizable UI components built with Radix and TailwindCSS.
  • Ensures consistent design language across the project.
  • Simplifies the development of reusable and composable components.

License

This project is licensed under the MIT License.


Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature-name.
  3. Commit your changes: git commit -m "Add feature-name".
  4. Push to the branch: git push origin feature-name.
  5. Open a pull request.

Suggested Tasks for Contributors

If you're looking for specific tasks to contribute, here are some areas where help is needed:

  • Build the Deposit Page and Logic: Design and implement the user interface and backend logic for depositing funds.
  • Build the Withdraw Page and Logic: Create the page and functionality for withdrawing funds from accounts.
  • Write Automated Tests: Use tools like Cypress or Jest to write robust test cases for the application.
  • Bug Fixes and Enhancements: Complete pending details, optimize existing features, and resolve reported bugs.
  • Add Pagination and Filters: Implement pagination and filtering for the transaction history page to improve usability.
  • Other Outstanding Tasks: Review the issue tracker for other tasks that need attention or discuss with the team for additional ideas.

Your contributions make a difference!


Contact

For any questions or issues, please feel free to reach out:

About

Banking system with Next.js & TypeScript & Docker & Prisma & Postgresql πŸ’³πŸ’΅

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published