A comprehensive developer knowledge-sharing platform built with TypeScript, featuring video tutorials, product reviews, and community discussions.
Dev Wiki is a modern TypeScript-first monorepo that enables developers to share knowledge through interactive tutorials, video content, and product reviews. Built with scalability and developer experience in mind.
- Frontend: Next.js 15 (React 19) + Tailwind CSS + Shadcn/ui
- Backend: NestJS + TypeORM + PostgreSQL
- Authentication: JWT + Google OAuth + Role-based Access Control (RBAC)
- Monorepo: Turborepo + pnpm workspaces
- Language: TypeScript (strict mode)
- Code Quality: ESLint + Prettier + shared configurations
dev-wiki/
├── apps/
│ ├── web/ # Next.js frontend (port 3000)
│ ├── api/ # NestJS backend (port 8000)
│ └── db/ # Database scripts & Docker setup
├── packages/
│ ├── eslint-config/ # Shared ESLint rules
│ ├── typescript-config/ # Shared TypeScript configs
│ └── ui/ # Shared React components (@repo/ui)
└── docker-compose.yml # PostgreSQL + development services
- Node.js 18+
- pnpm 9.0.0+
- Docker (for PostgreSQL)
-
Clone and install dependencies:
git clone <repository-url> cd dev-wiki pnpm install
-
Start database:
docker compose up -d
-
Configure environment variables:
# Copy environment files for each app cp apps/api/.env.example apps/api/.env cp apps/web/.env.example apps/web/.env -
Start development servers:
pnpm dev
- Frontend: http://localhost:3000
- API: http://localhost:8000
- API Documentation: http://localhost:8000/api (Swagger)
- Database: PostgreSQL on localhost:5432
# Install dependencies
pnpm install
# Development (all apps)
pnpm dev
# Individual apps
pnpm dev --filter=web # Frontend only
pnpm dev --filter=api # Backend only
# Build
pnpm build # All apps
pnpm build --filter=api # Backend only
# Testing
pnpm test # All tests
pnpm test:e2e # End-to-end tests
pnpm test:cov # Coverage report
# Code quality
pnpm lint # Lint all code
pnpm lint --fix # Auto-fix issues
pnpm format # Format code# Start PostgreSQL
docker compose up -d
# View logs
docker compose logs postgres
# Connect to database
docker exec -it dev-wiki-postgres psql -U devwiki -d devwikiFor detailed database connection information and configuration, see the Database README.
For step-by-step backup instructions with DBeaver, see Database Backup Guide.
- JWT Tokens: Stored in localStorage for API authentication
- Role Cookies: Set by backend, read by frontend middleware for RBAC
- Google OAuth: Integrated via Passport.js
- Roles:
user,mod,adminwith route-level protection
- TypeScript strict mode - No
anytypes - Shared configurations - ESLint/Prettier/TypeScript
- Component patterns - Reusable UI components in
@repo/ui - API patterns - DTOs, Guards, Services, Controllers
- Use pnpm for all package management
- Follow RBAC patterns - Backend sets cookies, frontend enforces
- Type-safe APIs - Share types between frontend/backend
- Test thoroughly - Unit tests, E2E tests, coverage reports
- Error handling - Structured errors with user-friendly messages
- File naming: kebab-case for files, PascalCase for components
- Import order: External → Internal → Relative
- Error handling: Try/catch with specific error types
- Validation: DTOs (backend) + Zod schemas (frontend)
- Swagger UI: http://localhost:8000/api (when running)
Database connection failed:
# Ensure PostgreSQL is running
docker compose up -dTypeScript errors:
# Rebuild types
pnpm buildPort conflicts:
# Check running processes
lsof -i :3000 # Frontend
lsof -i :8000 # Backend
lsof -i :5432 # DatabaseBuild failures:
# Clean and reinstall
rm -rf node_modules
pnpm install
pnpm build