Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ build/Release
node_modules/
jspm_packages/

# Meteor local build artifacts
.meteor/local

# macOS Finder metadata
.DS_Store

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

Expand Down
19 changes: 19 additions & 0 deletions .meteor/.finished-upgraders
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file contains information which helps Meteor properly upgrade your
# app when you run 'meteor update'. You should check it into version control
# with your project.

notices-for-0.9.0
notices-for-0.9.1
0.9.4-platform-file
notices-for-facebook-graph-api-2
1.2.0-standard-minifiers-package
1.2.0-meteor-platform-split
1.2.0-cordova-changes
1.2.0-breaking-changes
1.3.0-split-minifiers-package
1.4.0-remove-old-dev-bundle-link
1.4.1-add-shell-server-package
1.4.3-split-account-service-packages
1.5-add-dynamic-import-package
1.7-split-underscore-from-meteor-base
1.8.3-split-jquery-from-blaze
1 change: 1 addition & 0 deletions .meteor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
local
7 changes: 7 additions & 0 deletions .meteor/.id
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file contains a token that is unique to your project.
# Check it into your repository along with the rest of this directory.
# It can be used for purposes such as:
# - ensuring you don't accidentally deploy one app on top of another
# - providing package authors with aggregated statistics

f13qjxma99ghm.gasvfpq72l4a
18 changes: 18 additions & 0 deletions .meteor/packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Meteor packages used by this project
# Each line is a package name followed by an optional version constraint.
# See https://docs.meteor.com/ for more info.

meteor-base@1.5.2
mongo@2.1.4
blaze-html-templates
reactive-var@1.0.13
ostrio:flow-router-extra
tracker@1.3.4
ecmascript@0.16.13
typescript@5.6.6
jquery
standard-minifier-css
standard-minifier-js
shell-server
dynamic-import
underscore
2 changes: 2 additions & 0 deletions .meteor/platforms
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
browser
server
1 change: 1 addition & 0 deletions .meteor/release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
METEOR@3.3.2
76 changes: 76 additions & 0 deletions .meteor/versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
allow-deny@2.1.0
autoupdate@2.0.1
babel-compiler@7.12.2
babel-runtime@1.5.2
base64@1.0.13
binary-heap@1.0.12
blaze@3.0.2
blaze-html-templates@3.0.0
blaze-tools@2.0.0
boilerplate-generator@2.0.2
caching-compiler@2.0.1
caching-html-compiler@2.0.0
callback-hook@1.6.1
check@1.4.4
core-runtime@1.0.0
ddp@1.4.2
ddp-client@3.1.1
ddp-common@1.4.4
ddp-server@3.1.2
diff-sequence@1.1.3
dynamic-import@0.7.4
ecmascript@0.16.13
ecmascript-runtime@0.8.3
ecmascript-runtime-client@0.12.3
ecmascript-runtime-server@0.11.1
ejson@1.1.5
es5-shim@4.8.1
facts-base@1.0.2
fetch@0.1.6
geojson-utils@1.0.12
hot-code-push@1.0.5
html-tools@2.0.0
htmljs@2.0.1
id-map@1.2.0
inter-process-messaging@0.1.2
jquery@3.0.2
logging@1.3.6
meteor@2.1.1
meteor-base@1.5.2
minifier-css@2.0.1
minifier-js@3.0.4
minimongo@2.0.4
modern-browsers@0.2.3
modules@0.20.3
modules-runtime@0.13.2
mongo@2.1.4
mongo-decimal@0.2.0
mongo-dev-server@1.1.1
mongo-id@1.0.9
npm-mongo@6.16.1
observe-sequence@2.0.0
ordered-dict@1.2.0
ostrio:flow-router-extra@3.12.1
promise@1.0.0
random@1.2.2
react-fast-refresh@0.2.9
reactive-dict@1.3.2
reactive-var@1.0.13
reload@1.3.2
retry@1.1.1
routepolicy@1.1.2
shell-server@0.6.2
socket-stream-client@0.6.1
spacebars@2.0.0
spacebars-compiler@2.0.0
standard-minifier-css@1.9.3
standard-minifier-js@3.1.1
templating@1.4.4
templating-compiler@2.0.0
templating-runtime@2.0.1
templating-tools@2.0.0
tracker@1.3.4
typescript@5.6.6
underscore@1.6.4
webapp@2.0.7
webapp-hashing@1.1.2
3 changes: 3 additions & 0 deletions .meteorignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Exclude linting and dev tooling configs from Meteor build
eslint.config.mjs
/.vscode/
128 changes: 126 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,126 @@
# Splitly
Scan, Split & Simplify Shared Expenses
# Splitly (Meteor Expense Splitting App)

Offline-friendly expense splitting app built with Meteor + Blaze + Bootstrap.

## Features

- ✅ Create and manage expense bills with multiple users
- ✅ Split expenses equally among selected users per item
- ✅ Add/remove users dynamically in edit mode
- ✅ OCR receipt scanning with Tesseract.js
- ✅ Offline support with IndexedDB caching
- ✅ Responsive mobile-first design
- ✅ Real-time updates with Meteor reactivity
- ✅ Bill history and analysis views
- ✅ Settings management

