A comprehensive bank administration application with both API backend and web frontend for managing bank accounts, customers, and transfers.
Build an API for a fake financial institution with an administrative web interface. This application serves as a backend API that can be consumed by multiple frontends (web, iOS, Android, etc.) and includes a web admin panel for bank employees to manage accounts and transactions.
The application provides API routes and web interface to:
- ✅ Create new bank accounts with initial deposit amounts
- ✅ Support multiple bank accounts per customer
- ✅ Transfer amounts between any two accounts (including different customers)
- ✅ Retrieve account balances
- ✅ View transfer history for accounts
- ✅ Manage customer information
- ✅ Prevent negative account balances
- ✅ Web admin interface for all operations
- FastAPI - Modern Python web framework
- SQLModel - Database ORM with Pydantic integration
- PostgreSQL - Primary database
- Alembic - Database migrations
- Poetry - Dependency management
- Next.js 15 - React framework with Turbopack
- TypeScript - Type safety
- Material-UI (MUI) - UI component library
- SWR - Data fetching and caching
- Axios - HTTP client
- React Hook Form - Form handling
- Docker & Docker Compose - Containerization
- PostgreSQL 15 - Database container
Before setting up the project locally, ensure you have the following installed:
- Docker (v20.0+) and Docker Compose (v2.0+)
- Git for version control
- Node.js (v18+) and npm (for local frontend development)
- Python (v3.13+) and Poetry (for local backend development)
This is the easiest way to run the entire application stack:
-
Clone the repository
git clone <repository-url> cd bank-admin-app
-
Set up environment variables
# Create backend environment file cp backend/.env.example backend/.env # Edit the .env file with your database credentials
-
Start all services
docker-compose up --build
-
Access the applications
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
For development with hot reloading:
-
Navigate to backend directory
cd backend -
Install dependencies with Poetry
poetry install
-
Start PostgreSQL (using Docker)
docker-compose up postgres -d
-
Set up environment variables
cp .env.example .env # Edit .env with your database configuration -
Run database migrations
poetry run alembic upgrade head
-
Start the backend server
poetry run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
-
Navigate to frontend directory
cd frontend/app -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Access the frontend
- Open http://localhost:3000 in your browser
Once the backend is running, you can access:
- Interactive API Docs (Swagger): http://localhost:8000/docs
- ReDoc Documentation: http://localhost:8000/redoc
POST /api/v1/customers/- Create a new customerPOST /api/v1/accounts/- Create a new bank accountGET /api/v1/accounts/{account_id}- Get account details and balancePOST /api/v1/transferences/- Transfer money between accountsGET /api/v1/accounts/{account_id}/transferences- Get transfer history
bank-admin-app/
├── backend/ # FastAPI backend
│ ├── app/
│ │ ├── api/ # API routes
│ │ ├── models/ # SQLModel database models
│ │ ├── db.py # Database configuration
│ │ └── main.py # FastAPI application
│ ├── migrations/ # Alembic database migrations
│ ├── Dockerfile
│ └── pyproject.toml # Poetry dependencies
├── frontend/ # Next.js frontend
│ ├── app/
│ │ └── src/
│ │ ├── app/ # Next.js app directory
│ │ ├── components/ # Reusable components
│ │ ├── hooks/ # Custom React hooks
│ │ └── types/ # TypeScript type definitions
│ ├── Dockerfile
│ └── package.json
├── docker-compose.yml # Multi-service container setup
└── README.md
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Account balances are enforced to never be negative
- No authentication is implemented (as per requirements)
- The application uses PostgreSQL for data persistence
- All monetary values are handled as decimals for precision