A full stack banking application using Node.js, React and MongoDB for deployment on Azure.
- Authentication & Authorization: JWT-based authentication with secure password hashing
- Account Management: Multiple account types (checking, savings, credit)
- Transaction Processing: Secure money transfers, deposits, and withdrawals
- Database: MongoDB with Mongoose ODM and atomic transactions
- Security: Rate limiting, input validation, CORS protection, helmet middleware
- API Documentation: RESTful API with comprehensive error handling
- Modern UI: Responsive design with Tailwind CSS
- Dashboard: Account overview with real-time balances
- Transaction Management: Transfer money between accounts with form validation
- Account Details: Transaction history with pagination
- Authentication: Secure login/registration with form validation
- State Management: Context API for authentication state
- User Management: Secure user profiles with encrypted passwords
- Account System: Multi-account support per user
- Transaction Ledger: Complete transaction history with references
- Indexes: Optimized queries for performance
- Container Apps: Scalable microservices architecture
- Container Registry: Private Docker image storage
- Infrastructure as Code: Bicep templates for reproducible deployments
- Monitoring: Application Insights and Log Analytics
- Security: Private networking and secure secrets management
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ React Frontend│◄──►│ Node.js API │◄──►│ MongoDB │
│ (Port 3000) │ │ (Port 3001) │ │ (Port 27017) │
│ │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Node.js 18+ and npm
- MongoDB 7+
- Docker (for individual containers if needed)
- Azure CLI (for deployment)
-
Clone the repository
git clone <repository-url>
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env cp backend/.env.example backend/.env cp frontend/.env.example frontend/.env
Update the environment files with your configuration.
-
Start MongoDB
# Using Docker (optional) docker run -d --name mongodb -p 27017:27017 mongo:7 # Or install MongoDB locally # Follow: https://docs.mongodb.com/manual/installation/
-
Start the application
# Start both frontend and backend npm run dev # Or start individually npm run backend:dev # Backend on http://localhost:3001 npm run frontend:dev # Frontend on http://localhost:3000
POST /api/auth/register
- User registrationPOST /api/auth/login
- User login
GET /api/accounts
- Get user accountsGET /api/accounts/:id
- Get account detailsGET /api/accounts/:id/transactions
- Get account transactions
POST /api/transactions/transfer
- Transfer money between accountsPOST /api/transactions/deposit
- Deposit moneyPOST /api/transactions/withdraw
- Withdraw money
GET /health
- Application health status
# Run backend tests
npm run backend:test
# Run frontend tests
npm run frontend:test
# Run all tests
npm run test
- Azure subscription
- Azure CLI installed and logged in
- Docker installed
-
Navigate to infrastructure directory
cd infrastructure/azure
-
Run deployment script
./deploy.sh
The script will:
- Create Azure resource group
- Deploy infrastructure using Bicep templates
- Build and push Docker images to Azure Container Registry
- Deploy container apps
- Configure networking and security
-
Create resource group
az group create --name banking-app-rg --location eastus
-
Deploy infrastructure
az deployment group create \ --resource-group banking-app-rg \ --template-file main.bicep \ --parameters environment=prod
-
Build and push images
# Login to ACR az acr login --name <registry-name> # Build and push backend docker build -t <registry>.azurecr.io/banking-backend:latest ./backend docker push <registry>.azurecr.io/banking-backend:latest # Build and push frontend docker build -t <registry>.azurecr.io/banking-frontend:latest ./frontend docker push <registry>.azurecr.io/banking-frontend:latest
- Authentication: JWT tokens with secure secret management
- Password Security: bcrypt hashing with salt rounds
- Input Validation: Express-validator for all API endpoints
- Rate Limiting: Protection against brute force attacks
- CORS: Configurable cross-origin resource sharing
- Helmet: Security headers for Express applications
- MongoDB Security: Connection string encryption and user authentication
- Container Security: Non-root user execution and minimal attack surface
NODE_ENV=development
PORT=3001
MONGODB_URI=mongodb://localhost:27017/banking
JWT_SECRET=your-super-secret-jwt-key
REACT_APP_API_URL=http://localhost:3001/api
banking-app/
├── backend/ # Node.js API server
│ ├── src/
│ │ ├── controllers/ # Route controllers
│ │ ├── models/ # MongoDB models
│ │ ├── routes/ # API routes
│ │ ├── middleware/ # Custom middleware
│ │ ├── services/ # Business logic
│ │ └── types/ # TypeScript types
│ ├── Dockerfile
│ └── package.json
├── frontend/ # React application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ ├── hooks/ # Custom hooks
│ │ └── types/ # TypeScript types
│ ├── Dockerfile
│ └── package.json
├── database/ # Database configuration
│ └── init-mongo.js # MongoDB initialization
├── infrastructure/ # Azure deployment
│ └── azure/
│ ├── main.bicep # Infrastructure template
│ └── deploy.sh # Deployment script
├── docker-compose.yml # Removed (use individual services)
└── README.md
This project is licensed under the MIT License