-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip * Structure * wip * Deploy * Deploy * Deploy * DB and config * Add avatar * Cascade * Team invites * Add api tokens * Use better auth * wip * wip * wip * wip * wip * wip * wip * remove kv * wip * wip * wip * wip
- Loading branch information
Showing
101 changed files
with
4,885 additions
and
604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: 🌟 Production Deployment - API | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- apps/api/** | ||
jobs: | ||
deploy-production: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
- name: 📦 Install dependencies | ||
run: bun install | ||
- name: 🔦 Run type checking | ||
run: bun turbo typecheck --filter=@languine/api | ||
- name: 🔬 Run linting | ||
run: bun turbo lint --filter=@languine/api | ||
- name: 🧪 Run unit tests | ||
run: bun turbo test --filter=@languine/api | ||
- name: 🗃️ Apply database migrations | ||
uses: cloudflare/wrangler-action@v3 | ||
with: | ||
packageManager: bun | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
workingDirectory: "apps/api" | ||
wranglerVersion: "latest" | ||
command: d1 migrations apply languine-production --env production --remote | ||
- name: 🚀 Deploy Project Artifacts to Cloudflare | ||
uses: cloudflare/wrangler-action@v3 | ||
with: | ||
packageManager: bun | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
workingDirectory: "apps/api" | ||
wranglerVersion: "latest" | ||
command: deploy --minify src/index.ts --env production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
RESEND_API_KEY= | ||
BETTER_AUTH_SECRET="<your-secret-here>" | ||
BETTER_AUTH_TRUSTED_ORIGINS="<server-origin-1>,<server-origin-2>" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineConfig } from "drizzle-kit"; | ||
|
||
export default defineConfig({ | ||
dialect: "sqlite", | ||
driver: "d1-http", | ||
out: "drizzle", | ||
schema: "./src/db/schema.ts", | ||
// Only needed for drizzle studio | ||
// dbCredentials: { | ||
// accountId: Bun.env.DB_ACCOUNT_ID!, | ||
// databaseId: Bun.env.DB_DATABASE_ID!, | ||
// token: Bun.env.DB_TOKEN!, | ||
// }, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
CREATE TABLE `accounts` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`account_id` text NOT NULL, | ||
`provider_id` text NOT NULL, | ||
`user_id` text NOT NULL, | ||
`access_token` text, | ||
`refresh_token` text, | ||
`id_token` text, | ||
`access_token_expires_at` integer, | ||
`refresh_token_expires_at` integer, | ||
`scope` text, | ||
`password` text, | ||
`created_at` integer NOT NULL, | ||
`updated_at` integer NOT NULL, | ||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE `invitations` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`organization_id` text NOT NULL, | ||
`email` text NOT NULL, | ||
`role` text, | ||
`status` text NOT NULL, | ||
`expires_at` integer NOT NULL, | ||
`inviter_id` text NOT NULL, | ||
FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE no action, | ||
FOREIGN KEY (`inviter_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE `members` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`organization_id` text NOT NULL, | ||
`user_id` text NOT NULL, | ||
`role` text NOT NULL, | ||
`created_at` integer NOT NULL, | ||
FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE no action, | ||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE `organizations` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`name` text NOT NULL, | ||
`slug` text, | ||
`logo` text, | ||
`created_at` integer NOT NULL, | ||
`metadata` text | ||
); | ||
--> statement-breakpoint | ||
CREATE UNIQUE INDEX `organizations_slug_unique` ON `organizations` (`slug`);--> statement-breakpoint | ||
CREATE TABLE `sessions` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`expires_at` integer NOT NULL, | ||
`token` text NOT NULL, | ||
`created_at` integer NOT NULL, | ||
`updated_at` integer NOT NULL, | ||
`ip_address` text, | ||
`user_agent` text, | ||
`user_id` text NOT NULL, | ||
`active_organization_id` text, | ||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action | ||
); | ||
--> statement-breakpoint | ||
CREATE UNIQUE INDEX `sessions_token_unique` ON `sessions` (`token`);--> statement-breakpoint | ||
CREATE TABLE `users` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`name` text NOT NULL, | ||
`email` text NOT NULL, | ||
`email_verified` integer NOT NULL, | ||
`image` text, | ||
`created_at` integer NOT NULL, | ||
`updated_at` integer NOT NULL | ||
); | ||
--> statement-breakpoint | ||
CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);--> statement-breakpoint | ||
CREATE TABLE `verifications` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`identifier` text NOT NULL, | ||
`value` text NOT NULL, | ||
`expires_at` integer NOT NULL, | ||
`created_at` integer, | ||
`updated_at` integer | ||
); |
Oops, something went wrong.