Initial commit: add .gitignore and README
Some checks failed
DBIS Monorepo CI / Build (push) Has been cancelled
DBIS Monorepo CI / Lint (push) Has been cancelled
DBIS Monorepo CI / Type Check (push) Has been cancelled
DBIS Monorepo CI / Test (push) Has been cancelled

This commit is contained in:
defiQUG
2026-02-09 21:51:45 -08:00
commit f32bcd596f
14 changed files with 506 additions and 0 deletions

98
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,98 @@
name: DBIS Monorepo CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
test:
name: Test
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test
run: pnpm test
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
type-check:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Type Check
run: pnpm type-check

49
.gitignore vendored Normal file
View File

@@ -0,0 +1,49 @@
# Dependencies
node_modules/
.pnpm-store/
vendor/
# Package manager lock files (optional: uncomment to ignore)
# package-lock.json
# yarn.lock
# Environment and secrets
.env
.env.local
.env.*.local
*.env.backup
.env.backup.*
# Logs and temp
*.log
logs/
*.tmp
*.temp
*.tmp.*
# OS
.DS_Store
Thumbs.db
# IDE
.vscode/
.idea/
*.swp
*.swo
*~
# Build / output
dist/
build/
.next/
out/
*.pyc
__pycache__/
.eggs/
*.egg-info/
.coverage
htmlcov/
# Optional
.reports/
reports/

107
README.md Normal file
View File

@@ -0,0 +1,107 @@
# DBIS Monorepo
**Purpose**: Unified monorepo for all DBIS-related projects
**Status**: 🚧 Setup Complete - Ready for Migration
---
## Overview
This monorepo consolidates all DBIS-related projects into a single repository for improved code sharing, unified CI/CD, and streamlined development.
---
## Structure
```
dbis_monorepo/
├── packages/ # Shared packages
│ ├── shared-types # TypeScript types
│ ├── shared-utils # Utility functions
│ ├── shared-auth # Authentication utilities
│ └── api-client # API client
├── apps/ # Applications
│ └── (to be migrated)
├── tools/ # Development tools
│ └── (to be migrated)
├── infrastructure/ # Infrastructure as code
└── docs/ # Documentation
```
---
## Getting Started
### Prerequisites
- Node.js >= 18.0.0
- pnpm >= 8.0.0
### Installation
```bash
pnpm install
```
### Build
```bash
pnpm build
```
### Test
```bash
pnpm test
```
### Development
```bash
pnpm dev
```
---
## Shared Packages
### @dbis/shared-types
TypeScript types shared across DBIS projects.
### @dbis/shared-utils
Utility functions shared across DBIS projects.
### @dbis/shared-auth
Authentication utilities shared across DBIS projects.
### @dbis/api-client
API client for DBIS services.
---
## CI/CD
Unified CI/CD is configured in `.github/workflows/ci.yml`:
- Build all packages
- Run tests
- Lint code
- Type check
---
## Migration
See `docs/DBIS_MIGRATION_CHECKLIST.md` for migration instructions.
Use `scripts/migrate-dbis-project.sh` to help migrate projects.
---
## Documentation
- [Migration Plan](../docs/DBIS_MONOREPO_MIGRATION_PLAN.md)
- [Migration Checklist](../docs/DBIS_MIGRATION_CHECKLIST.md)
---
**Status**: 🚧 Setup Complete - Ready for Project Migration

24
package.json Normal file
View File

@@ -0,0 +1,24 @@
{
"name": "dbis-monorepo",
"version": "1.0.0",
"private": true,
"description": "DBIS monorepo for all DBIS-related projects",
"scripts": {
"build": "turbo run build",
"test": "turbo run test",
"lint": "turbo run lint",
"type-check": "turbo run type-check",
"clean": "turbo run clean",
"dev": "turbo run dev"
},
"devDependencies": {
"turbo": "^1.11.0",
"typescript": "^5.5.4"
},
"engines": {
"node": ">=18.0.0",
"pnpm": ">=8.0.0"
},
"packageManager": "pnpm@8.15.0"
}

View File

@@ -0,0 +1,29 @@
{
"name": "@dbis/api-client",
"version": "1.0.0",
"description": "API client for DBIS services",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc",
"test": "vitest",
"lint": "eslint src",
"type-check": "tsc --noEmit",
"clean": "rm -rf dist"
},
"dependencies": {
"@workspace/api-client": "workspace:*",
"@dbis/shared-types": "workspace:*"
},
"devDependencies": {
"typescript": "^5.5.4",
"vitest": "^1.2.0"
},
"files": [
"dist"
],
"publishConfig": {
"access": "restricted"
}
}

