This repository is a template for creating a full-stack application using Node.js, React, TypeScript, and Docker. It's structured as a pnpm workspace to manage the frontend and backend applications.
- Monorepo: pnpm workspace for managing the client and server packages.
- Frontend: Built with Tanstack Router, React and TypeScript, bundled using Vite for fast development.
- Backend: RESTful API built with Node.js, TypeScript, Express, and Mongoose.
- Docker: Containerized setup for the entire application.
- Linting: ESLint configuration for TypeScript and React to maintain code quality.
- A Code Editor and Terminal of your choice
- Node.js
- Docker
- pnpm
-
Clone the Repository
git clone https://github.com/Abdulkareemoj/node-react-ts-docker.git cd node-react-ts-docker -
Install Dependencies
Install all dependencies for both the client and server using pnpm from the root of the project.
pnpm install
To run both the frontend and backend development servers concurrently, use the following command from the root of the project:
pnpm devThe frontend will be accessible at http://localhost:5173, and the backend will be running on the port specified in your server's configuration.
To build and run the application using Docker, run the following command from the root of the project:
docker-compose up --buildThe application will be accessible at http://localhost:80.
node-react-ts-docker/
├── apps/
│ ├── client/ # Frontend application (React + TypeScript)
│ └── server/ # Backend application (Node.js + TypeScript)
├── package.json # Root package.json for workspace scripts
├── pnpm-workspace.yaml # pnpm workspace configuration
├── docker-compose.yml
├── Dockerfile
└── README.md
-
Environment Variables: Rename the
.env.templateto.envin the root directory and enter your details. These variables are used by the backend. -
Linting: To run the linter for both the client and server, run the following command from the root of the project:
pnpm --filter "./apps/*" lint
Contributions are welcome! Please fork the repository and submit a pull request for any changes.
This project is licensed under the MIT License.