productledger
v0.1.0
Published
<div align="center"> <h1> π’ Product Ledger Management System </h1>
Downloads
5
Readme
A comprehensive business ledger management system for product-selling companies with real-time data synchronization, overdue management, and intelligent credit limit handling.
π Live Demo β’ π Documentation β’ π Report Bug β’ π‘ Request Feature
π Overview
The Product Ledger Management System is a full-stack web application designed for product-selling companies to efficiently manage their financial transactions, customer relationships, and inventory. Built with modern technologies, it provides real-time data synchronization, intelligent overdue management, and automated credit limit adjustments.
β¨ Key Highlights
- π Real-time Data Sync - IndexedDB + MongoDB integration
- π° Smart Credit Management - Dynamic credit limit adjustments
- π Comprehensive Reporting - Revenue, product, and overdue analytics
- π Automated Overdue Tracking - Intelligent interest and fine calculations
- π± Responsive Design - Works seamlessly across all devices
- π Secure Authentication - NextAuth.js with multiple providers
- π§ Email Integration - Automated notifications and password reset
ποΈ System Architecture
graph TB
subgraph "Frontend Layer"
A["Next.js 14 App Router"]
B["React Components"]
C["Tailwind CSS"]
D["shadcn/ui"]
end
subgraph "Authentication"
E["NextAuth.js"]
F["Google OAuth"]
G["Email Provider"]
end
subgraph "API Layer"
H["REST API Routes"]
I["Server Actions"]
J["Middleware"]
end
subgraph "Data Layer"
K["MongoDB Atlas"]
L["IndexedDB"]
M["Real-time Sync"]
end
subgraph "External Services"
N["Email Service"]
O["Cron Jobs"]
P["PDF Generation"]
end
A --> B
B --> C
B --> D
A --> E
E --> F
E --> G
A --> H
H --> I
H --> J
H --> K
K --> L
L --> M
H --> N
O --> K
H --> Pπ Features
- Customer Management: Add, update, and track customer details with credit limits and transaction history.
- Transaction Ledger: Record sales, payments, and adjustments with real-time updates.
- Overdue Alerts: Automated notifications for overdue payments with customizable interest rates.
- Inventory Tracking: Monitor stock levels and integrate with sales data.
- Analytics Dashboard: Visualize revenue trends, product performance, and overdue accounts.
- PDF Reports: Generate professional invoices and account statements.
- Multi-user Support: Role-based access control for team collaboration.
π οΈ Installation
Prerequisites
- Node.js 18.x or higher
- MongoDB Atlas account
- Google OAuth credentials (for authentication)
- Email service provider (e.g., SendGrid, Nodemailer)
Steps
Clone the Repository
git clone https://github.com/your-repo/product-ledger.git cd product-ledgerInstall Dependencies
npm installSet Up Environment Variables Create a
.env.localfile in the root directory and add the following:MONGODB_URI=MONGODB CONNECTION URI MONGODB_DB=Database name NEXTAUTH_SECRET=secret key NEXTAUTH_URL=https://product-ledger.vercel.app/ EMAIL_SERVER_HOST=smtp.gmail.com EMAIL_SERVER_PORT=587 EMAIL_SERVER_USER=user mail-id EMAIL_SERVER_PASSWORD=google generated password EMAIL_FROM=From mail-idRun the Application
npm run devOpen
http://localhost:3000in your browser.
π₯οΈ Usage
- Sign Up/Login: Use Google OAuth or email-based authentication to access the system.
- Dashboard: View key metrics like total revenue, overdue accounts, and inventory status.
- Add Customers: Input customer details and set credit limits.
- Record Transactions: Log sales, payments, or adjustments in the ledger.
- Generate Reports: Export invoices or account statements as PDFs.
- Monitor Overdues: Receive automated alerts for overdue payments and apply interest/fines.
π§ͺ Development
Tech Stack
- Frontend: Next.js 14 (App Router), React, TypeScript, Tailwind CSS, shadcn/ui
- Backend: Next.js API Routes, Server Actions, MongoDB Atlas
- Authentication: NextAuth.js (Google OAuth, Email)
- Database: MongoDB with IndexedDB for offline sync
- External Services: Email notifications, PDF generation, cron jobs for scheduled tasks
Project Structure
product-ledger/
βββ app/ # Next.js App Router
βββ components/ # React components
βββ lib/ # Utility functions and configurations
βββ models/ # MongoDB schemas
βββ public/ # Static assets
βββ styles/ # Tailwind CSS and global styles
βββ .env.local # Environment variables
βββ next.config.js # Next.js configuration
βββ tsconfig.json # TypeScript configurationπ³ Deployment
Deploy to Vercel
- Push your repository to GitHub.
- Connect your repository to Vercel.
- Configure environment variables in Vercelβs dashboard.
- Deploy the application with a single click.
Deploy to Other Platforms
- Use Docker for containerized deployment.
- Configure MongoDB Atlas for production-grade database hosting.
- Set up cron jobs for scheduled tasks (e.g., overdue notifications).
π€ Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m 'Add your feature'). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
π License
This project is licensed under the MIT License. See the LICENSE file for details.
π Contact
For questions or support, reach out to:
- Email: [email protected]
- GitHub Issues: Report a Bug
- Feature Requests: Request a Feature
π Acknowledgments
- Next.js for the robust framework
- MongoDB Atlas for scalable database solutions
- Tailwind CSS for rapid UI development
- shadcn/ui for accessible UI components
- NextAuth.js for secure authentication
