autoblogger 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.
package/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "autoblogger",
3
+ "version": "0.1.0",
4
+ "description": "A headless CMS with AI writing tools, WYSIWYG editor, and RSS auto-draft",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./ui": {
15
+ "import": "./dist/ui.mjs",
16
+ "require": "./dist/ui.js",
17
+ "types": "./dist/ui.d.ts"
18
+ },
19
+ "./styles/preset": "./dist/styles/preset.js",
20
+ "./styles/editor.css": "./dist/styles/editor.css",
21
+ "./styles/article": {
22
+ "import": "./dist/styles/article.mjs",
23
+ "require": "./dist/styles/article.js"
24
+ },
25
+ "./seo": {
26
+ "import": "./dist/lib/seo.mjs",
27
+ "require": "./dist/lib/seo.js"
28
+ },
29
+ "./markdown": {
30
+ "import": "./dist/lib/markdown.mjs",
31
+ "require": "./dist/lib/markdown.js"
32
+ }
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "prisma"
37
+ ],
38
+ "scripts": {
39
+ "build": "tsup && cp src/styles/preset.js dist/styles/preset.js",
40
+ "dev": "tsup --watch",
41
+ "typecheck": "tsc --noEmit",
42
+ "lint": "eslint src",
43
+ "prepare": "npm run build",
44
+ "prepublishOnly": "npm run build"
45
+ },
46
+ "peerDependencies": {
47
+ "@prisma/client": "^5.0.0 || ^6.0.0",
48
+ "lucide-react": ">=0.400.0",
49
+ "next": "^14.0.0 || ^15.0.0",
50
+ "react": "^18.0.0 || ^19.0.0",
51
+ "react-dom": "^18.0.0 || ^19.0.0"
52
+ },
53
+ "dependencies": {
54
+ "@anthropic-ai/sdk": "^0.30.0",
55
+ "@tiptap/extension-bubble-menu": "^3.15.3",
56
+ "@tiptap/extension-image": "^3.15.3",
57
+ "@tiptap/extension-link": "^3.15.3",
58
+ "@tiptap/extension-placeholder": "^3.15.3",
59
+ "@tiptap/pm": "^3.15.3",
60
+ "@tiptap/react": "^3.15.3",
61
+ "@tiptap/starter-kit": "^3.15.3",
62
+ "clsx": "^2.1.1",
63
+ "marked": "^12.0.0",
64
+ "openai": "^4.0.0",
65
+ "tailwind-merge": "^3.4.0",
66
+ "turndown": "^7.0.0"
67
+ },
68
+ "devDependencies": {
69
+ "@types/node": "^20.0.0",
70
+ "@types/react": "^18.0.0",
71
+ "@types/react-dom": "^18.3.7",
72
+ "@types/turndown": "^5.0.0",
73
+ "lucide-react": "^0.562.0",
74
+ "tsup": "^8.0.0",
75
+ "typescript": "^5.0.0"
76
+ },
77
+ "keywords": [
78
+ "cms",
79
+ "blog",
80
+ "ai",
81
+ "writing",
82
+ "tiptap",
83
+ "editor",
84
+ "next.js",
85
+ "headless"
86
+ ],
87
+ "author": "Hunter Rosenblume",
88
+ "license": "MIT",
89
+ "repository": {
90
+ "type": "git",
91
+ "url": "https://github.com/hrosenblume/autoblogger.git"
92
+ }
93
+ }
@@ -0,0 +1,181 @@
1
+ // Autoblogger Schema Template
2
+ // Copy this to your project's prisma/schema.prisma and merge with your existing models
3
+ // Then run: npx prisma migrate dev --name add-autoblogger
4
+
5
+ generator client {
6
+ provider = "prisma-client-js"
7
+ }
8
+
9
+ datasource db {
10
+ provider = "postgresql" // Change to "sqlite" for development
11
+ url = env("DATABASE_URL")
12
+ }
13
+
14
+ // ==========================================
15
+ // AUTOBLOGGER MODELS - Copy these to your schema
16
+ // ==========================================
17
+
18
+ model Post {
19
+ id String @id @default(uuid())
20
+ title String
21
+ subtitle String?
22
+ slug String @unique
23
+ markdown String
24
+ status String @default("draft") // draft, published, suggested, deleted
25
+ createdAt DateTime @default(now())
26
+ updatedAt DateTime @updatedAt
27
+ publishedAt DateTime?
28
+
29
+ // SEO fields
30
+ seoTitle String?
31
+ seoDescription String?
32
+ seoKeywords String?
33
+ noIndex Boolean @default(false)
34
+ ogImage String?
35
+
36
+ // Preview
37
+ previewToken String? @unique
38
+ previewExpiry DateTime?
39
+
40
+ // Relations
41
+ revisions Revision[]
42
+ tags PostTag[]
43
+ comments Comment[]
44
+ newsItem NewsItem?
45
+
46
+ // Auto-draft
47
+ sourceUrl String?
48
+ topicId String?
49
+ topic TopicSubscription? @relation(fields: [topicId], references: [id])
50
+
51
+ // Add your custom fields below, e.g.:
52
+ // polyhedraShape String?
53
+ }
54
+
55
+ model Revision {
56
+ id String @id @default(uuid())
57
+ postId String
58
+ post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
59
+ title String?
60
+ subtitle String?
61
+ markdown String
62
+ createdAt DateTime @default(now())
63
+ }
64
+
65
+ model Comment {
66
+ id String @id @default(uuid())
67
+ postId String
68
+ post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
69
+
70
+ // For authenticated comments (editor comments)
71
+ userId String?
72
+ user User? @relation(fields: [userId], references: [id])
73
+
74
+ // For public comments (legacy)
75
+ authorId String?
76
+ authorName String?
77
+ authorEmail String?
78
+
79
+ // Editor comment fields
80
+ quotedText String @default("") // Snapshot of highlighted text
81
+ content String
82
+ parentId String? // For single-level replies
83
+ parent Comment? @relation("Replies", fields: [parentId], references: [id], onDelete: Cascade)
84
+ replies Comment[] @relation("Replies")
85
+ resolved Boolean @default(false)
86
+ deletedAt DateTime? // Soft delete timestamp
87
+
88
+ // Legacy field
89
+ approved Boolean @default(true)
90
+
91
+ createdAt DateTime @default(now())
92
+ updatedAt DateTime @updatedAt
93
+
94
+ @@index([postId])
95
+ @@index([parentId])
96
+ }
97
+
98
+ model User {
99
+ id String @id @default(uuid())
100
+ email String @unique
101
+ name String?
102
+ role String @default("writer")
103
+ createdAt DateTime @default(now())
104
+ comments Comment[]
105
+ }
106
+
107
+ model Tag {
108
+ id String @id @default(uuid())
109
+ name String @unique
110
+ createdAt DateTime @default(now())
111
+ posts PostTag[]
112
+ }
113
+
114
+ model PostTag {
115
+ id String @id @default(uuid())
116
+ postId String
117
+ tagId String
118
+ post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
119
+ tag Tag @relation(fields: [tagId], references: [id], onDelete: Cascade)
120
+ createdAt DateTime @default(now())
121
+
122
+ @@unique([postId, tagId])
123
+ }
124
+
125
+ model AISettings {
126
+ id String @id @default("default")
127
+ rules String @default("")
128
+ chatRules String @default("")
129
+ rewriteRules String?
130
+ autoDraftRules String?
131
+ planRules String?
132
+ defaultModel String @default("claude-sonnet")
133
+ autoDraftWordCount Int @default(800)
134
+ generateTemplate String?
135
+ chatTemplate String?
136
+ rewriteTemplate String?
137
+ autoDraftTemplate String?
138
+ planTemplate String?
139
+ expandPlanTemplate String?
140
+ updatedAt DateTime @updatedAt
141
+ }
142
+
143
+ model IntegrationSettings {
144
+ id String @id @default("default")
145
+ autoDraftEnabled Boolean @default(false)
146
+ updatedAt DateTime @updatedAt
147
+ // Host app can add additional fields like:
148
+ // googleAnalyticsId String?
149
+ // contactEmail String?
150
+ }
151
+
152
+ model TopicSubscription {
153
+ id String @id @default(uuid())
154
+ name String
155
+ keywords String // JSON array
156
+ rssFeeds String // JSON array of feed URLs
157
+ isActive Boolean @default(true)
158
+ useKeywordFilter Boolean @default(true)
159
+ frequency String @default("daily")
160
+ maxPerPeriod Int @default(3)
161
+ essayFocus String?
162
+ lastRunAt DateTime?
163
+ createdAt DateTime @default(now())
164
+ updatedAt DateTime @updatedAt
165
+ posts Post[]
166
+ newsItems NewsItem[]
167
+ }
168
+
169
+ model NewsItem {
170
+ id String @id @default(uuid())
171
+ topicId String
172
+ topic TopicSubscription @relation(fields: [topicId], references: [id], onDelete: Cascade)
173
+ url String @unique
174
+ title String
175
+ summary String?
176
+ publishedAt DateTime?
177
+ status String @default("pending") // pending, generated, skipped
178
+ postId String? @unique
179
+ post Post? @relation(fields: [postId], references: [id])
180
+ createdAt DateTime @default(now())
181
+ }