pacatui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +153 -0
  3. package/generated/prisma/browser.ts +59 -0
  4. package/generated/prisma/client.ts +81 -0
  5. package/generated/prisma/commonInputTypes.ts +402 -0
  6. package/generated/prisma/enums.ts +15 -0
  7. package/generated/prisma/internal/class.ts +260 -0
  8. package/generated/prisma/internal/prismaNamespace.ts +1362 -0
  9. package/generated/prisma/internal/prismaNamespaceBrowser.ts +190 -0
  10. package/generated/prisma/models/Customer.ts +1489 -0
  11. package/generated/prisma/models/Invoice.ts +1837 -0
  12. package/generated/prisma/models/Project.ts +1981 -0
  13. package/generated/prisma/models/Setting.ts +1086 -0
  14. package/generated/prisma/models/Tag.ts +1288 -0
  15. package/generated/prisma/models/Task.ts +1669 -0
  16. package/generated/prisma/models/TaskTag.ts +1340 -0
  17. package/generated/prisma/models/TimeEntry.ts +1602 -0
  18. package/generated/prisma/models.ts +19 -0
  19. package/package.json +71 -0
  20. package/prisma/migrations/20260115051911_init/migration.sql +71 -0
  21. package/prisma/migrations/20260115062427_add_time_tracking/migration.sql +20 -0
  22. package/prisma/migrations/20260117233250_add_customers_invoices/migration.sql +81 -0
  23. package/prisma/migrations/migration_lock.toml +3 -0
  24. package/prisma/schema.prisma +162 -0
  25. package/src/App.tsx +1492 -0
  26. package/src/components/CreateInvoiceModal.tsx +222 -0
  27. package/src/components/CustomerModal.tsx +158 -0
  28. package/src/components/CustomerSelectModal.tsx +142 -0
  29. package/src/components/Dashboard.tsx +242 -0
  30. package/src/components/DateTimePicker.tsx +335 -0
  31. package/src/components/EditTimeEntryModal.tsx +293 -0
  32. package/src/components/Header.tsx +65 -0
  33. package/src/components/HelpView.tsx +109 -0
  34. package/src/components/InputModal.tsx +79 -0
  35. package/src/components/InvoicesView.tsx +297 -0
  36. package/src/components/Modal.tsx +38 -0
  37. package/src/components/ProjectList.tsx +114 -0
  38. package/src/components/ProjectModal.tsx +116 -0
  39. package/src/components/SettingsView.tsx +145 -0
  40. package/src/components/SplashScreen.tsx +25 -0
  41. package/src/components/StatusBar.tsx +93 -0
  42. package/src/components/TaskList.tsx +143 -0
  43. package/src/components/Timer.tsx +95 -0
  44. package/src/components/TimerModals.tsx +120 -0
  45. package/src/components/TimesheetView.tsx +218 -0
  46. package/src/components/index.ts +17 -0
  47. package/src/db.ts +629 -0
  48. package/src/hooks/usePaste.ts +69 -0
  49. package/src/index.tsx +75 -0
  50. package/src/stripe.ts +163 -0
  51. package/src/types.ts +361 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Paca Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,153 @@
