An open API service indexing awesome lists of open source software.

https://github.com/shahadot786/fullstack-master-repo

A unified full-stack workspace containing multiple backend services, web applications, and mobile apps inside a single architecture. Designed for hands-on learning, scalable project structure, and mastering end-to-end development with API-driven design.
https://github.com/shahadot786/fullstack-master-repo

api-first backend-services expressjs fullstack fullstack-development fullstack-project javascript learning-project microservices-architecture mobile-app monolithic-repo nodejs portfolio-project react react-native software-architecture software-architecture-and-design system-design typescript web-application

Last synced: about 1 month ago
JSON representation

A unified full-stack workspace containing multiple backend services, web applications, and mobile apps inside a single architecture. Designed for hands-on learning, scalable project structure, and mastering end-to-end development with API-driven design.

Awesome Lists containing this project

README

          

# Nexus Fullstack Monorepo

[![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue.svg)](https://www.typescriptlang.org/)
[![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/)
[![Next.js](https://img.shields.io/badge/Next.js-16-black.svg)](https://nextjs.org/)
[![React Native](https://img.shields.io/badge/React%20Native-0.81-61dafb.svg)](https://reactnative.dev/)
[![Expo](https://img.shields.io/badge/Expo-54-000020.svg)](https://expo.dev/)
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

A production-ready, type-safe fullstack monorepo template featuring **Backend (Node.js/Express/MongoDB)**, **Web (Next.js)**, and **Mobile (React Native/Expo)** applications. Built with TypeScript, featuring complete authentication flows, real-time capabilities, and shared type safety across all platforms.

**Perfect for**: Learning fullstack development, starting new projects, or as a reference implementation for modern MERN stack applications.

---

## ๐Ÿ“ธ Screenshots

### Web Application

Click to view screenshots

#### Registration Page
![Registration](./docs/images/web-register.png)

#### Todo Dashboard (Dark Mode)
![Todo Dashboard](./docs/images/web-todo-dashboard.png)

#### Create Todo Dialog
![Create Todo](./docs/images/web-todo-create.png)

### Mobile Application

Click to view screenshots





Login Screen



Login Screen



Navigation Drawer



Navigation Drawer





Todo List (Light Mode)



Todo List Light



Todo List (Dark Mode)



Todo List Dark





Create Todo Modal



Create Todo



Settings & Profile



Settings




---

## ๐Ÿ“‹ Table of Contents

- [Features](#-features)
- [Project Status](#-project-status)
- [Project Structure](#-project-structure)
- [Quick Start](#-quick-start)
- [Environment Variables](#-environment-variables)
- [Available Scripts](#-available-scripts)
- [Authentication](#-authentication)
- [API Endpoints](#-api-endpoints)
- [Documentation](#-documentation)
- [Tech Stack](#๏ธ-tech-stack)
- [Deployment](#-deployment)
- [Contributing](#-contributing)
- [License](#-license)

---

## ๐Ÿš€ Features

### Backend (Node.js/Express)

#### โœ… Production-Ready Features
- **TypeScript** - Full type safety with path aliases (`@common`, `@services`, etc.)
- **Authentication Service** - Complete JWT-based auth system
- User registration with email verification (6-digit OTP)
- Login with access tokens (15min) and refresh tokens (7 days)
- Password reset flow with OTP
- Token refresh and rotation
- Protected routes with middleware
- **TODO Service** - Full CRUD example with user scoping
- **Expense Tracker** - Comprehensive expense management with custom categories and analytics
- **Chat Service** - Real-time private and group messaging with Socket.IO
- **Shoutbox** - Global real-time chat for all authenticated users
- **Weather Service** - Multi-provider weather data (OpenWeather, WeatherAPI) with rate limiting
- **URL Shortener** - URL management with short ID generation and click tracking
- **Analytics Service** - Global and user-specific statistics for various services
- **Upload Service** - Cloudinary integration for profile and group image management
- **Redis Caching** - Upstash Redis integration with TLS support
- **WebSocket** - Real-time notifications and messaging with Socket.IO
- **Validation** - Zod schemas for request validation
- **API Documentation** - Swagger/OpenAPI at `/api-docs`
- **Testing** - Jest + Supertest E2E tests with 80%+ coverage
- **Security** - Helmet, CORS, rate limiting, bcrypt password hashing
- **Email Service** - Resend and Nodemailer integration for OTP and system emails

#### ๐Ÿšง Placeholder Services (Ready for Implementation)
The monorepo includes placeholder service directories for remaining features:
- `aiqa` - AI/QA service
- `delivery` - Delivery tracking
- `notes` - Note-taking
- `shop` - E-commerce
- `social` - Social features

> See [Creating New Service Guide](./docs/CREATING_NEW_SERVICE.md) to implement these services.

### Shared Package

- **Types** - Shared TypeScript interfaces across all apps
- **Validation** - Reusable Zod schemas for consistent validation
- **Constants** - API endpoints, error messages, HTTP status codes
- **Utils** - Common helper functions

### Web Application (Next.js)

- **Next.js 16** - Latest App Router with React 19
- **Modern UI** - TailwindCSS 4 with Radix UI primitives
- **Authentication Pages** - Login, register, email verification, password reset
- **Dashboard Layout** - Responsive sidebar navigation with theme toggle
- **Feature Modules** - 11 feature pages matching backend services
- Todos (fully functional)
- Chat & Shoutbox (real-time messaging)
- Expense Tracker (categories, analytics)
- Weather (live updates)
- URL Shortener (management dashboard)
- Analytics (visualized stats)
- Profile (management, image uploads)
- Placeholder pages for remaining services (aiqa, delivery, notes, shop, social)
- **State Management** - Zustand stores with React Query for server state
- **Form Handling** - React Hook Form with Zod validation
- **Real-time Updates** - Socket.IO client integration
- **Theme Support** - Dark/light mode with next-themes
- **Type Safety** - Full TypeScript with shared types from monorepo

### Mobile Application (React Native/Expo)

- **Expo SDK 54** - Latest Expo with React Native 0.81
- **Navigation** - Expo Router with file-based routing
- **Complete Auth Flow** - All authentication screens
- Login, Register, Email Verification
- Forgot Password, Reset Password
- Persistent sessions with MMKV storage
- **Feature Modules** - Complete feature set matching parity
- TODO Management - Full CRUD with optimistic updates
- Chat & Shoutbox - Real-time private/group messaging
- Expense Management - Track daily expenses and categories
- Weather Dashboard - Live weather data
- URL Shortener - Mobile-native URL management
- Analytics - User and service statistics
- Profile management (Change Email, Password, Profile Image)

---

## ๐Ÿ“Š Project Status

### Fully Implemented โœ…
- **Backend**: Auth, Todo, Expense, Chat, Shoutbox, Weather, URL, Analytics, Upload
- **Web**: Auth, Dashboard, Todos, Chat, Expense, Weather, URL Shortener, Analytics, Profile
- **Mobile**: Auth, Todos, Chat, Expense, Weather, URL Shortener, Analytics, Profile Edit
- **Shared**: Types, validation schemas, constants, utilities

### Ready for Implementation ๐Ÿšง
- 9 backend service placeholders with corresponding web/mobile pages
- Additional features: notifications, file uploads, search, analytics

### Documentation ๐Ÿ“š
- โœ… Advanced authentication guide
- โœ… Service creation tutorial
- โœ… Deployment guide
- โœ… Architecture documentation
- โœ… Project structure guide

---

## ๐Ÿ“ Project Structure

```
fullstack-master-repo/
โ”œโ”€โ”€ backend/ # Node.js/Express API
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ common/ # Shared utilities
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ db/ # Database connection
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ errors/ # Custom error classes
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ services/ # Common services (email, redis, websocket)
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ utils/ # Helper functions
โ”‚ โ”‚ โ”œโ”€โ”€ config/ # Configuration
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ index.ts # Environment config
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ swagger.ts # API documentation config
โ”‚ โ”‚ โ”œโ”€โ”€ middleware/ # Express middleware
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ auth.middleware.ts
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ error.middleware.ts
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ validation.middleware.ts
โ”‚ โ”‚ โ””โ”€โ”€ services/ # Business logic by service
โ”‚ โ”‚ โ”œโ”€โ”€ auth/ # โœ… Authentication (IMPLEMENTED)
โ”‚ โ”‚ โ”œโ”€โ”€ todo/ # โœ… TODO CRUD (IMPLEMENTED)
โ”‚ โ”‚ โ”œโ”€โ”€ aiqa/ # ๐Ÿšง Placeholder
โ”‚ โ”‚ โ”œโ”€โ”€ chat/ # ๐Ÿšง Placeholder
โ”‚ โ”‚ โ”œโ”€โ”€ delivery/ # ๐Ÿšง Placeholder
โ”‚ โ”‚ โ”œโ”€โ”€ expense/ # ๐Ÿšง Placeholder
โ”‚ โ”‚ โ”œโ”€โ”€ notes/ # ๐Ÿšง Placeholder
โ”‚ โ”‚ โ”œโ”€โ”€ shop/ # ๐Ÿšง Placeholder
โ”‚ โ”‚ โ”œโ”€โ”€ social/ # ๐Ÿšง Placeholder
โ”‚ โ”‚ โ”œโ”€โ”€ urlshort/ # ๐Ÿšง Placeholder
โ”‚ โ”‚ โ””โ”€โ”€ weather/ # ๐Ÿšง Placeholder
โ”‚ โ”œโ”€โ”€ __tests__/ # Test files
โ”‚ โ”œโ”€โ”€ app.ts # Express app setup
โ”‚ โ”œโ”€โ”€ server.ts # Server entry point
โ”‚ โ””โ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ shared/ # Shared types & validation
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ types/ # TypeScript interfaces
โ”‚ โ”‚ โ”œโ”€โ”€ validation/ # Zod schemas
โ”‚ โ”‚ โ”œโ”€โ”€ constants/ # Shared constants
โ”‚ โ”‚ โ””โ”€โ”€ utils/ # Helper functions
โ”‚ โ””โ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ web/ # Next.js application
โ”‚ โ”œโ”€โ”€ app/
โ”‚ โ”‚ โ”œโ”€โ”€ (auth)/ # Auth pages (login, register, verify, reset)
โ”‚ โ”‚ โ”œโ”€โ”€ (dashboard)/ # Dashboard with sidebar
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ todos/ # โœ… TODO management (IMPLEMENTED)
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ profile/ # โœ… User profile (IMPLEMENTED)
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ aiqa/ # ๐Ÿšง Placeholder page
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ chat/ # ๐Ÿšง Placeholder page
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ delivery/ # ๐Ÿšง Placeholder page
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ expense/ # ๐Ÿšง Placeholder page
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ notes/ # ๐Ÿšง Placeholder page
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ shop/ # ๐Ÿšง Placeholder page
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ social/ # ๐Ÿšง Placeholder page
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ urlshort/ # ๐Ÿšง Placeholder page
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ weather/ # ๐Ÿšง Placeholder page
โ”‚ โ”‚ โ”œโ”€โ”€ layout.tsx # Root layout
โ”‚ โ”‚ โ””โ”€โ”€ providers.tsx # React Query & theme providers
โ”‚ โ”œโ”€โ”€ components/ # Reusable components
โ”‚ โ”œโ”€โ”€ lib/ # Utilities and API client
โ”‚ โ”œโ”€โ”€ public/ # Static assets
โ”‚ โ””โ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ mobile/ # React Native (Expo) app
โ”‚ โ”œโ”€โ”€ app/ # Expo Router screens
โ”‚ โ”‚ โ”œโ”€โ”€ (auth)/ # Auth screens
โ”‚ โ”‚ โ”œโ”€โ”€ (tabs)/ # Tab navigation
โ”‚ โ”‚ โ””โ”€โ”€ _layout.tsx # Root layout
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ api/ # API client
โ”‚ โ”‚ โ”œโ”€โ”€ components/ # Reusable components
โ”‚ โ”‚ โ”œโ”€โ”€ hooks/ # Custom hooks
โ”‚ โ”‚ โ”œโ”€โ”€ store/ # Zustand stores
โ”‚ โ”‚ โ”œโ”€โ”€ types/ # TypeScript types
โ”‚ โ”‚ โ””โ”€โ”€ utils/ # Helper functions
โ”‚ โ””โ”€โ”€ package.json
โ”‚
โ””โ”€โ”€ docs/ # Documentation
โ”œโ”€โ”€ ADVANCED_AUTH.md # Authentication guide
โ”œโ”€โ”€ ARCHITECTURE.md # System architecture
โ”œโ”€โ”€ CREATING_NEW_SERVICE.md # Service creation tutorial
โ”œโ”€โ”€ DEPLOYMENT.md # Deployment guide
โ”œโ”€โ”€ DEVELOPMENT_GUIDE.md # Developer workflow
โ””โ”€โ”€ PROJECT_STRUCTURE.md # Detailed structure guide
```

> For detailed structure documentation, see [PROJECT_STRUCTURE.md](./docs/PROJECT_STRUCTURE.md)

---

## ๐Ÿƒ Quick Start

### Prerequisites

- **Node.js** 18+ ([Download](https://nodejs.org/))
- **Yarn** 1.22+ (recommended) or npm
- **MongoDB** - Local installation or [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) (free tier)
- **Redis** - [Upstash Redis](https://upstash.com/redis) (free tier) or local installation
- **For Mobile**: [Expo Go](https://expo.dev/client) app on your phone or Android/iOS emulator

### Installation

This monorepo uses **independent `node_modules`** for each package (not Yarn workspaces) to ensure proper dependency isolation, especially important for React Native/Expo.

#### Option 1: Automated Setup (Recommended)

```bash
# Clone the repository
git clone
cd fullstack-master-repo

# Run the automated setup script
chmod +x setup.sh
./setup.sh
```

The setup script will:
1. Clean all existing `node_modules` directories
2. Install dependencies for each package (shared, backend, web, mobile)
3. Build the shared package
4. Verify all installations

#### Option 2: Manual Setup

```bash
# Clone the repository
git clone
cd fullstack-master-repo

# Install all packages at once
yarn install:all

# Or install individually:
cd shared && yarn install && yarn build && cd ..
cd backend && yarn install && cd ..
cd web && yarn install && cd ..
cd mobile && yarn install && cd ..
```

### Running the Applications

#### 1. Start Backend API

```bash
cd backend

# Copy environment file
cp .env.example .env

# Update .env with your configuration:
# - MongoDB URI (local or Atlas)
# - JWT secrets
# - Email credentials (for OTP)
# - Redis URL (Upstash or local)

# Run development server
yarn dev

# API will be available at http://localhost:8000
# Swagger docs at http://localhost:8000/api-docs
```

#### 2. Start Web Application

```bash
# In a new terminal
cd web

# Run development server
yarn dev

# Web app will be available at http://localhost:3000
```

#### 3. Start Mobile Application

```bash
# In a new terminal
cd mobile

# Update API base URL in src/api/config.ts:
# - iOS simulator: http://localhost:8000
# - Android emulator: http://10.0.2.2:8000
# - Physical device: http://YOUR_COMPUTER_IP:8000

# Start Expo
yarn start

# Scan QR code with Expo Go app (iOS/Android)
# Or press 'a' for Android emulator, 'i' for iOS simulator
```

#### Run All Applications Concurrently

```bash
# From root directory
yarn dev

# This runs: shared (watch mode), backend, and web concurrently
# Mobile must be started separately
```

---

## ๐Ÿ”ง Environment Variables

### Backend (`.env`)

Create a `.env` file in the `backend` directory:

```env
# Server
PORT=8000
NODE_ENV=development

# MongoDB
MONGO_URI=mongodb://localhost:27017/nexus
# Or use MongoDB Atlas:
# MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/dbname

# JWT
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production-min-32-chars
JWT_EXPIRES_IN=15m
JWT_REFRESH_SECRET=your-super-secret-refresh-key-change-this-in-production-min-32-chars
JWT_REFRESH_EXPIRES_IN=7d

# CORS
CORS_ORIGIN=http://localhost:3000

# Redis (Upstash - for OTP and caching)
# Get your Redis URL from https://upstash.com/redis
# Format: rediss://default:PASSWORD@HOST:PORT
REDIS_DATABASE_URI=rediss://default:your-password@your-host.upstash.io:6379

# Email (for OTP delivery)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_SECURE=false
EMAIL_USER=your-email@gmail.com
EMAIL_PASSWORD=your-app-password
EMAIL_FROM=noreply@nexus.app

# OTP Configuration
OTP_EXPIRY_MINUTES=10
```

> **Generate secure JWT secrets:**
> ```bash
> node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
> ```

### Mobile (`src/api/config.ts`)

Update the API base URL in `mobile/src/api/config.ts`:

```typescript
// For iOS simulator
export const API_BASE_URL = 'http://localhost:8000';

// For Android emulator
export const API_BASE_URL = 'http://10.0.2.2:8000';

// For physical device (use your computer's local IP)
export const API_BASE_URL = 'http://192.168.x.x:8000';
```

---

## ๐Ÿ“œ Available Scripts

### Root Directory

```bash
yarn install:all # Install dependencies for all packages
yarn build:shared # Build shared package
yarn build:all # Build shared, backend, and web
yarn dev # Run shared (watch), backend, and web concurrently
yarn dev:backend # Run backend only
yarn dev:web # Run web only
yarn dev:mobile # Run mobile only
yarn clean # Remove all node_modules
yarn test # Run backend tests
yarn lint # Lint backend and web
```

### Backend

```bash
yarn dev # Start development server with hot reload
yarn build # Build TypeScript to JavaScript
yarn start # Start production server
yarn test # Run unit tests with coverage
yarn test:watch # Run tests in watch mode
yarn test:e2e # Run E2E tests
```

### Web

```bash
yarn dev # Start Next.js development server
yarn build # Build for production
yarn start # Start production server
yarn lint # Run ESLint
```

### Mobile

```bash
yarn start # Start Expo development server
yarn android # Run on Android emulator
yarn ios # Run on iOS simulator
yarn web # Run in web browser
yarn lint # Run ESLint
```

### Shared

```bash
yarn build # Build TypeScript to JavaScript
yarn dev # Build in watch mode
yarn clean # Remove dist directory
```

---

## ๐Ÿ” Authentication

The monorepo includes a complete, production-ready JWT-based authentication system with email verification.

### Features

- **User Registration** - Password hashing with bcrypt (10 rounds)
- **Email Verification** - 6-digit OTP sent via email
- **Login** - JWT access token (15min) + refresh token (7 days)
- **Token Refresh** - Automatic token rotation
- **Password Reset** - Secure OTP-based flow
- **Protected Routes** - Authentication middleware
- **User Profile** - Get and update user information
- **Logout** - Token invalidation

### Authentication Flow

```mermaid
sequenceDiagram
participant User
participant Frontend
participant Backend
participant MongoDB
participant Redis
participant Email

User->>Frontend: Register
Frontend->>Backend: POST /api/auth/register
Backend->>MongoDB: Create user
Backend->>Redis: Store OTP
Backend->>Email: Send OTP
Backend->>Frontend: __nexus__production__token__access__token + __nexus__production__token__refresh__token
Frontend->>User: Check email for OTP

User->>Frontend: Enter OTP
Frontend->>Backend: POST /api/auth/verify-email
Backend->>Redis: Verify OTP
Backend->>MongoDB: Mark email verified
Backend->>Frontend: Success
Frontend->>User: Email verified
```

> For detailed authentication documentation, see [ADVANCED_AUTH.md](./docs/ADVANCED_AUTH.md)

---

## ๐Ÿ“ API Endpoints

### Authentication

```
POST /api/auth/register # Register new user
POST /api/auth/verify-email # Verify email with OTP
POST /api/auth/resend-verification # Resend verification OTP
POST /api/auth/login # Login user
POST /api/auth/refresh-token # Refresh access token
POST /api/auth/forgot-password # Request password reset OTP
POST /api/auth/reset-password # Reset password with OTP
GET /api/auth/me # Get current user (protected)
PUT /api/auth/me # Update user profile (protected)
POST /api/auth/logout # Logout user (protected)
```

### TODOs

```
POST /api/todos # Create TODO (protected)
GET /api/todos # Get all TODOs with pagination (protected)
GET /api/todos/:id # Get TODO by ID (protected)
PUT /api/todos/:id # Update TODO (protected)
DELETE /api/todos/:id # Delete TODO (protected)
DELETE /api/todos # Delete all TODOs (protected)
```

### API Documentation

Interactive API documentation is available at:
- **Swagger UI**: `http://localhost:8000/api-docs`
- **OpenAPI JSON**: `http://localhost:8000/api-docs.json`

---

## ๐Ÿ“š Documentation

- **[ARCHITECTURE.md](./docs/ARCHITECTURE.md)** - System architecture and design patterns
- **[PROJECT_STRUCTURE.md](./docs/PROJECT_STRUCTURE.md)** - Detailed project structure guide
- **[ADVANCED_AUTH.md](./docs/ADVANCED_AUTH.md)** - Authentication features and flows
- **[CREATING_NEW_SERVICE.md](./docs/CREATING_NEW_SERVICE.md)** - Tutorial for creating new services
- **[DEPLOYMENT.md](./docs/DEPLOYMENT.md)** - Deployment guide for all platforms
- **[DEVELOPMENT_GUIDE.md](./docs/DEVELOPMENT_GUIDE.md)** - Developer workflow and best practices
- **[Backend README](./backend/README.md)** - Backend-specific documentation

---

## ๐Ÿ› ๏ธ Tech Stack

### Backend
- **Runtime**: Node.js 18+
- **Framework**: Express.js 4.21+
- **Database**: MongoDB with Mongoose 9.0+
- **Cache**: Redis with ioredis 5.3+ (Upstash)
- **Authentication**: JWT + bcrypt
- **Email**: Nodemailer 6.9+
- **WebSocket**: Socket.IO 4.6+
- **Validation**: Zod 3.22+
- **Testing**: Jest 29+ + Supertest
- **Documentation**: Swagger/OpenAPI
- **Security**: Helmet, CORS, express-rate-limit

### Shared
- **Language**: TypeScript 5.9+
- **Validation**: Zod 3.22+
- **Build**: TypeScript Compiler

### Web
- **Framework**: Next.js 16
- **React**: React 19
- **Styling**: TailwindCSS 4 with PostCSS
- **UI Components**: Radix UI primitives
- **State Management**: Zustand 5 + React Query 5
- **Forms**: React Hook Form 7 + Zod
- **HTTP Client**: Axios 1.13+
- **WebSocket**: Socket.IO Client 4.8+
- **Theme**: next-themes 0.4+
- **Language**: TypeScript 5+
- **Linting**: ESLint 9

### Mobile
- **Framework**: React Native 0.81 with Expo 54
- **React**: React 19
- **Navigation**: Expo Router 6
- **UI Components**: Tamagui 1.141 + React Native Paper 5
- **State Management**: Zustand 5 with MMKV 4 persistence
- **Forms**: React Hook Form 7 + Zod 4
- **HTTP Client**: Axios 1.13+
- **WebSocket**: Socket.IO Client 4.8+
- **Language**: TypeScript 5.9+

---

## ๐Ÿšข Deployment

### Backend Deployment

Deploy to:
- **Render** - Free tier available
- **Railway** - Easy deployment with CLI
- **Heroku** - Classic PaaS
- **Docker** - Containerized deployment
- **VPS** - DigitalOcean, AWS EC2, etc.

### Web Deployment

Deploy to:
- **Vercel** - Optimized for Next.js (recommended)
- **Netlify** - Great for static sites
- **Railway** - Full-stack deployment
- **Docker** - Containerized deployment

### Mobile Deployment

Build and deploy with:
- **EAS Build** - Expo Application Services
- **App Store** - iOS deployment
- **Google Play Store** - Android deployment

> For detailed deployment instructions, see [DEPLOYMENT.md](./docs/DEPLOYMENT.md)

### Automated Deployment with GitHub Actions

The repository includes a GitHub Actions workflow for automated backend deployment to Render.

**How it works:**
- Automatically deploys backend when changes to `backend/` or `shared/` folders are merged to `master` branch
- Skips deployment for changes to web, mobile, or documentation files
- Supports manual deployment trigger from GitHub Actions tab

**Setup:**
1. Create a Render web service for your backend
2. Get Deploy Hook URL from Render Dashboard โ†’ Your Service โ†’ Settings โ†’ Deploy Hook
3. Add GitHub secret:
- Go to your repository โ†’ Settings โ†’ Secrets and variables โ†’ Actions
- Create new secret: `RENDER_DEPLOY_HOOK_URL`
- Paste your Deploy Hook URL as the value
4. Push changes to `master` branch - deployment will trigger automatically!

**Manual Deployment:**
- Go to GitHub Actions tab โ†’ "Deploy Backend to Render" โ†’ "Run workflow"

---

## ๐Ÿงช Testing

### Backend Tests

```bash
cd backend

# Run all tests with coverage
yarn test

# Run tests in watch mode
yarn test:watch

# Run E2E tests
yarn test:e2e
```

Test coverage includes:
- โœ… Authentication flow (register, login, verify, reset)
- โœ… TODO CRUD operations
- โœ… Validation and error handling
- โœ… User-scoped data access
- โœ… Token refresh and rotation

---

## ๐Ÿค Contributing

Contributions are welcome! This is a learning-focused monorepo.

### Ways to Contribute

1. **Implement Placeholder Services** - Choose from 9 placeholder services
2. **Enhance UI/UX** - Improve web and mobile interfaces
3. **Add Tests** - Increase test coverage
4. **Improve Documentation** - Fix typos, add examples
5. **Add Features** - File uploads, notifications, search, etc.
6. **Fix Bugs** - Report and fix issues

### Development Workflow

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Make your changes
4. Run tests (`yarn test`)
5. Commit your changes (`git commit -m 'Add amazing feature'`)
6. Push to the branch (`git push origin feature/amazing-feature`)
7. Open a Pull Request

> See [DEVELOPMENT_GUIDE.md](./docs/DEVELOPMENT_GUIDE.md) for detailed workflow and conventions.

---

## ๐Ÿ› Troubleshooting

### Common Issues

#### MongoDB Connection Failed
- Verify `MONGO_URI` in `.env`
- Check MongoDB is running (local) or IP whitelist (Atlas)
- Ensure network connectivity

#### Redis Connection Failed
- Verify `REDIS_DATABASE_URI` format: `rediss://` for TLS
- Check Upstash dashboard for correct credentials
- For local Redis: ensure it's running (`redis-cli ping`)

#### Mobile App Not Connecting to Backend
- Check API base URL in `mobile/src/api/config.ts`
- Use `10.0.2.2` for Android emulator
- Use your computer's local IP for physical devices
- Ensure backend is running and accessible

#### Email OTP Not Sending
- Verify email credentials in `.env`
- For Gmail: use App Password, not regular password
- Check spam folder
- Review backend logs for email errors

#### Shared Package Changes Not Reflecting
```bash
cd shared
yarn build
# Restart backend/web/mobile dev servers
```

---

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

## ๐Ÿ™ Acknowledgments

Built with best practices from:
- [Express.js Documentation](https://expressjs.com/)
- [MongoDB Best Practices](https://www.mongodb.com/docs/manual/)
- [TypeScript Handbook](https://www.typescriptlang.org/docs/)
- [Next.js Documentation](https://nextjs.org/docs)
- [React Native Documentation](https://reactnative.dev/)
- [Expo Documentation](https://docs.expo.dev/)
- [Jest Testing Library](https://jestjs.io/)
- [Swagger/OpenAPI Specification](https://swagger.io/specification/)

---

## ๐Ÿ“ž Support

- **Documentation**: Check the [docs](./docs) directory
- **Issues**: [GitHub Issues](https://github.com/your-repo/issues)
- **Discussions**: [GitHub Discussions](https://github.com/your-repo/discussions)

---

**Happy Coding! ๐Ÿš€**