Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

[refactor] Move the different packages to the package subdir

MohamedBassem80bb8a108f29
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 4c441557..2abb4cff 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -17,8 +17,8 @@ jobs:
- name: Format
run: bunx prettier . --check
- name: Prisma
- working-directory: db
+ working-directory: packages/db
run: bunx prisma generate
- name: Build web app
- working-directory: web
+ working-directory: packages/web
run: bun run build
diff --git a/Makefile b/Makefile
index 9764c2b4..4d8bace2 100644
--- a/Makefile
+++ b/Makefile
@@ -4,17 +4,17 @@ format:
bunx prettier . --write && bunx eslint .
prisma:
- cd db; \
+ cd packages/db; \
bunx prisma migrate dev; \
bunx prisma generate
workers:
- cd workers; \
+ cd packages/workers; \
bun --watch index.ts
web:
- cd web; \
+ cd packages/web; \
bun run dev
studio:
- cd db; \
+ cd packages/db; \
bunx prisma studio
diff --git a/bun.lockb b/bun.lockb
index b8f6722b..68c63f80 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package.json b/package.json
index 0462a4c7..17d9febd 100644
--- a/package.json
+++ b/package.json
@@ -4,10 +4,7 @@
"version": "0.1.0",
"private": true,
"workspaces": [
- "web",
- "workers",
- "shared",
- "db"
+ "packages/*"
],
"dependencies": {
"@next/eslint-plugin-next": "^14.1.0",
diff --git a/db/index.ts b/packages/db/index.ts
similarity index 100%
rename from db/index.ts
rename to packages/db/index.ts
diff --git a/db/package.json b/packages/db/package.json
similarity index 100%
rename from db/package.json
rename to packages/db/package.json
diff --git a/db/prisma/migrations/20240205153748_add_users/migration.sql b/packages/db/prisma/migrations/20240205153748_add_users/migration.sql
similarity index 100%
rename from db/prisma/migrations/20240205153748_add_users/migration.sql
rename to packages/db/prisma/migrations/20240205153748_add_users/migration.sql
diff --git a/db/prisma/migrations/20240206000813_add_links/migration.sql b/packages/db/prisma/migrations/20240206000813_add_links/migration.sql
similarity index 100%
rename from db/prisma/migrations/20240206000813_add_links/migration.sql
rename to packages/db/prisma/migrations/20240206000813_add_links/migration.sql
diff --git a/db/prisma/migrations/20240206192241_add_favicon/migration.sql b/packages/db/prisma/migrations/20240206192241_add_favicon/migration.sql
similarity index 100%
rename from db/prisma/migrations/20240206192241_add_favicon/migration.sql
rename to packages/db/prisma/migrations/20240206192241_add_favicon/migration.sql
diff --git a/db/prisma/migrations/20240207204211_drop_extra_field_in_tags_links/migration.sql b/packages/db/prisma/migrations/20240207204211_drop_extra_field_in_tags_links/migration.sql
similarity index 100%
rename from db/prisma/migrations/20240207204211_drop_extra_field_in_tags_links/migration.sql
rename to packages/db/prisma/migrations/20240207204211_drop_extra_field_in_tags_links/migration.sql
diff --git a/db/prisma/migrations/migration_lock.toml b/packages/db/prisma/migrations/migration_lock.toml
similarity index 100%
rename from db/prisma/migrations/migration_lock.toml
rename to packages/db/prisma/migrations/migration_lock.toml
diff --git a/db/prisma/schema.prisma b/packages/db/prisma/schema.prisma
similarity index 100%
rename from db/prisma/schema.prisma
rename to packages/db/prisma/schema.prisma
diff --git a/shared/index.ts b/packages/shared/index.ts
similarity index 100%
rename from shared/index.ts
rename to packages/shared/index.ts
diff --git a/shared/logger.ts b/packages/shared/logger.ts
similarity index 100%
rename from shared/logger.ts
rename to packages/shared/logger.ts
diff --git a/shared/package.json b/packages/shared/package.json
similarity index 100%
rename from shared/package.json
rename to packages/shared/package.json
diff --git a/shared/queues.ts b/packages/shared/queues.ts
similarity index 100%
rename from shared/queues.ts
rename to packages/shared/queues.ts
diff --git a/web/.env.sample b/packages/web/.env.sample
similarity index 100%
rename from web/.env.sample
rename to packages/web/.env.sample
diff --git a/web/Dockerfile b/packages/web/Dockerfile
similarity index 100%
rename from web/Dockerfile
rename to packages/web/Dockerfile
diff --git a/web/README.md b/packages/web/README.md
similarity index 100%
rename from web/README.md
rename to packages/web/README.md
diff --git a/web/app/api/auth/[...nextauth]/route.tsx b/packages/web/app/api/auth/[...nextauth]/route.tsx
similarity index 100%
rename from web/app/api/auth/[...nextauth]/route.tsx
rename to packages/web/app/api/auth/[...nextauth]/route.tsx
diff --git a/web/app/api/v1/links/[linkId]/route.ts b/packages/web/app/api/v1/links/[linkId]/route.ts
similarity index 100%
rename from web/app/api/v1/links/[linkId]/route.ts
rename to packages/web/app/api/v1/links/[linkId]/route.ts
diff --git a/web/app/api/v1/links/route.ts b/packages/web/app/api/v1/links/route.ts
similarity index 100%
rename from web/app/api/v1/links/route.ts
rename to packages/web/app/api/v1/links/route.ts
diff --git a/web/app/dashboard/bookmarks/components/AddLink.tsx b/packages/web/app/dashboard/bookmarks/components/AddLink.tsx
similarity index 100%
rename from web/app/dashboard/bookmarks/components/AddLink.tsx
rename to packages/web/app/dashboard/bookmarks/components/AddLink.tsx
diff --git a/web/app/dashboard/bookmarks/components/LinkCard.tsx b/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx
similarity index 100%
rename from web/app/dashboard/bookmarks/components/LinkCard.tsx
rename to packages/web/app/dashboard/bookmarks/components/LinkCard.tsx
diff --git a/web/app/dashboard/bookmarks/components/LinksGrid.tsx b/packages/web/app/dashboard/bookmarks/components/LinksGrid.tsx
similarity index 100%
rename from web/app/dashboard/bookmarks/components/LinksGrid.tsx
rename to packages/web/app/dashboard/bookmarks/components/LinksGrid.tsx
diff --git a/web/app/dashboard/bookmarks/page.tsx b/packages/web/app/dashboard/bookmarks/page.tsx
similarity index 100%
rename from web/app/dashboard/bookmarks/page.tsx
rename to packages/web/app/dashboard/bookmarks/page.tsx
diff --git a/web/app/dashboard/components/Sidebar.tsx b/packages/web/app/dashboard/components/Sidebar.tsx
similarity index 100%
rename from web/app/dashboard/components/Sidebar.tsx
rename to packages/web/app/dashboard/components/Sidebar.tsx
diff --git a/web/app/dashboard/layout.tsx b/packages/web/app/dashboard/layout.tsx
similarity index 100%
rename from web/app/dashboard/layout.tsx
rename to packages/web/app/dashboard/layout.tsx
diff --git a/web/app/favicon.ico b/packages/web/app/favicon.ico
similarity index 100%
rename from web/app/favicon.ico
rename to packages/web/app/favicon.ico
diff --git a/web/app/globals.css b/packages/web/app/globals.css
similarity index 100%
rename from web/app/globals.css
rename to packages/web/app/globals.css
diff --git a/web/app/layout.tsx b/packages/web/app/layout.tsx
similarity index 100%
rename from web/app/layout.tsx
rename to packages/web/app/layout.tsx
diff --git a/web/app/page.tsx b/packages/web/app/page.tsx
similarity index 100%
rename from web/app/page.tsx
rename to packages/web/app/page.tsx
diff --git a/web/bun.lockb b/packages/web/bun.lockb
similarity index 100%
rename from web/bun.lockb
rename to packages/web/bun.lockb
diff --git a/web/components.json b/packages/web/components.json
similarity index 100%
rename from web/components.json
rename to packages/web/components.json
diff --git a/web/components/auth/login.tsx b/packages/web/components/auth/login.tsx
similarity index 100%
rename from web/components/auth/login.tsx
rename to packages/web/components/auth/login.tsx
diff --git a/web/components/auth/logout.tsx b/packages/web/components/auth/logout.tsx
similarity index 100%
rename from web/components/auth/logout.tsx
rename to packages/web/components/auth/logout.tsx
diff --git a/web/components/ui/badge.tsx b/packages/web/components/ui/badge.tsx
similarity index 100%
rename from web/components/ui/badge.tsx
rename to packages/web/components/ui/badge.tsx
diff --git a/web/components/ui/button.tsx b/packages/web/components/ui/button.tsx
similarity index 100%
rename from web/components/ui/button.tsx
rename to packages/web/components/ui/button.tsx
diff --git a/web/components/ui/card.tsx b/packages/web/components/ui/card.tsx
similarity index 100%
rename from web/components/ui/card.tsx
rename to packages/web/components/ui/card.tsx
diff --git a/web/components/ui/dropdown-menu.tsx b/packages/web/components/ui/dropdown-menu.tsx
similarity index 100%
rename from web/components/ui/dropdown-menu.tsx
rename to packages/web/components/ui/dropdown-menu.tsx
diff --git a/web/components/ui/form.tsx b/packages/web/components/ui/form.tsx
similarity index 100%
rename from web/components/ui/form.tsx
rename to packages/web/components/ui/form.tsx
diff --git a/web/components/ui/imageCard.tsx b/packages/web/components/ui/imageCard.tsx
similarity index 100%
rename from web/components/ui/imageCard.tsx
rename to packages/web/components/ui/imageCard.tsx
diff --git a/web/components/ui/input.tsx b/packages/web/components/ui/input.tsx
similarity index 100%
rename from web/components/ui/input.tsx
rename to packages/web/components/ui/input.tsx
diff --git a/web/components/ui/label.tsx b/packages/web/components/ui/label.tsx
similarity index 100%
rename from web/components/ui/label.tsx
rename to packages/web/components/ui/label.tsx
diff --git a/web/components/ui/toast.tsx b/packages/web/components/ui/toast.tsx
similarity index 100%
rename from web/components/ui/toast.tsx
rename to packages/web/components/ui/toast.tsx
diff --git a/web/components/ui/toaster.tsx b/packages/web/components/ui/toaster.tsx
similarity index 100%
rename from web/components/ui/toaster.tsx
rename to packages/web/components/ui/toaster.tsx
diff --git a/web/components/ui/use-toast.ts b/packages/web/components/ui/use-toast.ts
similarity index 100%
rename from web/components/ui/use-toast.ts
rename to packages/web/components/ui/use-toast.ts
diff --git a/web/lib/api.ts b/packages/web/lib/api.ts
similarity index 100%
rename from web/lib/api.ts
rename to packages/web/lib/api.ts
diff --git a/web/lib/auth.ts b/packages/web/lib/auth.ts
similarity index 100%
rename from web/lib/auth.ts
rename to packages/web/lib/auth.ts
diff --git a/web/lib/config.ts b/packages/web/lib/config.ts
similarity index 100%
rename from web/lib/config.ts
rename to packages/web/lib/config.ts
diff --git a/web/lib/services/links.ts b/packages/web/lib/services/links.ts
similarity index 100%
rename from web/lib/services/links.ts
rename to packages/web/lib/services/links.ts
diff --git a/web/lib/types/api/links.ts b/packages/web/lib/types/api/links.ts
similarity index 100%
rename from web/lib/types/api/links.ts
rename to packages/web/lib/types/api/links.ts
diff --git a/web/lib/types/api/tags.ts b/packages/web/lib/types/api/tags.ts
similarity index 100%
rename from web/lib/types/api/tags.ts
rename to packages/web/lib/types/api/tags.ts
diff --git a/web/lib/types/next-auth.d.ts b/packages/web/lib/types/next-auth.d.ts
similarity index 100%
rename from web/lib/types/next-auth.d.ts
rename to packages/web/lib/types/next-auth.d.ts
diff --git a/web/lib/utils.ts b/packages/web/lib/utils.ts
similarity index 100%
rename from web/lib/utils.ts
rename to packages/web/lib/utils.ts
diff --git a/web/next.config.mjs b/packages/web/next.config.mjs
similarity index 100%
rename from web/next.config.mjs
rename to packages/web/next.config.mjs
diff --git a/web/package.json b/packages/web/package.json
similarity index 100%
rename from web/package.json
rename to packages/web/package.json
diff --git a/web/postcss.config.js b/packages/web/postcss.config.js
similarity index 100%
rename from web/postcss.config.js
rename to packages/web/postcss.config.js
diff --git a/web/public/next.svg b/packages/web/public/next.svg
similarity index 100%
rename from web/public/next.svg
rename to packages/web/public/next.svg
diff --git a/web/public/vercel.svg b/packages/web/public/vercel.svg
similarity index 100%
rename from web/public/vercel.svg
rename to packages/web/public/vercel.svg
diff --git a/web/tailwind.config.ts b/packages/web/tailwind.config.ts
similarity index 100%
rename from web/tailwind.config.ts
rename to packages/web/tailwind.config.ts
diff --git a/web/tsconfig.json b/packages/web/tsconfig.json
similarity index 100%
rename from web/tsconfig.json
rename to packages/web/tsconfig.json
diff --git a/workers/crawler.ts b/packages/workers/crawler.ts
similarity index 100%
rename from workers/crawler.ts
rename to packages/workers/crawler.ts
diff --git a/workers/index.ts b/packages/workers/index.ts
similarity index 100%
rename from workers/index.ts
rename to packages/workers/index.ts
diff --git a/workers/openai.ts b/packages/workers/openai.ts
similarity index 100%
rename from workers/openai.ts
rename to packages/workers/openai.ts
diff --git a/workers/package.json b/packages/workers/package.json
similarity index 91%
rename from workers/package.json
rename to packages/workers/package.json
index 1d32f499..e1407912 100644
--- a/workers/package.json
+++ b/packages/workers/package.json
@@ -4,7 +4,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
- "@remember/shared": "workspace:*",
+ "@remember/shared": "workspace:packages/*",
"metascraper": "^5.43.4",
"metascraper-description": "^5.43.4",
"metascraper-image": "^5.43.4",