
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@g-1/templates
Advanced tools
This directory contains all database table definitions using Drizzle ORM with SQLite.
db/
├── index.ts # Database connection factory
├── schema.ts # Central schema export (all tables)
├── auth.schema.ts # Better Auth tables (keep as-is)
├── tables/ # Custom application tables
│ ├── index.ts # Export all custom tables
│ └── [domain].table.ts
└── README.md # This file
auth.schema.tsusers, sessions, accounts, verifications, organizations, members, invitations, etc.[domain].table.tsanalytics.table.ts - Analytics and trackingbilling.table.ts - Billing and subscriptionsnotifications.table.ts - Notifications system✅ Framework compatibility - Better Auth may auto-update these tables ✅ Cohesive unit - Auth tables work together as a system ✅ Easier updates - Single file to manage when Better Auth updates ✅ Clear separation - Distinguishes framework code from business logic
✅ Better organization - Each business domain gets its own file ✅ Team development - Multiple developers can work on different domains ✅ Easier maintenance - Smaller, focused files are easier to understand ✅ Clear ownership - Each domain can have dedicated maintainers
// 1. Primary key pattern
id: text('id').primaryKey()
// 2. Timestamp pattern
createdAt: integer('created_at', { mode: 'timestamp' })
.$defaultFn(() => new Date())
.notNull()
updatedAt: integer('updated_at', { mode: 'timestamp' })
.$defaultFn(() => new Date())
.notNull()
// 3. Foreign key pattern
organizationId: text('organization_id')
.notNull()
.references(() => organizations.id, { onDelete: 'cascade' })
// 4. Enum constraint pattern
status: text('status', {
enum: ['draft', 'published', 'archived']
}).default('draft').notNull()
// 5. JSON metadata pattern
metadata: text('metadata') // Store as JSON string
All custom tables should include organizationId for proper multi-tenant isolation:
organizationId: text('organization_id').notNull().references(() => organizations.id, { onDelete: 'cascade' })
touch src/db/tables/analytics.table.ts
// analytics.table.ts
import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core'
import { organizations, users } from '../auth.schema'
export const pageViews = sqliteTable('page_views', {
id: text('id').primaryKey(),
path: text('path').notNull(),
userAgent: text('user_agent'),
ipAddress: text('ip_address'),
// Relations
userId: text('user_id')
.references(() => users.id, { onDelete: 'set null' }),
organizationId: text('organization_id')
.notNull()
.references(() => organizations.id, { onDelete: 'cascade' }),
createdAt: integer('created_at', { mode: 'timestamp' })
.$defaultFn(() => new Date())
.notNull(),
})
export * from './analytics.table'
bun db:generate
bun db:migrate:local
import { db } from '@/db'
import { pageViews, users } from '@/db/schema'
// All tables are available from the central schema export
const userPageViews = await db
.select()
.from(pageViews)
.where(eq(pageViews.userId, userId))
.table.ts filesbun db:generatedrizzle/ directorybun db:migrate:localbun db:migrate:remotecreatedAt and updatedAt timestampsorganizationId for multi-tenant isolationauth.schema.ts)data or infotables/index.tsThis structure provides the best of both worlds: framework compatibility for Better Auth and excellent organization for your custom business logic.
FAQs
Templates and boilerplate code for G1 Studio API projects
We found that @g-1/templates demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.