Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5176ddd
chore: remove meteor-wormhole package symlink
mfisher31 Apr 20, 2026
9724339
feat: add migration plan for transitioning from Meteor to Timecore
mfisher31 Apr 21, 2026
3bf51a5
feat(auth): implement timecore authentication methods and session man…
mfisher31 Apr 21, 2026
071680a
feat: migrate user authentication and profile management to timecore API
mfisher31 Apr 21, 2026
62a38ed
feat(tickets): migrate ticket management to timecore API and remove M…
mfisher31 Apr 21, 2026
cbc5b45
refactor: migrate teams feature to use REST API and remove Meteor met…
mfisher31 Apr 21, 2026
e6eab60
Refactor clock feature to use REST API for teams and clock events
mfisher31 Apr 22, 2026
75ea941
plans: add mobile migration plan and push notification handling
mfisher31 Apr 22, 2026
4a208c9
feat(messages): migrate messaging system to Timecore API and implemen…
mfisher31 Apr 22, 2026
bade506
feat(notifications): migrate notifications to Timecore API with SSE f…
mfisher31 Apr 22, 2026
5246418
housekeeping: remove stale attic files and timecore plan post-migration
mfisher31 Apr 22, 2026
3832126
Fix team selection persistence for new users
mfisher31 Apr 22, 2026
039bb84
refactor: Move from Vite over Meteor
mfisher31 Apr 22, 2026
513bc75
fix: prevent white flash on refresh and make logo a dead link when lo…
mfisher31 Apr 22, 2026
71540a3
feat: disable sidebar animations on page reload
mfisher31 Apr 22, 2026
5d61f4a
housekeeping: format the code: components for improved readability an…
mfisher31 Apr 22, 2026
1f4efeb
Resolve package resolutions
mfisher31 Apr 22, 2026
ddd019f
ci: remove meteor build/test in actions
mfisher31 Apr 22, 2026
357be05
ci: remove Meteor, use Node 24, switch to Vite build
mfisher31 Apr 22, 2026
8f69018
ci: use Node 25 to match local dev environment
mfisher31 Apr 22, 2026
393a4e5
ci: use npm install instead of npm ci to fix cross-platform lock file…
mfisher31 Apr 22, 2026
d6b8175
fix: exclude vite.config.ts from app tsconfig to fix typecheck
mfisher31 Apr 22, 2026
9adce17
fix: override ychart global header CSS that was turning app header blue
mfisher31 Apr 22, 2026
7f0ea08
feat: implement frontend deployment workflow and add backend submodule
Dharp02 Apr 22, 2026
546aaf6
Revert "fix: override ychart global header CSS that was turning app h…
mfisher31 Apr 22, 2026
71763bf
fix: update @mieweb/ychart to version 1.1.0 in package.json and packa…
mfisher31 Apr 22, 2026
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
33 changes: 25 additions & 8 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,39 +215,45 @@ meteor build ../build --directory # Build for production (5-15 min)
<!-- https://github.com/mieweb/template-mieweb-opensource/blob/main/.github/copilot-instructions.md -->

### 🎯 DRY (Don't Repeat Yourself)

- **Never duplicate code**: If you find yourself copying code, extract it into a reusable function
- **Single source of truth**: Each piece of knowledge should have one authoritative representation
- **Refactor mercilessly**: When you see duplication, eliminate it immediately
- **Shared utilities**: Common patterns should be abstracted into utility functions

### 💋 KISS (Keep It Simple, Stupid)

- **Simple solutions**: Prefer the simplest solution that works
- **Avoid over-engineering**: Don't add complexity for hypothetical future needs
- **Clear naming**: Functions and variables should be self-documenting
- **Small functions**: Break down complex functions into smaller, focused ones
- **Readable code**: Code should be obvious to understand at first glance

### 🧹 Folder Philosophy

- **Clear purpose**: Every folder should have a main thing that anchors its contents.
- **No junk drawers**: Don’t leave loose files without context or explanation.
- **Explain relationships**: If it’s not elegantly obvious how files fit together, add a README or note.
- **Immediate clarity**: Opening a folder should make its organizing principle clear at a glance.

### 🔄 Refactoring Guidelines

