Drawer is a full-stack, scalable application built as a monorepo using Turborepo. It features a fast and modern Next.js frontend, accompanied by dedicated HTTP and WebSocket backend services.
This project is structured as a monorepo to seamlessly share code, types, and UI components across the frontend and backend services.
apps/web: The main frontend application built with Next.js 16 and React 19. It consumes the backend APIs and provides the user interface.apps/http-backend: A RESTful API server built with Node.js and Express. Handles core business logic, user authentication (via JWT), and database interactions.apps/ws-backend: A real-time WebSocket server built with thewslibrary for live bidirectional communication.
@repo/ui: Shared React component library.@repo/db: Database schema, client, and configuration.@repo/common: Shared utilities and constants.@repo/eslint-config: Standardized ESLint configurations.@repo/typescript-config: Sharedtsconfig.jsonfiles for consistent type checking.
Make sure you have the following installed on your machine:
- Node.js (v18 or higher)
- npm (v11+)
Clone the repository and install all dependencies from the root directory. Turborepo and npm workspaces will handle hoisting everything correctly.
git clone https://github.com/SAHIL15KP/Drawer.git
cd drawer
npm installStart all applications (Next.js frontend, HTTP backend, and WebSocket backend) simultaneously:
npm run devThis command uses turbo run dev to efficiently orchestrate the startup of all apps in parallel.
- The Next.js web app will be available at
http://localhost:3000.
Run these from the root of the project:
npm run dev: Starts the development servers for all apps.npm run build: Builds all apps and packages for production utilizing Turbo's caching.npm run lint: Runs ESLint across the entire workspace.npm run format: Formats all.ts,.tsx, and.mdfiles using Prettier.npm run check-types: Runs TypeScript compiler checks without emitting files.
This repository utilizes Turborepo to manage its complex architecture, providing:
- Fast Building: Caches outputs of tasks like
buildandlintso you never do the same work twice. - Parallel Execution: Maximizes CPU usage by running tasks simultaneously.
- Task Pipelines: Defines relationships between tasks (e.g., ensuring
@repo/uiis built beforeapps/web).