View File

@@ -0,0 +1,17 @@
/**
* @dbis/api-client
* API client for DBIS services
*/
import { createApiClient } from '@workspace/api-client';
import type { DBISConfig } from '@dbis/shared-types';
export function createDBISClient(config: DBISConfig) {
return createApiClient({
baseURL: config.apiUrl,
headers: {
'X-API-Key': config.apiKey,
},
});
}

View File

@@ -0,0 +1,28 @@
{
"name": "@dbis/shared-auth",
"version": "1.0.0",
"description": "Shared authentication utilities for DBIS projects",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc",
"test": "vitest",
"lint": "eslint src",
"type-check": "tsc --noEmit",
"clean": "rm -rf dist"
},
"dependencies": {
"@workspace/shared-auth": "workspace:*"
},
"devDependencies": {
"typescript": "^5.5.4",
"vitest": "^1.2.0"
},
"files": [
"dist"
],
"publishConfig": {
"access": "restricted"
}
}

View File

@@ -0,0 +1,19 @@
/**
* @dbis/shared-auth
* Shared authentication utilities for DBIS projects
*/
// Re-export workspace shared auth
export * from '@workspace/shared-auth';
// DBIS-specific auth utilities
export function hasDBISRole(user: { roles: string[] }, role: string): boolean {
return user.roles.includes(role);
}
export function requireDBISRole(user: { roles: string[] }, role: string): void {
if (!hasDBISRole(user, role)) {
throw new Error(`User does not have required role: ${role}`);
}
}

View File

@@ -0,0 +1,28 @@
{
"name": "@dbis/shared-types",
"version": "1.0.0",
"description": "Shared TypeScript types for DBIS projects",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc",
"test": "vitest",
"lint": "eslint src",
"type-check": "tsc --noEmit",
"clean": "rm -rf dist"
},
"dependencies": {
"@workspace/shared-types": "workspace:*"
},
"devDependencies": {
"typescript": "^5.5.4",
"vitest": "^1.2.0"
},
"files": [
"dist"
],
"publishConfig": {
"access": "restricted"
}
}

View File

@@ -0,0 +1,31 @@
/**
* @dbis/shared-types
* Shared TypeScript types for DBIS projects
*/
// Re-export workspace shared types
export * from '@workspace/shared-types';
// DBIS-specific types
export interface DBISConfig {
apiUrl: string;
apiKey: string;
environment: 'development' | 'staging' | 'production';
}
export interface DBISUser {
id: string;
email: string;
name: string;
roles: string[];
}
export interface DBISProject {
id: string;
name: string;
description: string;
status: 'active' | 'inactive' | 'archived';
createdAt: Date;
updatedAt: Date;
}

View File

@@ -0,0 +1,28 @@
{
"name": "@dbis/shared-utils",
"version": "1.0.0",
"description": "Shared utility functions for DBIS projects",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc",
"test": "vitest",
"lint": "eslint src",
"type-check": "tsc --noEmit",
"clean": "rm -rf dist"
},
"dependencies": {
"@workspace/shared-utils": "workspace:*"
},
"devDependencies": {
"typescript": "^5.5.4",
"vitest": "^1.2.0"
},
"files": [
"dist"
],
"publishConfig": {
"access": "restricted"
}
}

View File

@@ -0,0 +1,17 @@
/**
* @dbis/shared-utils
* Shared utility functions for DBIS projects
*/
// Re-export workspace shared utils
export * from '@workspace/shared-utils';
// DBIS-specific utilities
export function formatDBISDate(date: Date): string {
return date.toISOString().split('T')[0];
}
export function validateDBISEmail(email: string): boolean {
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email) && email.endsWith('@dbis.example.com');
}

4
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,4 @@
packages:
- 'packages/*'
- 'apps/*'
- 'tools/*'

27
turbo.json Normal file
View File

@@ -0,0 +1,27 @@
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", "build/**"]
},
"test": {
"dependsOn": ["build"],
"outputs": ["coverage/**"]
},
"lint": {
"outputs": []
},
"type-check": {
"dependsOn": ["^build"],
"outputs": []
},
"clean": {
"cache": false
},
"dev": {
"cache": false,
"persistent": true
}
}
}