A comprehensive financial intelligence platform designed for Small and Medium Businesses to monitor, analyze, and optimize their financial health in real-time.
- Interactive Data Visualizations: Multiple chart types to visualize key business metrics
- Financial KPIs: Real-time tracking of revenue, expenses, profit margins, and more
- Customer Segmentation: Breakdown of customer distribution by business size
- Sales Funnel Analysis: Track conversion rates throughout the sales pipeline
- Cash Flow Management: Monitor cash inflows and outflows over time
- Financial Health Metrics: Visual indicators of key financial ratios
- Transaction Tracking: Recent transaction history with filtering capabilities
- Responsive Design: Fully responsive layout that works on all device sizes
- Light/Dark Mode: Themeable UI with light and dark mode support
- Frontend Framework: Next.js 14
- UI Components: shadcn/ui
- Styling: Tailwind CSS
- Charts: ApexCharts
- TypeScript: Type-safe code
- React 18: Latest React features with Server Components
- State Management: React's built-in state management with Context API
- Node.js 18.x or later
- npm or yarn
-
Clone the repository:
git clone https://github.com/yourusername/bufi-dashboard.git cd bufi-dashboard -
Install dependencies:
npm install # or yarn install -
Run the development server:
npm run dev # or yarn dev -
Open http://localhost:3000 in your browser to see the application.
The dashboard is composed of several key visualizations:
- KPI Cards: Overview of monthly revenue, expenses, net profit, and cash balance
- Key Performance Indicators: Radial gauges showing sales targets, customer retention, profit margin, and ROI
- Revenue & Expenses Chart: Bar chart comparing revenue and expenses over 6 months
- Customer Segments Chart: Donut chart showing distribution of customers by business size
- Sales Funnel Chart: Horizontal bar chart tracking lead conversion through the sales pipeline
- Cash Flow Timeline Chart: Area chart showing cash inflows and outflows throughout the year
- Financial Health Metrics: Progress bars visualizing key financial ratios
- Recent Transactions Table: Tabular data of recent financial activities
bufi-dashboard/
βββ app/ # Next.js app directory
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Main dashboard page
βββ components/ # React components
β βββ ui/ # shadcn UI components
β βββ client-revenue-chart.tsx
β βββ customer-segments-chart.tsx
β βββ sales-funnel-chart.tsx
β βββ cashflow-timeline-chart.tsx
β βββ kpi-radial-charts.tsx
β βββ progress.tsx
β βββ theme-provider.tsx
βββ lib/ # Utility functions
β βββ utils.ts
βββ public/ # Static assets
βββ styles/ # Additional styles
βββ next.config.js # Next.js configuration
βββ package.json # Dependencies
βββ postcss.config.js # PostCSS configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
The dashboard is designed to work with a financial database with the following core entities:
- Transactions: Financial transactions with amount, date, type, etc.
- Customers: Business clients with size, industry, status, etc.
- Accounts: Financial accounts with balances and types
- Categories: Transaction categorization system
- Products: Goods and services sold
- Sales: Sales records with dates, amounts, and status
- Financial Metrics: Pre-calculated business indicators
- Cash Flow: Aggregated cash movement records
- Sales Funnel: Sales pipeline tracking by stage
Create a .env.local file in the root directory with the following variables:
NEXT_PUBLIC_API_URL=your_api_url
This application can be deployed to Vercel with a single click:
# Run unit tests
npm run test
# Run end-to-end tests
npm run test:e2eContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your 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
This project is licensed under the MIT License - see the LICENSE file for details.
For any inquiries, please reach out to:
- Email: [email protected]
- Website: https://bufi-finance.com
Built with β€οΈ by the Bufi Team
- MySQL Server 5.7+ or MySQL 8.0+
- Node.js 14.0+
- npm or yarn
-
Create MySQL Database
CREATE DATABASE bufi_finance; USE bufi_finance;
-
Run Schema Script
Save the database schema to a file (e.g.,
schema.sql) and run:mysql -u your_username -p bufi_finance < database/schema.sqlOr you can copy and paste the contents of
database/schema.sqlinto your MySQL client. -
Seed Sample Data (Optional)
mysql -u your_username -p bufi_finance < database/seed_data.sql -
Configure Environment Variables
Create a
.env.localfile in the project root with:DB_HOST=localhost DB_USER=your_mysql_username DB_PASSWORD=your_mysql_password DB_NAME=bufi_finance DB_PORT=3306 NEXT_PUBLIC_API_URL=http://localhost:3000/api NODE_ENV=development
The database includes the following tables:
- users: Application users with authentication information
- customer_segments: Categories of customers
- customers: Customer information and metadata
- revenue_categories: Types of revenue sources
- expense_categories: Types of expenses
- transactions: All financial transactions (both revenue and expenses)
- sales_stages: Stages in the sales pipeline
- sales_funnel_entries: Customer journey through the sales pipeline
- cashflow_projections: Future cash flow forecasts
- kpi_metrics: Key performance indicators and targets
The application provides the following API endpoints:
- GET /api/dashboard: Get all dashboard data in a single request
- GET /api/transactions: Get transactions with optional filtering
- POST /api/transactions: Create a new transaction
- PATCH /api/transactions/:id: Update an existing transaction
- DELETE /api/transactions/:id: Delete a transaction
-
Install Dependencies
npm install # or yarn install -
Run Development Server
npm run dev # or yarn dev -
Open Application
Navigate to http://localhost:3000 in your browser.
The database/queries.sql file contains a collection of useful queries for:
- Dashboard overview metrics
- Revenue and expense analysis
- Customer segment analysis
- Sales funnel metrics
- Cash flow projections
- KPI performance tracking
- Transaction reporting
For production deployment:
-
Setup a Production MySQL Database
Configure your production database and update environment variables accordingly.
-
Build the Application
npm run build # or yarn build -
Start the Production Server
npm start # or yarn start
-
Backup Database
mysqldump -u username -p bufi_finance > bufi_finance_backup.sql -
Restore Database
mysql -u username -p bufi_finance < bufi_finance_backup.sql -
Running Direct Queries
You can use the MySQL command line client or a GUI tool like MySQL Workbench:
mysql -u username -p bufi_finance
This project is licensed under the MIT License.
