|
| 1 | +# Welcome to React Router! |
| 2 | + |
| 3 | +A modern, production-ready template for building full-stack React applications using React Router. |
| 4 | + |
| 5 | +[](https://stackblitz.com/github/remix-run/react-router-templates/tree/main/default) |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- 🚀 Server-side rendering |
| 10 | +- ⚡️ Hot Module Replacement (HMR) |
| 11 | +- 📦 Asset bundling and optimization |
| 12 | +- 🔄 Data loading and mutations |
| 13 | +- 🔒 TypeScript by default |
| 14 | +- 🎉 TailwindCSS for styling |
| 15 | +- 📖 [React Router docs](https://reactrouter.com/) |
| 16 | + |
| 17 | +## Getting Started |
| 18 | + |
| 19 | +### Installation |
| 20 | + |
| 21 | +Install the dependencies: |
| 22 | + |
| 23 | +```bash |
| 24 | +npm install |
| 25 | +``` |
| 26 | + |
| 27 | +### Development |
| 28 | + |
| 29 | +Start the development server with HMR: |
| 30 | + |
| 31 | +```bash |
| 32 | +npm run dev |
| 33 | +``` |
| 34 | + |
| 35 | +Your application will be available at `http://localhost:5173`. |
| 36 | + |
| 37 | +## Building for Production |
| 38 | + |
| 39 | +Create a production build: |
| 40 | + |
| 41 | +```bash |
| 42 | +npm run build |
| 43 | +``` |
| 44 | + |
| 45 | +## Deployment |
| 46 | + |
| 47 | +### Docker Deployment |
| 48 | + |
| 49 | +This template includes three Dockerfiles optimized for different package managers: |
| 50 | + |
| 51 | +- `Dockerfile` - for npm |
| 52 | +- `Dockerfile.pnpm` - for pnpm |
| 53 | +- `Dockerfile.bun` - for bun |
| 54 | + |
| 55 | +To build and run using Docker: |
| 56 | + |
| 57 | +```bash |
| 58 | +# For npm |
| 59 | +docker build -t my-app . |
| 60 | + |
| 61 | +# For pnpm |
| 62 | +docker build -f Dockerfile.pnpm -t my-app . |
| 63 | + |
| 64 | +# For bun |
| 65 | +docker build -f Dockerfile.bun -t my-app . |
| 66 | + |
| 67 | +# Run the container |
| 68 | +docker run -p 3000:3000 my-app |
| 69 | +``` |
| 70 | + |
| 71 | +The containerized application can be deployed to any platform that supports Docker, including: |
| 72 | + |
| 73 | +- AWS ECS |
| 74 | +- Google Cloud Run |
| 75 | +- Azure Container Apps |
| 76 | +- Digital Ocean App Platform |
| 77 | +- Fly.io |
| 78 | +- Railway |
| 79 | + |
| 80 | +### DIY Deployment |
| 81 | + |
| 82 | +If you're familiar with deploying Node applications, the built-in app server is production-ready. |
| 83 | + |
| 84 | +Make sure to deploy the output of `npm run build` |
| 85 | + |
| 86 | +``` |
| 87 | +├── package.json |
| 88 | +├── package-lock.json (or pnpm-lock.yaml, or bun.lockb) |
| 89 | +├── build/ |
| 90 | +│ ├── client/ # Static assets |
| 91 | +│ └── server/ # Server-side code |
| 92 | +``` |
| 93 | + |
| 94 | +## Styling |
| 95 | + |
| 96 | +This template comes with [Tailwind CSS](https://tailwindcss.com/) already configured for a simple default starting experience. You can use whatever CSS framework you prefer. |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +Built with ❤️ using React Router. |
0 commit comments