๐ฐ Finora
AI-Powered Accounting Platform
A powerful, full-stack accounting application built with Next.js 15, featuring double-entry bookkeeping, multi-business support, AI-driven insights, and Stripe subscription billing.
โจ Features
๐ข Multi-Business Management
- Create and manage multiple businesses under a single account
- Switch between businesses seamlessly
- Business-scoped data isolation
๐ Double-Entry Bookkeeping
- Full chart of accounts with hierarchical structure
- Automatic journal entry generation
- Account types: Assets, Liabilities, Equity, Revenue, Expenses
- Balance tracking with debit/credit reconciliation
๐ณ Transaction Management
- Record income, expenses, and transfers
- Category-based organization
- Reference numbers and notes support
- Transaction reconciliation
๐ Analytics & Reporting
- Real-time financial dashboard
- Income vs expense trends
- Account balance summaries
- Custom financial reports
๐ Authentication & Security
- Secure session-based authentication via Better Auth
- Role-based access control (User/Admin)
- Protected API routes and middleware
๐ Subscription Tiers
- Free: 50 transactions, 1 business
- Pro: Unlimited transactions, 3 businesses, 30 AI queries/month
- Business: Everything unlimited, 150 AI queries/month
- Stripe integration for payment processing
๐ ๏ธ Tech Stack
| Category | Technology |
|---|---|
| Framework | Next.js 15.5 with Turbopack |
| Language | TypeScript 5.0 |
| UI Library | React 19 |
| Database | PostgreSQL + Prisma ORM |
| Authentication | Better Auth |
| API Layer | Hono (Type-safe REST API) |
| State Management | TanStack Query (React Query) |
| Styling | Tailwind CSS 4 |
| UI Components | shadcn/ui + Radix UI |
| Forms | React Hook Form + Zod |
| Payments | Stripe |
| Animations | GSAP + Lenis |
| 3D Graphics | Three.js + React Three Fiber |
| Charts | Recharts |
๐ Project Structure
src/
โโโ app/
โ โโโ (auth)/ # Authentication pages (login, register)
โ โโโ api/
โ โ โโโ [[...route]]/ # Hono API with catch-all routing
โ โ โโโ controllers/ # API controllers (business, transactions, etc.)
โ โโโ dashboard/ # Protected dashboard pages
โ โ โโโ accounts/ # Chart of accounts management
โ โ โโโ analytics/ # Financial analytics
โ โ โโโ business/ # Business management
โ โ โโโ categories/ # Category management
โ โ โโโ reports/ # Financial reports
โ โ โโโ transactions/ # Transaction management
โ โโโ pricing/ # Subscription pricing page
โโโ components/
โ โโโ auth/ # Authentication components
โ โโโ landing/ # Landing page sections
โ โโโ providers/ # React context providers
โ โโโ ui/ # shadcn/ui components
โโโ generated/
โ โโโ prisma/ # Generated Prisma client
โโโ hooks/ # Custom React hooks (TanStack Query)
โโโ lib/ # Utility functions and configurations
๐ Getting Started
Prerequisites
- Node.js v18 or higher
- pnpm package manager
- PostgreSQL database server
1. Clone the Repository
git clone <repository-url>
cd softcom-26
2. Install Dependencies
pnpm install
3. Set Up Environment Variables
Create a .env file in the root directory:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/financeflow?schema=public"
# Authentication
BETTER_AUTH_SECRET="your-secure-secret-key-here"
BETTER_AUTH_URL="http://localhost:3000"
# API URL (optional, defaults to localhost)
NEXT_PUBLIC_API_URL="http://localhost:3000"
# Stripe (for payments)
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
4. Set Up the Database
# Push schema to database
pnpm dlx prisma db push
# Generate Prisma client
pnpm dlx prisma generate
# (Optional) Seed with sample data
npx tsx seed/index.ts
5. Start Development Server
pnpm dev
Open http://localhost:3000 to view the application.
๐ Available Scripts
| Command | Description |
|---|---|
pnpm dev |
Start development server with Turbopack |
pnpm build |
Build for production |
pnpm start |
Start production server |
pnpm lint |
Run ESLint |
pnpm dlx prisma studio |
Open Prisma Studio (database GUI) |
pnpm dlx prisma db push |
Push schema changes to database |
pnpm dlx prisma generate |
Regenerate Prisma client |
๐๏ธ Database Schema
Core Models
- User - Authentication and profile
- Business - Multi-tenant business entities
- LedgerAccount - Chart of accounts with hierarchy
- Transaction - Income/expense/transfer records
- JournalEntry - Double-entry bookkeeping entries
- Category - Transaction categorization
- Subscription - Stripe subscription management
Account Types
| Type | Normal Balance | Examples |
|---|---|---|
| Asset | Debit | Cash, Accounts Receivable, Equipment |
| Liability | Credit | Accounts Payable, Loans |
| Equity | Credit | Owner's Equity, Retained Earnings |
| Revenue | Credit | Sales, Service Income |
| Expense | Debit | Rent, Utilities, Salaries |
๐ API Structure
The API is built with Hono and uses a catch-all route pattern:
/api/[...route]
โโโ /business # Business CRUD operations
โโโ /transactions # Transaction management
โโโ /ledger-accounts # Chart of accounts
โโโ /categories # Category management
โโโ /journal-entries # Journal entries
โโโ /analytics # Financial analytics
โโโ /reports # Financial reports
โโโ /stripe # Stripe webhooks & checkout
Type-Safe Client
import { client } from "@/lib/hono";
// Fully typed API calls
const response = await client.api.business.$get();
const businesses = await response.json();
๐จ UI Components
This project uses shadcn/ui components built on Radix UI primitives. Components are located in src/components/ui/.
Key components include:
- Forms with validation (React Hook Form + Zod)
- Data tables with sorting and filtering
- Charts and visualizations (Recharts)
- Modals, drawers, and sheets
- Toast notifications (Sonner)
๐ Authentication Flow
- Registration/Login - Email/password via Better Auth
- Session Management - Secure HTTP-only cookies
- Route Protection - Middleware-based access control
- API Security -
currentUser()helper for server-side auth
Protected Routes
Configure in src/routes.ts:
publicRoutes- Accessible without authauthRoutes- Auth pages (redirect if logged in)- All other routes require authentication
๐ณ Subscription System
Tiers
| Feature | Free | Pro | Business |
|---|---|---|---|
| Transactions | 50/month | Unlimited | Unlimited |
| Businesses | 1 | 3 | Unlimited |
| AI Queries | 0 | 30/month | 150/month |
| Price | $0 | $9.99/mo | $24.99/mo |
Stripe Integration
- Checkout sessions for upgrades
- Webhook handling for subscription events
- Automatic tier management
๐ค Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License.
**Built with โค๏ธ for modern accounting** [Report Bug](../../issues) ยท [Request Feature](../../issues)
Built With
- honojs
- langchain
- langraph
- nextjs
- postgresql
- react
- upstash