- **Continuous improvement**: Refactor as you work, not as a separate task
- **Safe refactoring**: Always run tests before and after refactoring
- **Incremental changes**: Make small, safe changes rather than large rewrites
- **Preserve behavior**: Refactoring should not change external behavior
- **Code reviews**: All refactoring should be reviewed for correctness

### ⚰️ Dead Code Management

- **Immediate removal**: Delete unused code immediately when identified
- **Historical preservation**: Move significant dead code to `.attic/` directory with context
- **Documentation**: Include comments explaining why code was moved to attic
- **Regular cleanup**: Review and clean attic directory periodically
- **No accumulation**: Don't let dead code accumulate in active codebase

### 🌐 Testing with MCP Browser

- Use MCP browser in Playwright if available to test functionality
- **Never close the browser** after running MCP browser commands unless explicitly asked
- Let the user interact with the browser after navigation or testing
Expand All @@ -256,69 +262,79 @@ meteor build ../build --directory # Build for production (5-15 min)
## Production vs Development Mode

### 🚀 Environment Detection

- **Check `.env` for `MYNAME`**: Before testing, check if `MYNAME` is defined in the server `.env` file
- **If `MYNAME` is defined**: This indicates a production/proxy environment
- Don't restart for UI changes; just build with `npm run build` in the client folder. If you need to restart the server, just ask the user to do it.
- Don't restart for UI changes; just build with `npm run build` in the client folder. If you need to restart the server, just ask the user to do it.
- Use the `MYNAME` URL (e.g., `https://pulseclip.os.mieweb.org/`) for all browser testing
- Do NOT use `localhost` URLs for testing - the app is behind an nginx proxy
- **If `MYNAME` is not defined**: Use development mode with `localhost:3000`

### 🔧 Testing Workflow

1. Read `server/.env` to check for `MYNAME` variable
2. If `MYNAME` exists, build and start the server: `npm run build && npm run start`
3. Navigate to the `MYNAME` URL for browser testing (not localhost)
4. The nginx proxy handles routing to the local server

## HTML & CSS Guidelines

- **Semantic Naming**: Every `<div>` and other structural element must use a meaningful, semantic class name that clearly indicates its purpose or role within the layout.
- **CSS Simplicity**: Styles should avoid global resets or overrides that affect unrelated components or default browser behavior. Keep changes scoped and minimal.
- **SASS-First Approach**: All styles should be written in SASS (SCSS) whenever possible. Each component should have its own dedicated SASS file to promote modularity and maintainability.

## Accessibility (ARIA Labeling)

### 🎯 Interactive Elements

- **All interactive elements** (buttons, links, forms, dialogs) must include appropriate ARIA roles and labels
- **Use ARIA attributes**: Implement aria-label, aria-labelledby, and aria-describedby to provide clear, descriptive information for screen readers
- **Semantic HTML**: Use semantic HTML wherever possible to enhance accessibility

### 📢 Dynamic Content

- **Announce updates**: Ensure all dynamic content updates (modals, alerts, notifications) are announced to assistive technologies using aria-live regions
- **Maintain tab order**: Maintain logical tab order and keyboard navigation for all features
- **Visible focus**: Provide visible focus indicators for all interactive elements

## Internationalization (I18N)

### 🌍 Text and Language Support

- **Externalize text**: All user-facing text must be externalized for translation
- **Multiple languages**: Support multiple languages, including right-to-left (RTL) languages such as Arabic and Hebrew
- **Language selector**: Provide a language selector for users to choose their preferred language

### 🕐 Localization

- **Format localization**: Ensure date, time, number, and currency formats are localized based on user settings
- **UI compatibility**: Test UI layouts for text expansion and RTL compatibility
- **Unicode support**: Use Unicode throughout to support international character sets

## Documentation Preferences

### Diagrams and Visual Documentation

- **Always use Mermaid diagrams** instead of ASCII art for workflow diagrams, architecture diagrams, and flowcharts
- **Use memorable names** instead of single letters in diagrams (e.g., `Engine`, `Auth`, `Server` instead of `A`, `B`, `C`)
- Use appropriate Mermaid diagram types:
- `graph TB` or `graph LR` for workflow architectures
- `graph TB` or `graph LR` for workflow architectures
- `flowchart TD` for process flows
- `sequenceDiagram` for API interactions
- `gitgraph` for branch/release strategies
- Include styling with `classDef` for better visual hierarchy
- Add descriptive comments and emojis sparingly for clarity