## Structure (flattened root)
```
.meteor/ # Meteor internal config
package.json # App dependencies
config/app.config.json # Feature flags & provider stubs
client/main.js # Client entrypoint (imports routes)
server/main.ts # Server startup & publications import
imports/
api/ # Collections, models, publications, methods
models.ts # Data interfaces + computeExpenseSummary()
bills.ts # Bills collection + Meteor methods
publications.ts # Meteor.publish definitions
infra/
indexedDb.ts # Offline cache (IndexedDB via idb)
startup/client/routes.js # FlowRouter + BlazeLayout route definitions
ui/blaze/ # Blaze UI layer
layout.{html,js} # Main layout (navbar, alerts, spinner)
pages/ # Dashboard, NewBill, History, Analysis, BillDetail, Settings
types/ (legacy shims) # Ambient TS shims (React removed)
```

## Core Features
| Feature | Status |
|---------|--------|
| Routing & Navigation (FlowRouter + Blaze) | ✅ |
| MongoDB persistence | ✅ |
| IndexedDB offline cache (flagged) | ✅ (basic sync) |
| Feature flags (config + localStorage overrides) | ✅ |
| Equal / Percent / Fixed splits (UI + logic) | ✅ (percent validates ~100%) |
| Share editor per item | ✅ |
| OCR stub ingestion (textarea parse) | ✅ (stub; real OCR pending) |
| Multi-bill history + detail view | ✅ |
| Analysis page (filter + inline bar) | ✅ (charts enhancement pending) |
| Settings page | ✅ |
| Alerts (success/error toasts, Blaze) | ✅ |
| Loading indicators (initial sync / OCR) | ✅ |

## Data Model Summary
- UserProfile: `{ id, name, contact?, preferences? }`
- Item: `{ id, name, price, userIds[], splitType?, shares? }` where `splitType` in `equal|percent|fixed` and `shares` entries each carry `type` + `value`.
- BillDoc: `{ _id?, createdAt, updatedAt?, users[], items[], currency? }`
- ExpenseSummary: derived totals per user; percent shares auto-scaled if not exactly 100%; fixed remainder distributed evenly.

## Offline Flow
1. On initial load (subscription not ready & empty Minimongo): load cached bills from IndexedDB.
2. When subscription becomes ready: cache latest bills back to IndexedDB.
3. Future: diff/merge strategy & stale detection.

## Running

```bash
# Install dependencies
meteor npm install

# Start development server
npm start
# or
meteor run

# Lint code
npm run lint

# Fix lint issues automatically
npm run lint:fix

# Build for production
npm run build

# Deploy to Meteor servers (optional)
npm run deploy
```

Open: http://localhost:3000

## Configuration Flags
`config/app.config.json`
```json
{
"features": { "indexedDbSync": true, "analysisPage": true },
"api": { "ocrProvider": "stub" }
}
```
Disable Analysis Page by setting `analysisPage: false`.

Feature flags are read in Blaze templates (`layout.js`, `settings.js`) via localStorage overrides (`flag_<name>`). A refresh applies route gating changes.

## Next Enhancements
1. Real OCR (image/PDF upload + provider integration).
2. User rename + reuse across bills; bill title field.
3. More robust percent/fixed validation UI (visual totals meter).
4. Advanced Analysis (pie chart, time series, multi-bill aggregates).
5. Offline merge conflict & stale detection strategy.
6. Tests: unit (computeExpenseSummary), methods validation, offline loader.
7. Decide on TypeScript retention vs full JS (Blaze code uses plain JS modules; models/methods remain TS for now).
8. Import/export (CSV), multi-currency support.
9. Authentication & per-user ownership.
10. Performance tuning & Lighthouse pass.

## Contributing Guidelines
- Keep features incremental; one page / one method at a time.
- Maintain data model single source (`models.ts`).
- Add tests alongside new logic.
- Avoid silent failures; surface errors in UI.
- Remove temporary type shims once real types integrated.

## License
TBD (add license file if distributing publicly).

---
Legacy React layer removed; repository now focuses on a lean Meteor + Blaze implementation.
9 changes: 9 additions & 0 deletions client/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<head>
<title>Splitly - Split Bills & Expenses</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
</head>
<body>
<div id="app"></div>
</body>
17 changes: 17 additions & 0 deletions client/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'bootstrap/dist/css/bootstrap.min.css';
// Import Bootstrap components individually to ensure they're available
import { Modal, Collapse, Dropdown } from 'bootstrap';
import { Meteor } from 'meteor/meteor';

// Make Bootstrap components available globally
Meteor.startup(() => {
if (typeof window !== 'undefined') {
window.bootstrap = window.bootstrap || {};
window.bootstrap.Modal = Modal;
window.bootstrap.Collapse = Collapse;
window.bootstrap.Dropdown = Dropdown;
}
});

// Blaze layout & routes are defined under imports/startup/client.
import '/imports/startup/client/routes';
Loading