better-auth-studio 1.0.5 → 1.0.7

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 (44) hide show
  1. package/package.json +8 -1
  2. package/frontend/index.html +0 -13
  3. package/frontend/package-lock.json +0 -4675
  4. package/frontend/package.json +0 -52
  5. package/frontend/pnpm-lock.yaml +0 -4020
  6. package/frontend/postcss.config.js +0 -6
  7. package/frontend/src/App.tsx +0 -36
  8. package/frontend/src/components/CommandPalette.tsx +0 -219
  9. package/frontend/src/components/Layout.tsx +0 -159
  10. package/frontend/src/components/ui/badge.tsx +0 -40
  11. package/frontend/src/components/ui/button.tsx +0 -53
  12. package/frontend/src/components/ui/card.tsx +0 -78
  13. package/frontend/src/components/ui/input.tsx +0 -20
  14. package/frontend/src/components/ui/label.tsx +0 -19
  15. package/frontend/src/components/ui/select.tsx +0 -71
  16. package/frontend/src/index.css +0 -130
  17. package/frontend/src/lib/utils.ts +0 -6
  18. package/frontend/src/main.tsx +0 -10
  19. package/frontend/src/pages/Dashboard.tsx +0 -231
  20. package/frontend/src/pages/OrganizationDetails.tsx +0 -1281
  21. package/frontend/src/pages/Organizations.tsx +0 -874
  22. package/frontend/src/pages/Sessions.tsx +0 -623
  23. package/frontend/src/pages/Settings.tsx +0 -1019
  24. package/frontend/src/pages/TeamDetails.tsx +0 -666
  25. package/frontend/src/pages/Users.tsx +0 -728
  26. package/frontend/tailwind.config.js +0 -75
  27. package/frontend/tsconfig.json +0 -31
  28. package/frontend/tsconfig.node.json +0 -10
  29. package/frontend/vite.config.ts +0 -31
  30. package/src/auth-adapter.ts +0 -473
  31. package/src/cli.ts +0 -51
  32. package/src/config.ts +0 -320
  33. package/src/data.ts +0 -351
  34. package/src/routes.ts +0 -1585
  35. package/src/studio.ts +0 -86
  36. package/test-project/README.md +0 -0
  37. package/test-project/better-auth.db +0 -0
  38. package/test-project/better-auth_migrations/2025-08-27T15-55-04.099Z.sql +0 -7
  39. package/test-project/better-auth_migrations/2025-09-04T02-33-19.422Z.sql +0 -7
  40. package/test-project/package.json +0 -29
  41. package/test-project/pnpm-lock.yaml +0 -1728
  42. package/test-project/src/auth.ts +0 -47
  43. package/test-project/src/index.ts +0 -40
  44. package/tsconfig.json +0 -21
