A digital business diary. Replaces the paper notebook where you scribble "spoke to so-and-so about tomatoes 3 days ago." Tracks contacts (suppliers, buyers, partners), interactions (dated diary entries with location, summary, follow-up), product categories, and firm deals with payment status.
Built with Next.js 14 + Supabase. Deploys free on Vercel.
- Contacts — add suppliers/buyers with phone, locality, address, notes
- Interactions — log conversations with date, location, what was discussed, follow-up date, and product line items (e.g. "Tomato, 200kg, ₹18/kg")
- Deals — turn talks into firm orders, track payment status
- Categories — taxonomy of products (Vegetables, Fruits, …)
- Team — invite teammates by email; everyone shares the same workspace
- Auth — email + password, magic link, or Google sign-in
- Mobile-friendly UI; works as a "save to home screen" app from your phone
cd "D:\projects\data manager"
npm install- Go to https://supabase.com → Start your project → sign in with GitHub.
- Click New project. Pick a name (e.g.
data-manager), set a database password, choose the region closest to you. Wait ~1 minute for provisioning. - From the project dashboard, open Settings → API. Copy these two values:
- Project URL (e.g.
https://abc123.supabase.co) - anon public key (a long
eyJ...string)
- Project URL (e.g.
In the Supabase dashboard:
- Open SQL editor → New query.
- Paste the entire contents of
supabase/migrations/0001_init.sqlandsupabase/migrations/0002_create_workspace_rpc.sqlfrom this repo. - Click Run. You should see "Success. No rows returned." This creates all tables, RLS policies, and the signup trigger.
Copy the example file:
Copy-Item .env.local.example .env.localOpen .env.local and paste in the two values from step 2:
NEXT_PUBLIC_SUPABASE_URL=https://YOUR-PROJECT.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...
NEXT_PUBLIC_SITE_URL=http://localhost:3000
If you only need email/password + magic link, skip this step.
In Supabase dashboard:
- Authentication → Providers → Google → enable.
- Follow the linked guide to create OAuth credentials in Google Cloud Console: https://supabase.com/docs/guides/auth/social-login/auth-google
- Paste the Client ID and Secret back into Supabase, save.
- Add
http://localhost:3000/auth/callbackto Google's authorized redirect URIs while testing locally; add your Vercel URL once deployed.
In Authentication → Providers → Email, you can turn off Confirm email during development so signups go straight through. Re-enable it before going live.
npm run devOpen http://localhost:3000. Sign up, name your workspace, and start logging.
- Push this folder to a GitHub repo (
git init && git add . && git commit ..., then create a repo on GitHub and push). - Go to https://vercel.com → Add New… → Project → import your repo.
- Environment Variables — paste the same three from
.env.local, but setNEXT_PUBLIC_SITE_URLto the URL Vercel will give you (e.g.https://data-manager-yourname.vercel.app). - Click Deploy. Done.
- Back in Supabase → Authentication → URL Configuration, add your Vercel
URL to Site URL and to the Redirect URLs allow-list (the bare URL
plus
/auth/callback). - If you enabled Google, add the production callback URL to Google's authorized redirect URIs too.
The free Vercel + Supabase tiers handle a small team's usage comfortably.
- Sign in.
- Go to Team → Invite.
- Enter their email and pick role (Admin/Member).
- Tell them to sign up at the same URL with that email. They'll be added automatically by the database trigger.
| Table | What it holds |
|---|---|
organizations |
Your business workspace |
members |
Who belongs to which workspace and their role |
invitations |
Pending team invites (auto-accepted on signup) |
categories |
Product taxonomy (Vegetables, Fruits, Spices…) |
contacts |
Suppliers, buyers, partners |
interactions |
Diary entries — who, when, where, what, follow-up |
interaction_items |
Line items for an interaction (category + qty + price) |
deals |
Firm transactions with payment status |
deal_items |
Line items for a deal |
Row Level Security ensures each workspace only sees its own data.
data manager/
├── supabase/migrations/0001_init.sql ← run this in Supabase SQL editor
├── src/
│ ├── app/
│ │ ├── (auth)/login,signup ← sign-in / sign-up pages
│ │ ├── auth/callback/route.ts ← OAuth + magic link landing
│ │ ├── onboarding/ ← first-time workspace setup
│ │ └── (app)/
│ │ ├── layout.tsx ← sidebar shell, auth guard
│ │ ├── dashboard/ ← stats + recent activity
│ │ ├── contacts/ ← list, new, [id], [id]/edit
│ │ ├── interactions/ ← list, new, [id], [id]/edit
│ │ ├── deals/ ← list, new, [id], [id]/edit
│ │ ├── categories/ ← manage product tags
│ │ └── team/ ← invite/list teammates
│ ├── components/ ← UI primitives + forms
│ ├── lib/supabase/ ← browser/server clients + middleware
│ ├── lib/types.ts ← typed schema
│ ├── lib/org.ts ← `requireOrg()` helper
│ └── middleware.ts ← cookie-based session refresh
└── README.md
npm run dev # start dev server on http://localhost:3000
npm run build # production build
npm run start # run production build locally
npm run typecheck # tsc --noEmit
npm run lint # next lint- Global search across contacts + interactions + deals
- Export to CSV / WhatsApp share
- Photo attachments for interactions (Supabase Storage)
- Reminders by email or push for follow-ups
- Reports: monthly purchases by supplier, by category, etc.
- Offline-first PWA install prompt
The schema is designed to extend — drop new columns or tables and add an
RLS policy that uses is_member_of(org_id).