weekly-sched
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
index.ts
https://jeffroche--20f21882843b11f09a1c0224a6c84d84.web.val.run
A React-based weekly schedule application for managing recurring responsibilities and delegating tasks with client-side routing using wouter.
- Manage Responsibilities: Create and manage recurring responsibilities with flexible scheduling
- Delegate Tasks: Assign responsibilities to team members for specific weeks
- Calendar View: Visual weekly calendar with navigation and task management
- Client-Side Routing: Proper URLs for each page with browser back/forward support using wouter
- React 18.2.0 with TypeScript
- Wouter for client-side routing with URL support
- TailwindCSS for styling
- Modern, minimal design
- Hono API framework
- SQLite database
- RESTful API endpoints
- SPA routing support
/
- Calendar view (default)/responsibilities
- Manage responsibilities/delegation
- Delegate tasks
Responsibilities Table:
- id, createdAt, updatedAt
- name (string)
- days (weekdays/weekends/every day)
- startTime, endTime (nullable)
- status (active/archived)
Tasks Table:
- id, responsibilityId (foreign key)
- date, owner (Jeff/Tara)
- notes (text field)
βββ backend/
β βββ database/
β β βββ migrations.ts
β β βββ queries.ts
β βββ routes/
β β βββ responsibilities.ts
β β βββ tasks.ts
β βββ index.ts
βββ frontend/
β βββ components/
β β βββ App.tsx
β β βββ ResponsibilitiesPage.tsx
β β βββ DelegationPage.tsx
β β βββ CalendarPage.tsx
β βββ index.html
β βββ index.tsx
βββ shared/
βββ types.ts
The app consists of three main views:
- Visual weekly calendar showing all assigned tasks
- Navigate between weeks with Previous/Next buttons
- Click "Current Week" to jump back to today
- Click on any task to edit notes
- Color-coded assignments (Jeff = blue, Tara = green)
- Shows responsibility name, time, owner, and notes
- Create and manage recurring responsibilities
- Set name, days (weekdays/weekends/every day), and optional time slots
- Edit existing responsibilities
- Archive responsibilities when no longer needed
- Assign responsibilities to team members for specific weeks
- Select any week using the date picker
- Grid view showing all responsibilities vs. days of the week
- Only shows relevant days based on responsibility settings
- Bulk save all assignments for the week
- Start by creating responsibilities in the "Responsibilities" page
- Use the "Delegation" page to assign tasks for upcoming weeks
- View and manage the schedule in the "Calendar" view
GET /api/responsibilities
- Get all active responsibilitiesPOST /api/responsibilities
- Create new responsibilityPUT /api/responsibilities/:id
- Update responsibilityDELETE /api/responsibilities/:id
- Archive responsibilityGET /api/tasks/week?start=YYYY-MM-DD&end=YYYY-MM-DD
- Get tasks for weekPOST /api/tasks
- Create new task assignmentPUT /api/tasks/:id
- Update task (owner/notes)PUT /api/tasks/by-responsibility/{responsibilityId}#{date}
- Create or update task by responsibility and date (upsert)DELETE /api/tasks/:id
- Delete task assignment
The app now supports a unified PUT endpoint for creating or updating tasks:
- Endpoint:
PUT /api/tasks/by-responsibility/{responsibilityId}#{date}
- Format: The ID is formatted as
{responsibilityId}#{date}
(e.g.,1#2024-01-15
) - Behavior: Creates a new task if it doesn't exist, updates if it does
- Body:
{ "owner": "Jeff" | "Tara", "notes": "optional notes" }
This simplifies the delegation workflow by eliminating the need to check for existing tasks before creating or updating them.