### Documentation Standards

- Keep documentation DRY (Don't Repeat Yourself) - reference other docs instead of duplicating
- Use clear cross-references between related documentation files
- Update the main architecture document when workflow structure changes

## Working with GitHub Actions Workflows

### Development Philosophy

- **Script-first approach**: All workflows should call scripts that can be run locally
- **Local development parity**: Developers should be able to run the exact same commands locally as CI runs
- **Simple workflows**: GitHub Actions should be thin wrappers around scripts, not contain complex logic
Expand All @@ -328,16 +344,17 @@ meteor build ../build --directory # Build for production (5-15 min)

### 🪶 All Changes should be considered for Pull Request Philosophy

* **Smallest viable change**: Always make the smallest change that fully solves the problem.
* **Fewest files first**: Start with the minimal number of files required.
* **No sweeping edits**: Broad refactors or multi-module changes must be split or proposed as new components.
* **Isolated improvements**: If a change grows complex, extract it into a new function, module, or component instead of modifying multiple areas.
* **Direct requests only**: Large refactors or architectural shifts should only occur when explicitly requested.
- **Smallest viable change**: Always make the smallest change that fully solves the problem.
- **Fewest files first**: Start with the minimal number of files required.
- **No sweeping edits**: Broad refactors or multi-module changes must be split or proposed as new components.
- **Isolated improvements**: If a change grows complex, extract it into a new function, module, or component instead of modifying multiple areas.
- **Direct requests only**: Large refactors or architectural shifts should only occur when explicitly requested.

## @mieweb/ui Usage

**HARD RULE: Every UI element MUST use `@mieweb/ui` imports. No raw `<button>`, `<input>`, `<select>`, `<table>`, or custom modal/card/badge markup.**
Use this component mapping for ALL pages:

- `<button>` → `import { Button } from '@mieweb/ui'`
- `<input>` → `import { Input } from '@mieweb/ui'`
- modal divs → `import { Modal, ModalHeader, ModalBody, ModalFooter } from '@mieweb/ui'`
Expand All @@ -352,8 +369,8 @@ Use this component mapping for ALL pages:

**Before marking any page complete, verify: does it import from `@mieweb/ui`? If not, it's not done.**


### Code Quality Checklist

- [ ] **DRY**: No code duplication - extracted reusable functions?
- [ ] **KISS**: Simplest solution that works?
- [ ] **Minimal Changes**: Smallest viable change made for PR?
Expand Down
35 changes: 35 additions & 0 deletions .github/plans/mobile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Post-Migration: Mobile Path

Once Meteor is removed the codebase is universally portable:

| Target | Additional work |
| ----------------------- | ------------------------------------------------------------ |
| **PWA** | Add `manifest.json`, done — `sw.js` already exists |
| **Capacitor** | `npx cap init`, wrap existing React app, ~1 week |
| **Expo (React Native)** | Shared TanStack Query hooks + API layer, new native UI layer |

better-auth supports cookie auth (web) and token auth (mobile) natively — no changes needed
to timecore when adding mobile clients.

---

## Push Notifications

**Effort:** 1 day
**Goal:** Move VAPID/FCM handling to timecore. The existing `public/sw.js` is already
Meteor-independent and stays as-is.

### timehuddle changes

- [ ] Replace `getVapidPublicKey`, `push.subscribe`, `push.unsubscribe` Meteor methods
- [ ] Remove `imports/server/push.ts`
- [ ] Remove `imports/lib/pushNotificationsClient.ts` Meteor dependency

### timecore changes

- [ ] `GET /v1/push/vapid-key` — return public VAPID key
- [ ] `POST /v1/push/subscribe` — store subscription
- [ ] `DELETE /v1/push/subscribe` — remove subscription
- [ ] Move web-push + FCM sending logic from Meteor into timecore service

---
133 changes: 94 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
name: CI
name: Deploy Frontend

on:
push:
branches: [main]
pull_request:
branches: [main]
branches:
- main

concurrency:
group: ci-${{ github.ref }}
group: deploy-frontend-${{ github.ref }}
cancel-in-progress: true

jobs:
lint_and_types:
name: Lint & Type Check (Node 22)
name: Lint & Type Check (Node 25)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node 22
- name: Use Node 25
uses: actions/setup-node@v4
with:
node-version: 22
node-version: 25
cache: 'npm'
- name: Cache Meteor
uses: actions/cache@v4
with:
path: ~/.meteor
key: meteor-${{ runner.os }}-3.4-beta.3
- name: Install Meteor
run: |
if ! command -v meteor >/dev/null; then
curl https://install.meteor.com/ | sh
fi
- name: Install deps
run: npm ci --no-audit --no-fund
run: npm install --no-audit --no-fund
- name: Lint
run: npm run lint
- name: Type Check
Expand All @@ -41,35 +30,101 @@ jobs:
run: npm test

build:
name: Meteor Build (Linux)
name: Vite Build
runs-on: ubuntu-latest
needs: lint_and_types
steps:
- uses: actions/checkout@v4
- name: Use Node 22
- name: Use Node 25
uses: actions/setup-node@v4
with:
node-version: 22
node-version: 25
cache: 'npm'
- name: Cache Meteor
uses: actions/cache@v4
with:
path: ~/.meteor
key: meteor-${{ runner.os }}-3.4-beta.3
- name: Install Meteor
run: |
if ! command -v meteor >/dev/null; then
curl https://install.meteor.com/ | sh
fi
- name: Install deps
run: npm ci --no-audit --no-fund
- name: Build (directory)
run: |
meteor build ./build --directory
ls -1 ./build
run: npm install --no-audit --no-fund
- name: Build
run: npm run build
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: meteor-build
path: build
name: vite-build
path: dist
if-no-files-found: error

deploy:
name: Deploy Frontend - ${{ matrix.env }}
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
include:
- env: DEV
host_secret: SSH_HOST_DEV
port_secret: SSH_PORT_DEV
key_secret: SSH_PRIVATE_KEY_DEV
pm2_name: timehuddledev
- env: PROD
host_secret: SSH_HOST_PROD
port_secret: SSH_PORT_PROD
key_secret: SSH_PRIVATE_KEY_PROD
pm2_name: timehuddle-prod

steps:
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets[matrix.key_secret] }}" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -p ${{ secrets[matrix.port_secret] }} ${{ secrets[matrix.host_secret] }} >> ~/.ssh/known_hosts 2>/dev/null || true

