|
4 | 4 | [](../../actions/workflows/main.yml) |
5 | 5 | [](https://pettor.github.io/template-web-app-react/storybook/) |
6 | 6 |
|
7 | | -This is a template for building web applications with React. It includes a basic project structure and configuration files to help you get started quickly. |
| 7 | +A modern, production-ready React web application template designed to jumpstart your next project with industry best practices, comprehensive tooling, and a robust development workflow. |
8 | 8 |
|
9 | | -## Demo |
| 9 | +## 🚀 Demo |
10 | 10 |
|
11 | | -To check out a demo of the latest main branch [click here](https://pettor.github.io/template-web-app-react/app/). |
| 11 | +Experience the template in action: |
| 12 | +- **[Live Application Demo](https://pettor.github.io/template-web-app-react/app/)** - See the main application |
| 13 | +- **[Storybook Component Library](https://pettor.github.io/template-web-app-react/storybook/)** - Explore the component documentation |
12 | 14 |
|
13 | | -## Features |
| 15 | +## ✨ Key Features |
14 | 16 |
|
15 | | -This template includes the following features: |
| 17 | +This template provides a complete modern web development stack with everything you need to build scalable applications: |
16 | 18 |
|
17 | | -- [React](https://reactjs.org/) for building user interfaces. |
18 | | -- [TypeScript](https://www.typescriptlang.org/) for static type checking. |
19 | | -- [Vite](https://vitejs.dev/) for fast development and building. |
20 | | -- [Turborepo](https://turbo.build/repo/) for performant build system. |
21 | | -- [Tailwind CSS](https://tailwindcss.com/) for utility-first CSS. |
22 | | -- [DiasyUI](https://daisyui.com/) for component styling. |
23 | | -- [Storybook](https://storybook.js.org/) for component development. |
24 | | -- [Storybook Component Test](https://storybook.js.org/docs/writing-tests/component-testing) for testing components. |
25 | | -- [Playwright](https://playwright.dev/) for end-to-end testing. |
26 | | -- [Vitest](https://vitest.dev/) for testing components. |
27 | | -- [Github Actions](https://docs.github.com/en/actions) for continuous integration. |
28 | | -- [Github Pages](https://pages.github.com/) for hosting the application. |
29 | | -- [Prettier](https://prettier.io/) for code formatting. |
30 | | -- [ESLint](https://eslint.org/) for linting. |
| 19 | +### 🏗️ **Core Technologies** |
| 20 | +- **[React 19](https://reactjs.org/)** - Latest React with concurrent features and improved performance |
| 21 | +- **[TypeScript](https://www.typescriptlang.org/)** - Type-safe JavaScript for better developer experience and fewer runtime errors |
| 22 | +- **[Vite](https://vitejs.dev/)** - Lightning-fast development server and optimized production builds |
| 23 | +- **[Turborepo](https://turbo.build/repo/)** - High-performance monorepo build system for scalable development |
31 | 24 |
|
32 | | -## Getting Started |
| 25 | +### 🎨 **Styling & UI** |
| 26 | +- **[Tailwind CSS](https://tailwindcss.com/)** - Utility-first CSS framework for rapid UI development |
| 27 | +- **[DaisyUI](https://daisyui.com/)** - Beautiful, semantic component library built on Tailwind |
| 28 | +- **Responsive Design** - Mobile-first approach with modern CSS Grid and Flexbox layouts |
33 | 29 |
|
34 | | -To get started with this template, follow these steps: |
| 30 | +### 🧪 **Testing & Quality Assurance** |
| 31 | +- **[Vitest](https://vitest.dev/)** - Fast unit and integration testing with hot reload |
| 32 | +- **[Playwright](https://playwright.dev/)** - Reliable end-to-end testing across all browsers |
| 33 | +- **[Storybook Component Testing](https://storybook.js.org/docs/writing-tests/component-testing)** - Visual component testing and documentation |
| 34 | +- **Code Coverage Reports** - Comprehensive coverage tracking with detailed reporting |
35 | 35 |
|
36 | | -1. Clone the repository to your local machine. |
37 | | -1. Enable `corepack` by running `corepack enable`. |
38 | | -1. Install the dependencies by running `pnpm i` in the project directory. |
39 | | -1. Start the development server by running `pnpm dev`. |
| 36 | +### 🔧 **Development Tools** |
| 37 | +- **[Storybook](https://storybook.js.org/)** - Component development environment and documentation |
| 38 | +- **[ESLint](https://eslint.org/)** - Advanced linting with React and TypeScript rules |
| 39 | +- **[Prettier](https://prettier.io/)** - Consistent code formatting across the entire codebase |
| 40 | +- **Hot Module Replacement** - Instant feedback during development |
40 | 41 |
|
41 | | -### Enable Github Actions |
| 42 | +### 🚀 **DevOps & Deployment** |
| 43 | +- **[GitHub Actions](https://docs.github.com/en/actions)** - Automated CI/CD pipeline with comprehensive testing |
| 44 | +- **[GitHub Pages](https://pages.github.com/)** - Seamless deployment and hosting |
| 45 | +- **Automated Quality Gates** - Build, lint, and test validation on every pull request |
| 46 | +- **Branch Protection Rules** - Enforce code quality standards before merging |
42 | 47 |
|
43 | | -To enable Github Actions for this repository, follow these steps: |
| 48 | +### 🌐 **Additional Integrations** |
| 49 | +- **Mock API Server** - [Mocks Server](https://mocks-server.org/) integration for frontend development |
| 50 | +- **Internationalization Ready** - Built-in i18n support with React Intl |
| 51 | +- **Environment Configuration** - Multi-environment setup with proper variable management |
| 52 | +- **Performance Monitoring** - Build-time performance analysis and optimization |
44 | 53 |
|
45 | | -1. Go to the `Settings` tab in the repository. |
46 | | -1. Click the `Actions` tab in the sidebar. |
47 | | -1. Enable the `Allow all actions` option. |
48 | | -1. Click the `Rules` tab in the sidebar. |
49 | | -1. Add a new rule with the following settings: |
50 | | - - Name: `Main` |
51 | | - - Enforcement status: `Active` |
52 | | - - Target branches: `Include default branch` |
53 | | - - Rules: `Require status checks to pass` and add `Lint`, `Build`, `Test Components` and `Test E2E` checks. |
| 54 | +## 🏃♂️ Quick Start |
54 | 55 |
|
55 | | -### Enable Github Pages |
| 56 | +Get up and running in minutes: |
56 | 57 |
|
57 | | -To enable Github Pages for this repository, follow these steps: |
| 58 | +### Prerequisites |
| 59 | +- Node.js 22 or higher |
| 60 | +- pnpm (recommended package manager) |
58 | 61 |
|
59 | | -1. Go to the `Settings` tab in the repository. |
60 | | -1. Click the `Pages` tab in the sidebar. |
61 | | -1. Select the `deploy/main` branch as the source. |
62 | | -1. Update Readme with the correct link to the deployed application. |
| 62 | +### Installation |
63 | 63 |
|
64 | | -## Contributing |
| 64 | +1. **Clone the repository** |
| 65 | + ```bash |
| 66 | + git clone https://github.com/Pettor/template-web-app-react.git |
| 67 | + cd template-web-app-react |
| 68 | + ``` |
65 | 69 |
|
66 | | -Contributions are welcome! If you find a bug or have a feature request, please open an issue on the GitHub repository. If you would like to contribute code, please fork the repository and submit a pull request. |
| 70 | +2. **Enable corepack for package manager** |
| 71 | + ```bash |
| 72 | + corepack enable |
| 73 | + ``` |
67 | 74 |
|
68 | | -## License |
| 75 | +3. **Install dependencies** |
| 76 | + ```bash |
| 77 | + pnpm install |
| 78 | + ``` |
69 | 79 |
|
70 | | -This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. |
| 80 | +4. **Start development server** |
| 81 | + ```bash |
| 82 | + pnpm dev |
| 83 | + ``` |
| 84 | + |
| 85 | +Your application will be available at `http://localhost:5173` with hot reload enabled. |
| 86 | + |
| 87 | +### Available Scripts |
| 88 | + |
| 89 | +- `pnpm dev` - Start development server |
| 90 | +- `pnpm build` - Build for production |
| 91 | +- `pnpm test:unit` - Run unit tests |
| 92 | +- `pnpm test:e2e` - Run end-to-end tests |
| 93 | +- `pnpm lint` - Run ESLint |
| 94 | +- `pnpm storybook` - Start Storybook development server |
| 95 | +- `pnpm deploy` - Build and prepare for deployment |
| 96 | + |
| 97 | +## ⚙️ Configuration |
| 98 | + |
| 99 | +### GitHub Actions Setup |
| 100 | + |
| 101 | +Enable continuous integration and deployment: |
| 102 | + |
| 103 | +1. Navigate to repository **Settings** → **Actions** |
| 104 | +2. Enable **"Allow all actions"** |
| 105 | +3. Go to **Settings** → **Rules** and create a branch protection rule: |
| 106 | + - **Name**: Main |
| 107 | + - **Target**: Include default branch |
| 108 | + - **Required status checks**: `Lint`, `Build`, `Test Components`, `Test E2E` |
| 109 | + |
| 110 | +### GitHub Pages Deployment |
| 111 | + |
| 112 | +Set up automatic deployment: |
| 113 | + |
| 114 | +1. Go to **Settings** → **Pages** |
| 115 | +2. Select **Source**: Deploy from a branch |
| 116 | +3. Choose **Branch**: `deploy/main` |
| 117 | +4. Update README links to match your repository URL |
| 118 | + |
| 119 | +## 🏗️ Project Structure |
| 120 | + |
| 121 | +``` |
| 122 | +├── apps/ |
| 123 | +│ └── web/ # Main React application |
| 124 | +├── configs/ # Shared configs |
| 125 | +├── packages/ # Shared packages and utilities |
| 126 | +├── .github/ |
| 127 | +│ └── workflows/ # CI/CD pipeline definitions |
| 128 | +├── output/ # Build artifacts |
| 129 | +└── storybook-static/ # Storybook build output |
| 130 | +``` |
| 131 | + |
| 132 | +## 🔗 Related Templates |
| 133 | + |
| 134 | +Expand your development stack: |
| 135 | + |
| 136 | +- **[.NET 8 Backend Template](https://github.com/Pettor/template-web-api-dotnet)** - Fully integrated C# backend template designed to work seamlessly with this React frontend |
| 137 | + |
| 138 | +## 🤝 Contributing |
| 139 | + |
| 140 | +We welcome contributions! Here's how to get involved: |
| 141 | + |
| 142 | +1. **Fork the repository** |
| 143 | +2. **Create a feature branch**: `git checkout -b feature/amazing-feature` |
| 144 | +3. **Make your changes** and add tests |
| 145 | +4. **Run the test suite**: `pnpm test:unit && pnpm test:e2e` |
| 146 | +5. **Submit a pull request** with a clear description |
| 147 | + |
| 148 | +### Contribution Guidelines |
| 149 | + |
| 150 | +- Follow existing code style and conventions |
| 151 | +- Add tests for new features |
| 152 | +- Update documentation as needed |
| 153 | +- Ensure all CI checks pass |
| 154 | + |
| 155 | +## 📄 License |
| 156 | + |
| 157 | +This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details. |
| 158 | + |
| 159 | +## 🆘 Support |
| 160 | + |
| 161 | +- **Issues**: [GitHub Issues](https://github.com/Pettor/template-web-app-react/issues) |
| 162 | +- **Discussions**: [GitHub Discussions](https://github.com/Pettor/template-web-app-react/discussions) |
| 163 | +- **Documentation**: [Storybook Documentation](https://pettor.github.io/template-web-app-react/storybook/) |
| 164 | + |
| 165 | +--- |
| 166 | + |
| 167 | +**Ready to build something amazing?** 🚀 Star this repository if you find it helpful and share it with your team! |
0 commit comments