A monorepo containing reusable components and utilities for Next.js, Node.js, and Python applications.
Reusable React UI components built with shadcn/ui patterns and Tailwind CSS.
Features:
- Button component with variants
- Built on Radix UI primitives
- Tailwind CSS styling
- TypeScript support
Usage:
import { Button } from '@cortex-shared/ui';
export default function App() {
return <Button variant="default">Click me</Button>;
}Authentication utilities for Node.js and Next.js applications.
Features:
- JWT token generation and verification
- Password hashing and verification
- Email and password validation
- Password strength checker
Usage:
import { generateToken, verifyPassword } from '@cortex-shared/auth';
const token = generateToken({ id: '123', email: 'user@example.com' }, secret);
const isValid = await verifyPassword('password', hash);See python/README.md for Python package structure and development.
- Node.js >= 18
- pnpm >= 8.0
- Python >= 3.9 (for Python packages)
- Install pnpm (if you haven't already):
npm install -g pnpm- Install dependencies:
pnpm install- Build all packages:
pnpm build- View unified documentation with Storybook:
pnpm storybookThis opens the Storybook documentation at http://localhost:6006 with all components and guides.
# Development mode (watch all packages)
pnpm dev
# Build all packages
pnpm build
# Lint all packages
pnpm lint
# Type check all packages
pnpm type-check
# Test all packages
pnpm testInteractive documentation for all components and utilities:
pnpm storybook # View Storybook (http://localhost:6006)
pnpm storybook:build # Build static site for deploymentThe Storybook includes:
- UI Components - Interactive component explorer with live examples
- Auth Utilities - Complete API reference with code examples
- Python Packages - Setup and usage guides
- Guides - Additional documentation and best practices
shared-components/
├── packages/
│ ├── ui/ # UI components
│ │ ├── src/
│ │ ├── .storybook/ # Component stories
│ │ ├── package.json
│ │ ├── tsconfig.json
│ │ └── vite.config.ts
│ └── auth/ # Auth utilities
│ ├── src/
│ ├── package.json
│ └── tsconfig.json
├── docs/ # Storybook documentation
│ ├── Welcome.mdx
│ ├── Auth.mdx
│ └── Python.mdx
├── .storybook/ # Root Storybook config
│ ├── main.ts
│ └── preview.ts
├── python/ # Python packages directory
│ ├── pyproject.toml
│ └── setup.cfg
├── .github/
│ ├── workflows/
│ │ ├── ci.yml # Run tests on PR/push
│ │ ├── publish.yml # Publish to npm
│ │ ├── publish-python.yml # Publish to PyPI
│ │ └── storybook.yml # Deploy docs to Pages
│ └── WORKFLOWS.md
├── package.json # Root workspace config
├── tsconfig.json # Shared TypeScript config
├── turbo.json # Turbo repo config
├── .eslintrc.json # Shared ESLint config
├── .prettierrc # Shared Prettier config
└── .gitignore
All packages share a base TypeScript configuration from tsconfig.json. Individual packages can extend this configuration in their own tsconfig.json files.
- ESLint:
.eslintrc.json- Shared linting rules - Prettier:
.prettierrc- Shared formatting rules
- Turbo:
turbo.json- Monorepo task orchestration - pnpm Workspaces:
package.json- Workspace configuration
Before publishing, ensure:
- Version numbers are updated in each package's
package.json - All tests pass
- All builds are successful
Publish with:
cd packages/ui
npm publish
cd ../auth
npm publishCreate individual pyproject.toml files in subdirectories under python/ for each Python package. See python/README.md for details.
The unified Storybook is automatically built and deployed to GitHub Pages on every push to main.
View the live documentation at: https://<your-username>.github.io/shared-components/
To enable GitHub Pages:
- Go to Settings → Pages
- Set source to "GitHub Actions"
- Documentation will deploy automatically
The workflow (.github/workflows/storybook.yml):
- Builds all packages
- Generates the Storybook static site
- Deploys to GitHub Pages
To clean up all build artifacts and node_modules:
pnpm clean # Remove all node_modules and build outputs- Create directory:
mkdir -p packages/my-package/src - Create
package.json:
{
"name": "@cortex-shared/my-package",
"version": "0.0.1",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"dev": "tsc --watch"
}
}- Create
tsconfig.jsonextending the root config - Run
pnpm installto add to workspace
- Create subdirectory:
mkdir -p python/my-package/src/my_package - Create
pyproject.tomlwith package configuration - See python/README.md for details
MIT
When contributing to this monorepo:
- Create a feature branch
- Make changes to relevant packages
- Update versions appropriately
- Run
pnpm build && pnpm lint && pnpm test - Create a pull request