- name: Deploy to ${{ matrix.env }}
run: |
ssh -p ${{ secrets[matrix.port_secret] }} \
-i ~/.ssh/deploy_key \
-o StrictHostKeyChecking=no \
${{ secrets.SSH_USER }}@${{ secrets[matrix.host_secret] }} << 'EOF'
set -e

REPO_DIR="/home/pdharamkar/timehuddle"
PM2_NAME="${{ matrix.pm2_name }}"

git config --global --add safe.directory "$REPO_DIR" 2>/dev/null || true
cd "$REPO_DIR"

echo "🛑 Stopping PM2 process: $PM2_NAME..."
pm2 stop "$PM2_NAME" 2>/dev/null || true

echo "🔄 Fetching and pulling latest code..."
git fetch origin
git pull origin main

echo "⚙️ Installing dependencies..."
npm install

echo "🏗️ Building frontend..."
npm run build

echo "🚀 Restarting PM2..."
pm2 restart "$PM2_NAME" 2>/dev/null || pm2 start ecosystem.config.cjs --only "$PM2_NAME"
pm2 save

echo "⏳ Waiting for process to stabilize..."
sleep 5

echo "📊 PM2 Status:"
pm2 status

echo "✅ Verifying $PM2_NAME is online..."
if pm2 list | grep -E "$PM2_NAME" | grep -q "online"; then
echo "✅ ${{ matrix.env }} frontend deployment successful! $PM2_NAME is online."
else
echo "❌ $PM2_NAME failed to start!"
pm2 logs "$PM2_NAME" --lines 30 --nostream || true
exit 1
fi
EOF

- name: Deployment Status
if: failure()
run: echo "❌ ${{ matrix.env }} frontend deployment failed!"
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "backend"]
path = backend
url = https://github.com/Dharp02/timeharbor-timehuddle-backend.git
Loading