A minimal, self-contained, high-performance Progressive Web App (PWA) for managing weekly water motor rotation duties and tracking building maintenance bills, collections, and repair issues for apartment residents.
- Repository: https://github.com/krishnakanthb13/54-GNs
- Live:
https://54-gn-s.vercel.app/#billsopens Bills directly ยทhttps://54-gn-s.vercel.app/#issuesopens Issues directly
- Auto-Calculated Schedule: Computes weekly rotation automatically from a base date. No hardcoded or manual schedules required.
- Real-Time Status Card: Displays today's date, ISO week number, week date range, active flat, and a dynamic color-coded countdown to the next rotation.
- Responsible Flat Highlight: Large, high-visibility duty card showing active flat and tenant name, cycle progress (e.g.
Flat 5 of 8), and duty date duration. - Rotation Timeline: Visual quick-glance at Previous, Current, and Next flats with week numbers.
- Search Flat: Instant lookup for any flat to see upcoming duty dates and past rotation history.
- Instructions: Categorized guidelines for Morning, Evening, Unavailable (WhatsApp delegation), and Emergency handling.
- Monthly Calendar: Visual calendar highlighting the current day and active duty week.
- 8-Week Schedule Tables: Full transparent view of upcoming and previous 8-week duty schedules with flat and tenant details.
- Export & Share: Quick actions to Copy week summary, Native Share (WhatsApp/mobile), CSV Export, and PDF/Print.
- Auto-Synced with
maintenance.txt: Simply editmaintenance.txtto add expenses, collections, or issues; the app fetches it with cache-busting (?t=Date.now()) using a network-first strategy โ the Service Worker only keeps the last good copy as an offline fallback, so edits appear immediately when online without rebuilds. - Dedicated Bills Page (
#bills): Full-page view with headerโ Backbutton and URL deep-linking (#bills). Opened from the header ๐งพ button. - Expenses / Paid Tabs (inside Bills page only):
๐ Expenses(default) โ existing expense behavior, unchanged.โ Paidโ separate collections view with its own summary, search, and list.- Switching tabs swaps the summary card, search box, and list; the Copy button label follows the active tab (
๐ Copy Summary/๐ Copy Paid Summary).
- Expenses View:
- Automatically totals each billing period (
- Month Year) and calculates Per Flat Share (รท 8) with Indian Rupee formatting (โน). - Monthly headers (e.g.
- August 2026) show a๐ Monthlytag; date headers (e.g.- 29 July 2026) show aโก Additional Expenseamber card. - Empty months (e.g.
- October 2026with no items) render asNo entrieswith no totals. - Summary card: Total Expenses, Per Flat (รท8), Recorded Cycles (
X Monthly ยท Y Additional). - Live search filters by month or utility (e.g.
Electric,May).
- Automatically totals each billing period (
- Paid View:
- Parses collection lines under
= Paid =(format- DATE: TYPE: AMOUNT, e.g.- 4 September 2026: Monthly: 513). - Lines starting with
+are treated as Additional collections (amber styling, โก badge) โ e.g.+ 29 July 2026: Drainage: 315. - Each entry renders as a card: monthly entries get a green-accent card with a ๐ฐ type badge; additional entries get an orange-accent card (full amber tint) with a โก type badge.
- Summary card: Total Collected, Entries, Records โ โ Records shows counts like
7 Monthly ยท 3 Additional; the โ button opens a Paid Breakdown modal with each collection type on its own line (๐ฐ for monthly, โก for additional) plus a Total row. - Live search filters by date or type (e.g.
Monthly,Drainage,July). - Paid Notes & Disclaimers: Contextual notes card seamlessly integrated into the Paid page:
- Payment Dates Note: Explains that payment dates are recorded for Flat 7, and payment dates for other flats should fall around approximately the same dates.
- Reconciliation Ledger: Explains that paid amounts represent a single tenant's share (total building expenses รท 8) with historical discrepancy audit notes.
- Empty state:
No paid collections recorded yet.
- Parses collection lines under
- One-Click Actions:
- ๐ Copy Summary: active-tab aware โ Expenses formats every period with totals for WhatsApp; Paid lists each
โ date - type: amount(adding(Additional)to+lines) plus a total, separate๐ Monthly:/โก Additional:subtotals, and the Flat 7 payment date note. - ๐จ๏ธ PDF / Print: print-optimized layout; header, footer, actions, search, tabs, and modal are hidden in print.
- ๐ Copy Summary: active-tab aware โ Expenses formats every period with totals for WhatsApp; Paid lists each
- Flat-File Database via
= Issues =: Seamlessly tracks apartment and building repair/maintenance issues directly inmaintenance.txt. - Dedicated Issues Page: Accessible via the header
โ ๏ธbutton or#issuesURL deep-linking with headerโ Backnavigation. - Automatic Duration Pill (
โฑ๏ธ): Automatically calculates elapsed duration betweenStartDateandEndDate(e.g.โฑ๏ธ 4 days), or fromStartDateto today if pending/ongoing (โฑ๏ธ 197 days (Ongoing)). - Template Skipping: Automatically filters out empty issue templates (such as blank templates left at the top of the section for formatting), only displaying issues with actual logged data.
- 9-Mode Sort Dropdown (
๐ Sort):Default (File): Original order as listed in the maintenance text file.Title (AโZ): Alphabetical ascending by issue name.Title (ZโA): Alphabetical descending by issue name.Start Date (Newest): Most recently started issues first.Start Date (Oldest): Earliest started issues first.End Date (Newest): Most recently completed issues first (ongoing issues listed first).End Date (Oldest): Earliest completed issues first (pending issues listed last).Status (Pending First): Prioritizes unresolved/pending issues over completed ones.Status (Completed First): Lists resolved/completed issues before unresolved/pending ones.
- Summary Metrics Card:
- Total Issues Logged
- Resolved (
โ) - Pending (
โณ)
- Live Search: Instant keyword filtering across title, status, start/end dates, and multi-line context bullet points.
- Context & Timeline: Detailed problem descriptions, steps taken, resolution timelines, and owner communication logs.
- Flat 7 Transparency Note: Contextual footer note explaining that the log documents issues faced by Flat 7 for accountability and landlord reference.
- Export & Print:
- ๐ Copy Issues: Copies formatted WhatsApp-ready text summary of all issues with start/end dates, duration, and context details.
- ๐ PDF / Print: Print-optimized styling with avoidance of awkward page breaks.
Cycles through 6 curated themes across dark and light modes with persistent localStorage preference and mobile <meta name="theme-color"> syncing:
| Icon | Theme Name | Mode | Description |
|---|---|---|---|
| ๐ | Dark Slate | Dark | Deep Navy / Sky Blue accent (Default) |
| ๐ฎ | Obsidian Violet | Dark | Midnight Violet / Purple Neon accent |
| ๐ฒ | Forest Emerald | Dark | Deep Midnight Pine / Mint Emerald accent |
| โ๏ธ | Pure Sky | Light | Crisp Cool Slate / Ocean Blue accent |
| โ | Warm Sand | Light | Cozy Parchment / Amber Terracotta accent |
| ๐ | Fresh Mint | Light | Soft Mint Pastel / Forest Sage accent |
A lightweight, glassmorphic toast notification system (#toastContainer) providing immediate, non-intrusive feedback across the app:
- Clipboard & Sharing Actions: Instant confirmations for copying duty week info, maintenance bills summary, paid collection logs, and issues summaries (
๐ Copied...). Empty data guards notify when there is nothing to copy. - Sort Feedback: Displays the active sort criteria when the issue sort order changes (
๐ Sorted by ...). - File Downloads & Print: Confirms CSV export generation (
๐ Exported motor rotation schedule (CSV)!) and print dialog preparation (๐จ๏ธ Preparing printable document...). - Theme Cycling Feedback: Confirms every theme switch (e.g.
๐ Theme: Obsidian Violet (Dark)). - Live Search Guard: Alerts residents when search filters yield zero matches across flats, bills, collections, or issues (
๐ No flat/bills/collections/issues matching "..."). - Network & Offline Awareness: Informs residents when connection is lost (
๐ถ You are currently offline), when no cached records exist yet (๐ถ Offline: no cached records available yet), and when syncing back online (๐ Back online! Syncing records...). While offline, the Service Worker serves the last cachedmaintenance.txt. - PWA Lifecycle Updates: Detects when a new Service Worker update is downloaded and ready (
๐ New version available! Reload to apply.).
All configuration is located at the top of assets/js/script.js:
// Starting anchor date (must be a Monday)
const START_DATE = "2026-06-01";
// 8 Flats and corresponding tenant names
const FLATS = [
{ name: "Flat 1", tenant: "Sathyanarayana G" },
{ name: "Flat 2", tenant: "Bala Subramaniam" },
{ name: "Flat 3", tenant: "Balaji" },
{ name: "Flat 4", tenant: "Gopal" },
{ name: "Flat 5", tenant: "Kishore" },
{ name: "Flat 6", tenant: "Venkatesan" },
{ name: "Flat 7", tenant: "Krishna Kanth B" },
{ name: "Flat 8", tenant: "Sathyanarayana" }
];
// Duty instructions
const INSTRUCTIONS = [
{ title: "Morning", items: ["Turn ON and OFF motor", "Check overhead tank for overflowing"] },
{ title: "Evening", items: ["Turn ON and OFF motor", "Check overhead tank for overflowing"] },
{ title: "If Unavailable", items: ["Inform WhatsApp group", "Request another resident to help"] },
{ title: "Emergency", items: ["Report pump issues immediately"] }
];
const UPCOMING_WEEKS = 8;
const PREVIOUS_WEEKS = 8;Edit maintenance.txt anytime using this format:
= Paid =
- 29 September 2026: Monthly: 500
- 4 September 2026: Monthly: 513
- 31 July 2026: Monthly: 500
+ 29 July 2026: Drainage: 315
- 1 July 2026: Monthly: 65
- 30 April 2026: Monthly: 628
+ 11 April 2026: Sump & Tank Cleaning: 500
- 9 April 2026: Motor Repair (Compensated): 890
- 31 March 2026: Monthly: 430
+ 26 March 2026: Main Gate Keys: 194
= Expenses =
- October 2026
- September 2026
House Keeping: 3000
- August 2026
House Keeping: 3000
Electricity Bill: 906
Broom Stick: 200
- July 2026
House Keeping: 3000
- 29 July 2026
Drainage Cleaning: 2500
- June 2026
House Keeping: 3000
Electricity Bill: 823
- May 2026
House Keeping: 2000
Drainage Cleaning: 1200
- April 2026
House Keeping: 3000
Electricity Bill: 1729
Flowers: 250
- 12 April 2026
Sump & Tank Cleaning: 3500
- March 2026
House Keeping: 3000
Flowers: 110
EB Expenses: 100
Broom Stick: 200
- 26 March 2026
Main Gate Keys: 1550
= Issues =
Issue:
StartDate:
EndDate:
Status:
Context:
Issue: Drainage Issue in Restroom
StartDate: 05 October 2026
EndDate: 09 October 2026
Status: Completed
Context:
- Water was not going in the bathroom Drainage.
- There was too much reflux and water blockage.
- Corporation was contacted first, and Plumber said it was fine. This was not true.
- Informed Owner and a Plumber who fixes issues at this place came.
- Plumber came and cleaned it with hose pipe.
- The blockage was full of small broken bricks and tiny plastic covers.
Issue: Tiles Broken in Bedroom
StartDate: 12 September 2026
EndDate: 03 October 2026
Status: Completed
Context:
- When we locked the house and went to TTD for 5 day.
- Upon returning found 6+ tiles broken in the bedroom.
- This was the same place where the walking on it caused a hollow noise earlier.
- Upon patiently waiting for ~3 weeks after informing, and following up twice.
- Mason came and fixed the tiles. He removed all the broken tiles and laid new ones.
Issue: Bathroom Taps & Rusted Shower
StartDate: 06 August 2026
EndDate: 05 October 2026
Status: Pending
Context:
- Within 6 months the bathroom taps and shower became loose and rusted.
- Raised with the owner on 06 August; estimate shared on 12 August (material + labour โ 1,800-1,900).
- Plumber came on 14 August but said he only handles plumbing, not cement work.
- On 05 October the plumber fixed the washing machine tap, wash basin tap and shower head.
- Actual cost: Shower head 295, Wash basin tap 644, PVC hose 80, Washing machine tap 100, Pipe connector 20, Labour 450 - total 1,589.
- Owner payment has not been completed.
Issue: Pending Masonry Work (Roof, Gadapa, Bathroom Step, Tile Gaps)
StartDate: 09 May 2026
EndDate: Nill
Status: Pending
Context:
- Rainwater drips from an electricity pipe, and with no gadapa at the front gate water enters the hall.
- Roof needs sealing of holes and gaps (rain leakage), which also causes sparks in electric plugs.
- Gadapa needs installation with a tile to stop water seeping into the hall.
- Bathroom step needs fixing; parts of it are sharp and cut the skin.
- Rooms need sealing of gaps around the slab and tiles; ants and insects come out of the gaps.
- Informed repeatedly (09 May, 25 May, 11 June, 13 July, 30 July, 05 October); mason has still not come.
Issue: Moist Electric Box
StartDate: 24 March 2026
EndDate: Nill
Status: Pending
Context:
- The Electric Box which is inside the hall is having Moist/Water logging inside it.
- First noticed around 24 March 2026, when the electrician found the EB pipe wet, which had caused a short circuit.
- Informed the owner, he initially ignored it. Later he came to check it by himself.
- Then informed him multiple times, and he said he would send someone.
- Additionally he also asked for some kind of proof of the water leak condition.
- Related: the Gadapa, Bathroom Step and Tile Gaps are tracked under the "Pending Masonry Work" issue.
Issue: Painter Payment
StartDate: 18 February 2026
EndDate: 25 May 2026
Status: Completed
Context:
- After paying for the Painting Job from my end.
- Initially Owner informed that it would be compensated in the rent payment.
- Later he wanted the Painter to come in and sign the Voucher and only then he would pay the Painter Directly.
- This was odd, because the Painter was hospitalised and unreachable.
- Informed the Owner about the condition and asked him to do the needful.
- I requested rent deduction instead of voucher.
- He came, compensated the amount, after reaching out twice.
- Quotation: โน25,000 (5 days + 1 electric day), โน13k advance.
- Section Headers:
= Paid =,= Expenses =, and= Issues =(case-insensitive,=on both sides). Everything under= Paid =is parsed as collections; everything under= Expenses =is parsed as expenses; everything under= Issues =is parsed as maintenance issues. - Paid Lines:
- DATE: TYPE: AMOUNT(e.g.- 4 September 2026: Monthly: 513). Date is everything before the second-last colon, type is the second-last segment, amount is the last number. Two-segment lines (- 31 July 2026: 500) fall back to typePaid. A+prefix marks the entry as Additional (e.g.+ 29 July 2026: Drainage: 315) โ shown with โก amber styling instead of the standard ๐ฐ green badge. - Expense Groups:
- Month Yearheaders (e.g.- April 2026) display a๐ Monthlytag;- DD Month Yearheaders (e.g.- 12 April 2026) are auto-detected asโก Additional Expensewith amber styling. - Expense Line Items:
Utility Name: Amount(e.g.House Keeping: 3000). - Issue Blocks:
Issue: Problem Name StartDate: DD Month Year EndDate: DD Month Year (or Nill / Pending) Status: Completed | Pending Context: - Bullet point note 1 - Bullet point note 2- The template block with empty fields is automatically skipped.
- Day differences between
StartDateandEndDateare calculated automatically and rendered as duration pills (e.g.โฑ๏ธ 4 days, orโฑ๏ธ 197 days (Ongoing)when ongoing).
- Leave blank lines between entries for readability.
/
โโโ assets/
โ โโโ css/
โ โ โโโ styles.css # CSS variables, 6 theme palettes, card layouts, tabs, responsive grid, print styles
โ โโโ js/
โ โ โโโ script.js # Rotation math, section splitter, expense/paid/issue parsers, stats, modal, theme cycler
โ โโโ icons/
โ โโโ favicon.ico # Multi-resolution ICO (16x16, 32x32, 48x48)
โ โโโ favicon.svg # Scalable vector droplet icon
โ โโโ apple-touch-icon.png # iOS touch icon (180x180)
โ โโโ icon-192.png # PWA icon (192x192)
โ โโโ icon-512.png # PWA splash icon (512x512)
โโโ docs/
โ โโโ CODE_DOCUMENTATION.md # Architecture & technical documentation
โ โโโ DESIGN_PHILOSOPHY.md # Core principles & design rationale
โ โโโ info.txt # Project specifications & user requirements
โ โโโ seed-prompt.txt # Foundation prompt & domain rules
โโโ favicon.ico # Root favicon for Vercel & search engine detection
โโโ index.html # Semantic HTML5: rotation view, tabbed Bills view, Issues view, modal, toast container
โโโ maintenance.txt # `= Paid =` collections + `= Expenses =` billing groups + `= Issues =` log (network-first; last good copy cached for offline)
โโโ manifest.json # Progressive Web App (PWA) configuration (relative paths)
โโโ sw.js # Service Worker: app-shell cache + network-first maintenance.txt with offline fallback
โโโ vercel.json # Vercel deployment configuration (headers, caching, cleanUrls)
โโโ README.md # Documentation & user guide
โโโ LICENSE # MIT License
Key DOM/JS hooks:
- Bills tabs:
#expensesTabBtn,#paidTabBtn,#expensesPane,#paidPane,#expensesSummaryCard,#paidSummaryCard - Expenses:
#billStatsGrid,#billSearchInput,#billContent - Paid:
#paidStatsGrid,#paidSearchInput,#paidContent,#paidInfoBtn,.bill-note-card,#paidBreakdownModal,#paidBreakdownBody,#paidBreakdownClose - Issues:
#issuesView,#issuesSummaryCard,#issueStatsGrid,#issueSortSelect,#issueSearchInput,#issuesContent,.issue-note-card,#issueCopyBtn,#issuePrintBtn - Views & Nav:
#rotationView,#billsView,#issuesView,#backBtn,#billBtn,#issuesBtn, deep-links#billsand#issues
The project uses 100% relative paths (./) with zero build dependencies, so it runs seamlessly across any static host:
Configured out-of-the-box via vercel.json:
- Zero-Build Static Hosting: Connect your GitHub repository to Vercel for instant automatic deployments.
- Service Worker Cache Busted: Header
Cache-Control: public, max-age=0, must-revalidateon/sw.jsensures resident browsers instantly detect new application updates. - Dynamic Database Bypass: Header
Cache-Control: no-cache, no-store, must-revalidateon/maintenance.txtallows immediate billing changes without rebuilds. - Favicon & Crawler Detection: Root
favicon.icoand vectorassets/icons/favicon.svgare automatically picked up by Vercel's project dashboard, social link scrapers, and mobile browsers. - Security Headers Included: Injects
X-Content-Type-Options: nosniff,X-Frame-Options: DENY,X-XSS-Protection, andReferrer-Policy.
Works directly in any subdirectory path without routing configuration (e.g. https://krishnakanthb13.github.io/54-GNs/).
Serve locally using Python or Node.js:
# Python
python -m http.server 8080
# Or Node.js
npx serve .Then open http://localhost:8080 in your browser.
For in-depth architectural specifications and design ideology, consult the documents in docs/:
- Code Documentation: Deep dive into the rotation arithmetic, regex billing parser, DOM selector architecture, and PWA caching lifecycle.
- Design Philosophy: Core mission, rationale behind the flat-file database, Flat 7 contextual notice, and reconciliation audit principles.
Distributed under the MIT License.