Skip to content

Samuel-Tefera/lensey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

302 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lensey

AI-powered business intelligence for small and medium businesses.

FeaturesScreenshotsTech StackGetting StartedProject StructureLicense


About

Lensey helps business owners track sales, manage expenses, and understand their financial health through AI-powered insights — all from a single dashboard. Built for the Ethiopian market, it turns raw business data into clear recommendations so owners can make smarter decisions every day.


Features

  • Central Dashboard — Revenue, expenses, profit, and sales trends summarized in one real-time overview.
  • AI Insights — Business health score, anomaly detection, revenue forecasting, and actionable recommendations powered by Gemini AI.
  • Sales Tracking — Record transactions, visualize revenue patterns, identify top-selling products, and export data.
  • Expense Management — Log expenses, attach receipts, categorize spending, and get alerts on unusual cost spikes.
  • Product Catalog — Manage your full product inventory with pricing, margins, SKUs, and stock levels.
  • Data Tables — Spreadsheet-style views for bulk editing and managing all business records.
  • Authentication — Email/password and Google OAuth with Supabase Auth.
  • CSV Import/Export — Bulk upload and download your business data.

Screenshots

Dashboard AI Insights
Dashboard AI Insights
Sales Expenses
Sales Expenses
Products Data Tables
Products Data Tables

Tech Stack

Frontend

  • FrameworkNext.js 16 (App Router)
  • Language — TypeScript
  • Styling — Tailwind CSS + shadcn/ui
  • State — Zustand, React Query, React Context
  • Charts — Recharts
  • Animations — Framer Motion
  • Forms — React Hook Form + Zod

Backend

  • FrameworkFastAPI
  • Language — Python
  • Database — PostgreSQL (via Supabase)
  • ORM — SQLAlchemy + Alembic
  • Auth — Supabase Auth
  • AI — Google Gemini API

Getting Started

Prerequisites

1. Clone the repository

git clone https://github.com/Samuel-Tefera/lensey.git
cd lensey

2. Backend setup

cd backend
python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate
pip install -r requirements.txt

Create a .env file from the template and fill in your credentials:

cp .env.example .env
DATABASE_URL=postgresql://postgres:PASSWORD@db.PROJECT.supabase.co:5432/postgres
SUPABASE_URL=https://PROJECT.supabase.co
SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
ALLOWED_ORIGINS=http://localhost:3000
GEMINI_API_KEY=your-gemini-api-key
GENERATIVE_MODEL=gemini-2.0-flash

Get a Gemini API key — Go to Google AI Studio, sign in with your Google account, and generate a free API key. This powers all AI Insights features (health score, forecasting, recommendations).

Run database migrations and start the server:

alembic upgrade head
uvicorn app.main:app --reload

The API will be available at http://localhost:8000. Docs at /docs.

3. Frontend setup

cd web
npm install

Create a .env.local file from the template:

cp .env.example .env.local
NEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_SUPABASE_URL=https://PROJECT.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key

Start the development server:

npm run dev

The app will be available at http://localhost:3000.


AI Insights

Lensey uses Google Gemini to analyze your business data and generate actionable intelligence. This includes:

  • Business Health Score — A single 0–100 grade based on profit, growth, and expense control.
  • Anomaly Detection — Automatic alerts when revenue or expenses spike outside normal patterns.
  • Revenue Forecasting — 3-month projections using your historical data.
  • Trend Analysis — Period-over-period comparisons to track growth or flag risks.
  • Actionable Recommendations — 3–5 daily AI-generated tips based on your numbers.

For a detailed breakdown of how each insight works, see the Insights Owner's Guide.


Project Structure

lensey/
├── backend/
│   ├── app/
│   │   ├── api/v1/        # Route handlers
│   │   ├── models/        # SQLAlchemy models
│   │   ├── schemas/       # Pydantic schemas
│   │   ├── services/      # Business logic & AI insights
│   │   ├── core/          # Config & utilities
│   │   └── main.py        # FastAPI entrypoint
│   ├── alembic/           # Database migrations
│   └── requirements.txt
│
├── web/
│   └── src/
│       ├── app/
│       │   ├── (auth)/        # Login, signup, password reset
│       │   ├── (dashboard)/   # Core application pages
│       │   ├── (marketing)/   # Landing page
│       │   └── (onboarding)/  # First-time setup
│       ├── components/        # Shared UI components
│       ├── services/          # API client layer
│       ├── lib/               # Utilities & validators
│       └── types/             # TypeScript type definitions
│
└── docs/                  # Documentation & screenshots

License

This project is licensed under the MIT License.



Built by Samuel Tefera

About

Business intelligence tool for SMEs — sales tracking, expense management, and AI insights.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors