A modern full-stack monorepo for building scalable applications with NestJS and React Native.
Miru is a comprehensive monorepo that combines the power of NestJS for backend development with React Native/Expo for mobile applications. Built with TypeScript throughout, it provides a unified development experience for creating modern, scalable applications.
- Backend: NestJS framework with TypeScript
- Mobile: React Native with Expo
- Build System: Turbo for monorepo orchestration
- Package Management: npm workspaces
- Language: TypeScript across all packages
miru/
├── apps/
│ ├── api/ # NestJS backend application
│ │ ├── src/
│ │ │ ├── app.controller.ts
│ │ │ ├── app.service.ts
│ │ │ ├── app.module.ts
│ │ │ └── main.ts
│ │ ├── test/
│ │ └── package.json
│ └── mobile/ # React Native Expo mobile app
│ ├── App.tsx
│ ├── assets/
│ ├── components/
│ ├── src/
│ └── package.json
├── packages/ # Shared packages (utilities, types, etc.)
├── package.json # Root package.json with workspaces
├── turbo.json # Turbo configuration
└── .gitignore # Monorepo gitignore
- Node.js (v18 or higher)
- npm (v9 or higher)
- Git
# Clone the repository
$ git clone <repository-url>
$ cd miru
# Install dependencies
$ npm install
# Build all packages
$ npm run build# Start all applications in development mode
$ npm run dev
# Start specific applications
$ npm run dev:api # Backend only
$ npm run dev:mobile # Mobile only
# Build all packages
$ npm run build
# Run tests
$ npm run test
# Lint all packages
$ npm run lint
# Clean all build artifacts
$ npm run clean# Navigate to API directory
$ cd apps/api
# Development server
$ npm run start:dev
# Production mode
$ npm run start:prod
# Running tests
$ npm run test
$ npm run test:e2e
$ npm run test:cov# Navigate to mobile directory
$ cd apps/mobile
# Start Expo development server
$ npm start
# Platform-specific commands
$ npm run android
$ npm run ios
$ npm run webThe NestJS backend provides a comprehensive RESTful API with the following features:
- Modular Architecture: Organized into feature modules
- Dependency Injection: Built-in DI container
- Validation: Request/response validation with class-validator
- Authentication: JWT-based authentication system
- Database: TypeORM integration
- Testing: Unit and e2e test coverage
# Health check
GET /health
# Application status
GET /The React Native app provides a cross-platform mobile experience with:
- Cross-platform: iOS, Android, and Web support
- TypeScript: Full type safety
- Hot Reloading: Instant development feedback
- Navigation: React Navigation integration
- State Management: Built-in state management solutions
Create .env.local files in respective application directories:
Backend (apps/api/.env.local):
NODE_ENV=development
PORT=3000
DATABASE_URL=postgresql://user:password@localhost:5432/miru
JWT_SECRET=your-secret-keyMobile (apps/mobile/.env.local):
EXPO_API_URL=http://localhost:3000/apiThe monorepo uses Turbo for efficient builds and caching. Configuration is defined in turbo.json:
- Pipeline: Defines task dependencies and caching
- Outputs: Specifies build artifacts for caching
- Dependencies: Manages inter-package dependencies
# Run all tests
$ npm run test
# Run tests for specific packages
$ npm run test:api
$ npm run test:mobile
# Test coverage
$ npm run test:cov
# E2E tests
$ npm run test:e2e- Unit Tests: Individual component and service tests
- Integration Tests: API endpoint tests
- E2E Tests: End-to-end application tests
# Build for production
$ npm run build:api
# Deploy to production
$ npm run deploy:api# Build mobile app
$ npm run build:mobile
# Deploy to app stores
$ npm run deploy:mobileThe project includes GitHub Actions workflows for:
- Continuous Integration: Automated testing on pull requests
- Continuous Deployment: Automatic deployment on merge
- Code Quality: Linting and type checking
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use TypeScript for all new code
- Follow ESLint and Prettier configurations
- Write tests for new features
- Update documentation as needed
- Commits: Follow conventional commit messages
- Branches: Use feature branches for development
- Reviews: All PRs require code review
- Tests: Maintain test coverage above 80%
Check out these resources for learning more:
- NestJS Documentation - Backend framework guide
- Expo Documentation - Mobile development platform
- Turbo Documentation - Monorepo build system
- TypeScript Handbook - TypeScript guide
- React Native Docs - Mobile framework
- Discord Server - Chat with the community
- GitHub Discussions - Ask questions
- Twitter - Follow for updates
Miru is an MIT-licensed open source project. It grows thanks to the sponsors and support from the amazing backers. If you'd like to join them, please read more here.
- Project Website - https://miru.dev
- Twitter - @miruproject
- GitHub - miru-project/miru
Miru is MIT licensed.
Built with ❤️ by the Miru team