Loading repository data…
Loading repository data…
barisgit / repository
Full Stack Typesafe Turborepo Boilerplate | Start quick with backend, web and mobile in NestJS, NextJS and Expo
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A modern full-stack, type-safe monorepo template with real-time capabilities and cross-platform support.
Demo · Report Bug · Request Feature
npm install -g pnpm)# Clone the repository
git clone https://github.com/barisgit/nextjs-nestjs-expo-template.git
cd nextjs-nestjs-expo-template
# Install dependencies
pnpm i # or pnpm install
# Run the development setup script
# This command handles:
# - Copying .env files
# - Setting up database (Docker or manual)
# - Setting up Redis (Docker)
# - Running database migrations
# - Seeding the database
pnpm dev:setup
# NOTE: Ensure Docker is running if you rely on the default Docker setup for PostgreSQL and Redis.
# The script will prompt you for necessary details or use .env files if they exist.
# Start all development servers (Backend, Web, Mobile)
pnpm dev
# Or run individual servers:
# pnpm dev:backend # NestJS
# pnpm dev:web # Next.js
# pnpm dev:mobile # Expo
nextjs-nestjs-expo-template/
├── apps/
│ ├── backend/ # NestJS API server
│ ├── web/ # Next.js web application
│ └── mobile/ # Expo React Native application
├── packages/
│ ├── analytics/ # PostHog analytics integration
│ ├── db/ # Database models and TypeORM configuration
│ ├── services/ # Shared services (auth, redis, webhooks)
│ ├── trpc/ # tRPC API router definitions and context
│ ├── ui/ # Shared UI components (ShadCN UI for web)
│ ├── websockets/ # Type-safe WebSocket implementation
│ ├── eslint-config/ # Shared ESLint configuration
│ └── typescript-config/ # Shared TypeScript configuration
Each package and application contains its own detailed documentation:
// Client component
function UserProfile() {
const { data, isLoading } = trpc.users.getProfile.useQuery();
if (isLoading) return <div>Loading...</div>;
return (
<div>
<h1>Welcome, {data.name}!</h1>
</div>
);
}
// WebSocket setup with type safety
import { createTypedSocketClient, ClientEvents, ServerEvents } from '@repo/websockets';
const socket = createTypedSocketClient('http://your-api-url');
socket.emit(ClientEvents.JOIN_ROOM, roomId);
// Listen for messages with full type safety
socket.on(ServerEvents.MESSAGE, (message) => {
console.log('New message:', message);
});
This project includes several helpful scripts for development and maintenance, located in the scripts/ directory.
pnpm inspect:envs
This command scans the apps/ and packages/ directories for all .env* files (e.g., .env, .env.local, .env.example). It then prints the key-value pairs found in each file, grouped by project (app or package).
This is useful for:
The script is powered by the EnvManager utility (scripts/utilities/env-manager.ts), which is designed to parse .env files while preserving comments and whitespace, making it useful for both reading and programmatically modifying environment configurations.
Contributions are what