package/src/studio.ts DELETED
@@ -1,86 +0,0 @@
1
- import express from 'express';
2
- import cors from 'cors';
3
- import { createServer } from 'http';
4
- import { WebSocketServer } from 'ws';
5
- import { join } from 'path';
6
- import open from 'open';
7
- import chalk from 'chalk';
8
- import { createRoutes } from './routes';
9
- import { AuthConfig } from './config';
10
-
11
- interface StudioOptions {
12
- port: number;
13
- host: string;
14
- openBrowser: boolean;
15
- authConfig: AuthConfig;
16
- }
17
-
18
- export async function startStudio(options: StudioOptions) {
19
- const { port, host, openBrowser, authConfig } = options;
20
- const app = express();
21
- const server = createServer(app);
22
-
23
- // CORS configuration
24
- app.use(cors({
25
- origin: ['http://localhost:3000', 'http://localhost:3001'],
26
- credentials: true
27
- }));
28
-
29
- app.use(express.json());
30
- app.use(express.urlencoded({ extended: true }));
31
-
32
- const wss = new WebSocketServer({ server });
33
-
34
- wss.on('connection', (ws) => {
35
- console.log(chalk.gray('šŸ”Œ WebSocket client connected'));
36
-
37
- const heartbeat = setInterval(() => {
38
- ws.ping();
39
- }, 30000);
40
-
41
- ws.on('close', () => {
42
- console.log(chalk.gray('šŸ”Œ WebSocket client disconnected'));
43
- clearInterval(heartbeat);
44
- });
45
-
46
- ws.on('error', (error) => {
47
- console.error('WebSocket error:', error);
48
- clearInterval(heartbeat);
49
- });
50
- });
51
-
52
- app.use(createRoutes(authConfig));
53
-
54
- app.use(express.static(join(__dirname, '../public')));
55
-
56
- app.get('*', (req, res) => {
57
- res.sendFile(join(__dirname, '../public/index.html'));
58
- });
59
-
60
- server.listen(port, host, () => {
61
- const url = `http://${host}:${port}`;
62
- console.log(chalk.green('āœ… Better Auth Studio is running!'));
63
- console.log(chalk.blue(`🌐 Dashboard: ${url}`));
64
- console.log(chalk.gray(`šŸ“Š API: ${url}/api`));
65
- console.log(chalk.gray(`šŸ”Œ WebSocket: ws://${host}:${port}`));
66
- console.log(chalk.yellow('\nPress Ctrl+C to stop the server\n'));
67
-
68
- if (openBrowser) {
69
- setTimeout(() => {
70
- open(url).catch(() => {
71
- console.log(chalk.yellow('Could not open browser automatically. Please visit:'), url);
72
- });
73
- }, 1000);
74
- }
75
- });
76
-
77
- process.on('SIGINT', () => {
78
- console.log(chalk.yellow('\nšŸ›‘ Shutting down Better Auth Studio...'));
79
- server.close(() => {
80
- console.log(chalk.green('āœ… Server stopped'));
81
- process.exit(0);
82
- });
83
- });
84
-
85
- return server;
86
- }
File without changes
Binary file
@@ -1,7 +0,0 @@
1
- create table "user" ("id" text not null primary key, "name" text not null, "email" text not null unique, "emailVerified" integer not null, "image" text, "createdAt" date not null, "updatedAt" date not null);
2
-
3
- create table "session" ("id" text not null primary key, "expiresAt" date not null, "token" text not null unique, "createdAt" date not null, "updatedAt" date not null, "ipAddress" text, "userAgent" text, "userId" text not null references "user" ("id") on delete cascade);
4
-
5
- create table "account" ("id" text not null primary key, "accountId" text not null, "providerId" text not null, "userId" text not null references "user" ("id") on delete cascade, "accessToken" text, "refreshToken" text, "idToken" text, "accessTokenExpiresAt" date, "refreshTokenExpiresAt" date, "scope" text, "password" text, "createdAt" date not null, "updatedAt" date not null);
6
-
7
- create table "verification" ("id" text not null primary key, "identifier" text not null, "value" text not null, "expiresAt" date not null, "createdAt" date, "updatedAt" date);
@@ -1,7 +0,0 @@
1
- alter table "session" add column "activeOrganizationId" text;
2
-
3
- create table "organization" ("id" text not null primary key, "name" text not null, "slug" text not null unique, "logo" text, "createdAt" date not null, "metadata" text);
4
-
5
- create table "member" ("id" text not null primary key, "organizationId" text not null references "organization" ("id") on delete cascade, "userId" text not null references "user" ("id") on delete cascade, "role" text not null, "createdAt" date not null);
6
-
7
- create table "invitation" ("id" text not null primary key, "organizationId" text not null references "organization" ("id") on delete cascade, "email" text not null, "role" text, "status" text not null, "expiresAt" date not null, "inviterId" text not null references "user" ("id") on delete cascade);
@@ -1,29 +0,0 @@
1
- {
2
- "name": "better-auth-test-project",
3
- "version": "1.0.0",
4
- "description": "Test project for Better Auth Studio",
5
- "main": "dist/index.js",
6
- "scripts": {
7
- "build": "tsc",
8
- "dev": "tsx src/index.ts",
9
- "start": "node dist/index.js",
10
- "studio": "better-auth-studio studio",
11
- "studio:dev": "rm -rf node_modules && rm -rf dist && pnpm install && pnpm studio --port 3001"
12
- },
13
- "dependencies": {
14
- "@types/better-sqlite3": "^7.6.13",
15
- "better-auth": "1.3.5",
16
- "better-auth-studio": "file:../",
17
- "better-sqlite3": "^12.2.0",
18
- "express": "^4.18.2"
19
- },
20
- "devDependencies": {
21
- "@types/express": "^4.17.21",
22
- "@types/node": "^20.10.0",
23
- "tsx": "^4.6.0",
24
- "typescript": "^5.3.2"
25
- },
26
- "engines": {
27
- "node": ">=18.0.0"
28
- }
29
- }