A modern, full-stack monorepo built with Turborepo, featuring a NestJS backend, Next.js frontend, and Discord bot integration.
- Node.js 18+
- pnpm (recommended) or npm/yarn
- Git
# Clone the repository
git clone https://github.com/rrRunerra/Runa.git
cd Runa
# Install dependencies
pnpm install# Start all apps in development mode
pnpm dev
# Start a specific app
pnpm dev --filter=frontend
pnpm dev --filter=backend# Build all apps and packages
pnpm build
# Build a specific app
pnpm build --filter=backend# Run all tests
pnpm test
# Run tests for a specific app
pnpm test --filter=backendRuna/
βββ apps/
β βββ backend/ # NestJS API server
β βββ frontend/ # Next.js web application
β βββ lynx-bot/ # Discord bot
βββ packages/
β βββ api/ # Auto-generated SDK
β βββ auth/ # Shared authentication utilities
β βββ database/ # Prisma database client
β βββ ui/ # Shared UI component library
βββ turbo.json # Turborepo configuration
| Layer | Technologies |
|---|---|
| Frontend | Next.js, React, Tailwind CSS, TypeScript |
| Backend | NestJS, Prisma, TypeScript |
| Database | Prisma ORM |
| Bot | Discord.js, TypeScript |
| Build System | Turborepo, pnpm |
| Code Quality | ESLint, Prettier, TypeScript |
- TypeScript: 97.5%
- CSS: 1.6%
- Other: 0.9%
- RESTful API with TypeScript
- Database ORM with Prisma
- Authentication and authorization
- Dependency injection architecture
- Comprehensive error handling
- Server Components by default
- Responsive UI with Tailwind CSS
- Type-safe with TypeScript
- Optimized performance and SEO
- @runa/database: Prisma client and migrations
- @runa/auth: Authentication utilities
- @runa/ui: Reusable React components
- @runa/api: Auto-generated SDK
See AGENTS.md for comprehensive development guidelines:
- Explicit types for all function parameters and returns
- Use
unknowninstead ofany - Interfaces for object shapes, types for unions
- No
ascastsβuse proper typing
- Files: kebab-case (
user-service.ts) - Components/Classes: PascalCase (
UserService) - Functions/Variables: camelCase (
getUserById) - Constants: SCREAMING_SNAKE_CASE (
MAX_RETRY_COUNT)
// Import order:
import { external } from "external-lib"; // External libraries
import { Utility } from "@runa/database"; // Workspace packages
import { helper } from "../helpers"; // Relative imports# Run all tests
pnpm test --filter=backend
# Watch mode
pnpm test --filter=backend -- --watch
# Coverage
pnpm test:cov --filter=backendTests use Jest with ts-jest and follow the AAA pattern (Arrange, Act, Assert).
# Generate Prisma client
pnpm db:generate --filter=database
# Run migrations
pnpm db:migrate --filter=database
# Open Prisma Studio
cd packages/database
npx prisma studio| Command | Description |
|---|---|
pnpm dev |
Start all apps in development |
pnpm build |
Build all apps and packages |
pnpm test |
Run all tests |
pnpm lint |
Lint all code |
pnpm format |
Format code with Prettier |
pnpm check-types |
Type check all TypeScript |
# Deploy Next.js frontend to Vercel
# Connected via GitHub for automatic deployments# Build production image
docker build -t runa-backend apps/backend- AGENTS.md - Development guide for coding agents
- NestJS Documentation
- Next.js Documentation
- Prisma Documentation
- Turborepo Documentation
# Check all type errors
pnpm check-types
# Type check specific app
pnpm build --filter=backend# After schema changes
pnpm db:generate --filter=database
# Reset database
cd packages/database
npx prisma migrate reset# Clean install
rm -rf node_modules pnpm-lock.yaml
pnpm installFollow conventional commits:
feat:- New featuresfix:- Bug fixeschore:- Build, dependencies, configurationdocs:- Documentationrefactor:- Code improvementstest:- Tests
Example:
git commit -m "feat: add user authentication"This project is licensed under the MIT License - see the LICENSE file for details.
- Follow the guidelines in AGENTS.md
- Ensure code passes linting and type checking
- Write tests for new features
- Use conventional commits
- Create a pull request with a clear description