Float is a banking web application simulator that allows users to perform financial transactions, manage profiles, and experience seamless authentication. Designed with data integrity and performance in mind, Float offers a robust platform for simulating banking activities.
- Technologies Used
- Features
- Setup and Installation
- Application Workflow
- File Structure
- Development Practices
- Demo
- Future Improvements
- Frontend: Vite + React
- Backend: Express.js + Node.js
- Database: MongoDB
- Design: TailwindCSS
- Authentication: Custom authentication using JWT and bcrypt
-
User Authentication:
- Secure sign-up and login using JWT for token-based authentication.
- Passwords hashed with bcrypt before storage for enhanced security.
-
Atomic Transactions:
- Transfers between users are ensured to be atomic, leveraging MongoDB’s transaction feature.
- Prevents partial updates (e.g., deduction without addition).
-
Random Balance Allocation:
- On sign-up, each user is assigned a random balance to simulate initial funds.
-
Search and Send:
- Users can search for other registered users and send money to them directly.
-
Profile Management:
- Users can update their profiles dynamically.
-
Automatic Redirection:
- Persistent login sessions ensure users are redirected to their dashboard upon revisiting.
- Debouncing:
- Optimized performance in input fields to reduce unnecessary re-renders.
- Node.js (v16 or higher)
- MongoDB installed locally or hosted on a cloud platform.
-
Clone the repository:
git clone <repository-url> cd float
-
Set up the Backend:
cd backend npm install-
Create a
.envfile in thebackenddirectory with the following:FRONTEND_URL=<your-frontend-url> MONGODB_URI=<your-mongodb-uri> JWT_SECRET=<your-secret-key> -
Start the server:
npm start
-
-
Set up the Frontend:
cd ../frontend npm install-
Create a
.envfile in thefrontenddirectory with the following:VITE_API_URL=<your-backend-url> -
Start the server:
npm run dev
-
-
Open the application in your browser at:
http://localhost:<frontend-port>
-
User Signs Up/Logs In:
- Users are assigned a random balance upon sign-up.
- Credentials are securely handled with JWT for token authentication.
- Persistent login allows users to bypass repeated logins.
-
Transaction Execution:
- Uses MongoDB transactions to ensure atomicity.
- If any issue occurs during deduction/addition, the entire transaction is rolled back.
-
Search and Send:
- Users can search for other registered users by name and transfer money to them.
-
Profile Updates:
- Users can dynamically update their profile information, which gets reflected in the UI instantly.
-
Dashboard Redirection:
- After authentication, users are redirected to a personalized dashboard showing their current balance.
backend/
│
├── config/ # Configuration files (e.g., input validation, JWT secrets)
├── db/ # Database connection and schema definitions
├── middlewares/ # Custom middleware logic
├── routes/ # API route definitions
├── public/ # Static assets
└── index.js # Main server file
frontend/
│
├── src/ # React components and logic
├── public/ # Public assets (favicon, images, etc.)
├── tailwind.config.js # TailwindCSS configuration
├── vite.config.js # Vite configuration
└── index.html # Entry point
-
Custom Authentication:
- Designed from scratch to securely manage user sessions with JWT and hashed passwords.
-
Atomic Transactions:
- Handled critical operations like fund transfers using MongoDB's transactional capabilities.
-
Performance Optimization:
- Debouncing techniques applied to prevent redundant renders and enhance input performance.
-
Design Consistency:
- TailwindCSS used to ensure responsive and clean UI design.
You can view this website live here.
Note:- The backend server is on a free tier, so it may take some time to load if inactive. Please be patient.
- Add support for third-party authentication (e.g., Google, Facebook).
- Implement detailed transaction history with filtering options.
- Enhance UI/UX with advanced TailwindCSS components.
- Auto-Fetch Balance Updates:
- Implement polling to the database to automatically fetch balance changes in real-time.
- Integrate email notifications for key user actions.