1
+ # Paca
2
+
3
+ A simple tui app for task, timer and invoicing for projects.
4
+
5
+ ![License](https://img.shields.io/npm/l/pacatui)
6
+ ![npm](https://img.shields.io/npm/v/pacatui)
7
+
8
+ ## Features
9
+
10
+ - **Project Management** - Organize tasks by projects with color coding
11
+ - **Task Tracking** - Create, edit, and manage tasks with priorities and statuses
12
+ - **Time Tracking** - Start/stop timers with descriptions and hourly rates
13
+ - **Timesheets** - View uninvoiced time entries grouped by project
14
+ - **Stripe Invoicing** - Create draft invoices directly from time entries
15
+ - **Invoice Management** - View and manage all your Stripe invoices
16
+ - **Dashboard** - Overview of projects, tasks, and time stats
17
+ - **Offline-first** - All data stored locally in SQLite
18
+ - **Vim-style Navigation** - Keyboard-driven interface
19
+
20
+ ## Installation
21
+
22
+ ### Via npm (recommended)
23
+
24
+ Requires [Bun](https://bun.sh) runtime.
25
+
26
+ ```bash
27
+ # Install bun if you haven't already
28
+ curl -fsSL https://bun.sh/install | bash
29
+
30
+ # Install pacatui globally
31
+ bun install -g pacatui
32
+
33
+ # Run it
34
+ paca
35
+ ```
36
+
37
+ ### From source
38
+
39
+ ```bash
40
+ git clone https://github.com/wes/paca.git
41
+ cd paca
42
+ bun install
43
+ bun run start
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ Simply run:
49
+
50
+ ```bash
51
+ paca
52
+ ```
53
+
54
+ On first run, Paca will automatically create its database at `~/.paca/paca.db`.
55
+
56
+ ## Keyboard Shortcuts
57
+
58
+ ### Global
59
+
60
+ | Key | Action |
61
+ |-----|--------|
62
+ | `1` | Dashboard |
63
+ | `2` | Tasks |
64
+ | `3` | Timesheets |
65
+ | `4` | Invoices |
66
+ | `5` | Settings |
67
+ | `?` | Help |
68
+ | `t` | Start timer |
69
+ | `s` | Stop timer (when running) |
70
+ | `q` | Quit |
71
+
72
+ ### Navigation
73
+
74
+ | Key | Action |
75
+ |-----|--------|
76
+ | `j` / `↓` | Move down |
77
+ | `k` / `↑` | Move up |
78
+ | `Tab` | Switch panels |
79
+ | `Enter` | Select/Confirm |
80
+ | `Esc` | Cancel/Go back |
81
+
82
+ ### Projects & Tasks
83
+
84
+ | Key | Action |
85
+ |-----|--------|
86
+ | `n` | Create new |
87
+ | `e` | Edit |
88
+ | `d` | Delete |
89
+ | `Space` | Toggle task status |
90
+ | `p` | Cycle priority |
91
+ | `a` | Archive/Unarchive project |
92
+ | `A` | Toggle show archived |
93
+ | `c` | Link customer to project |
94
+
95
+ ### Timesheets
96
+
97
+ | Key | Action |
98
+ |-----|--------|
99
+ | `Space` | Select entry for invoicing |
100
+ | `e` | Edit time entry |
101
+ | `d` | Delete time entry |
102
+ | `i` | Create invoice from selected |
103
+
104
+ ### Invoices
105
+
106
+ | Key | Action |
107
+ |-----|--------|
108
+ | `Enter` | Open invoice in browser |
109
+ | `r` | Refresh list |
110
+ | `]` | Next page |
111
+ | `[` | Previous page |
112
+
113
+ ## Configuration
114
+
115
+ ### Settings
116
+
117
+ Access settings by pressing `5`:
118
+
119
+ - **Business Name** - Your business name for invoices
120
+ - **Stripe API Key** - Enable invoicing features
121
+ - **Timezone** - Set display timezone (or auto-detect)
122
+ - **Export/Import** - Backup and restore your data
123
+
124
+ ### Data Location
125
+
126
+ - Database: `~/.paca/paca.db`
127
+ - Backups: `~/.paca/backups/`
128
+
129
+ ## Stripe Integration
130
+
131
+ To enable invoicing:
132
+
133
+ 1. Get your Stripe API key from [dashboard.stripe.com/apikeys](https://dashboard.stripe.com/apikeys)
134
+ 2. Press `5` to go to Settings
135
+ 3. Add your Stripe Secret Key
136
+ 4. Link customers to projects using `c` in the Projects view
137
+ 5. Create invoices from the Timesheets view
138
+
139
+ ## Tech Stack
140
+
141
+ - **Runtime**: [Bun](https://bun.sh)
142
+ - **TUI Framework**: [@opentui/react](https://github.com/anthropic/opentui)
143
+ - **Database**: SQLite via libsql
144
+ - **ORM**: Prisma 7
145
+ - **Payments**: Stripe API
146
+
147
+ ## Contributing
148
+
149
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
150
+
151
+ ## License
152
+
153
+ MIT - see [LICENSE](LICENSE) for details.
@@ -0,0 +1,59 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!! */
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+ // @ts-nocheck
6
+ /*
7
+ * This file should be your main import to use Prisma-related types and utilities in a browser.
8
+ * Use it to get access to models, enums, and input types.
9
+ *
10
+ * This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only.
11
+ * See `client.ts` for the standard, server-side entry point.
12
+ *
13
+ * 🟢 You can import this file directly.
14
+ */
15
+
16
+ import * as Prisma from './internal/prismaNamespaceBrowser.ts'
17
+ export { Prisma }
18
+ export * as $Enums from './enums.ts'
19
+ export * from './enums.ts';
20
+ /**
21
+ * Model Customer
22
+ *
23
+ */
24
+ export type Customer = Prisma.CustomerModel
25
+ /**
26
+ * Model Project
27
+ *
28
+ */
29
+ export type Project = Prisma.ProjectModel
30
+ /**
31
+ * Model TimeEntry
32
+ *
33
+ */
34
+ export type TimeEntry = Prisma.TimeEntryModel
35
+ /**
36
+ * Model Invoice
37
+ *
38
+ */
39
+ export type Invoice = Prisma.InvoiceModel
40
+ /**
41
+ * Model Task
42
+ *
43
+ */
44
+ export type Task = Prisma.TaskModel
45
+ /**
46
+ * Model Tag
47
+ *
48
+ */
49
+ export type Tag = Prisma.TagModel
50
+ /**
51
+ * Model TaskTag
52
+ *
53
+ */
54
+ export type TaskTag = Prisma.TaskTagModel
55
+ /**
56
+ * Model Setting
57
+ *
58
+ */
59
+ export type Setting = Prisma.SettingModel
@@ -0,0 +1,81 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!! */
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+ // @ts-nocheck
6
+ /*
7
+ * This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
8
+ * If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead.
9
+ *
10
+ * 🟢 You can import this file directly.
11
+ */
12
+
13
+ import * as process from 'node:process'
14
+ import * as path from 'node:path'
15
+ import { fileURLToPath } from 'node:url'
16
+ globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
17
+
18
+ import * as runtime from "@prisma/client/runtime/client"
19
+ import * as $Enums from "./enums.ts"
20
+ import * as $Class from "./internal/class.ts"
21
+ import * as Prisma from "./internal/prismaNamespace.ts"
22
+
23
+ export * as $Enums from './enums.ts'
24
+ export * from "./enums.ts"
25
+ /**
26
+ * ## Prisma Client
27
+ *
28
+ * Type-safe database client for TypeScript
29
+ * @example
30
+ * ```
31
+ * const prisma = new PrismaClient()
32
+ * // Fetch zero or more Customers
33
+ * const customers = await prisma.customer.findMany()
34
+ * ```
35
+ *
36
+ * Read more in our [docs](https://pris.ly/d/client).
37
+ */
38
+ export const PrismaClient = $Class.getPrismaClientClass()
39
+ export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
40
+ export { Prisma }
41
+
42
+ /**
43
+ * Model Customer
44
+ *
45
+ */
46
+ export type Customer = Prisma.CustomerModel
47
+ /**
48
+ * Model Project
49
+ *
50
+ */
51
+ export type Project = Prisma.ProjectModel
52
+ /**
53
+ * Model TimeEntry
54
+ *
55
+ */
56
+ export type TimeEntry = Prisma.TimeEntryModel
57
+ /**
58
+ * Model Invoice
59
+ *
60
+ */
61
+ export type Invoice = Prisma.InvoiceModel
62
+ /**
63
+ * Model Task
64
+ *
65
+ */
66
+ export type Task = Prisma.TaskModel
67
+ /**
68
+ * Model Tag
69
+ *
70
+ */
71
+ export type Tag = Prisma.TagModel
72
+ /**
73
+ * Model TaskTag
74
+ *
75
+ */
76
+ export type TaskTag = Prisma.TaskTagModel
77
+ /**
78
+ * Model Setting
79
+ *
80
+ */
81
+ export type Setting = Prisma.SettingModel