Skip to content

Commit c7c2871

Browse files
committed
docs: Refactor README.md to enhance clarity and structure, update features section, and improve installation instructions.
1 parent eda8803 commit c7c2871

File tree

1 file changed

+125
-88
lines changed

1 file changed

+125
-88
lines changed

README.md

Lines changed: 125 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -23,124 +23,153 @@
2323
</a>
2424
</p>
2525

26-
</br>
26+
A modern, Bootstrap-5 powered Yii2 application template designed for rapid development of web applications.
2727

28-
<p align="center">
29-
Web Application Basic of Yii Version 2. <a href="http://www.yiiframework.com/" title="Yii Framework" target="_blank">Yii Framework</a> application best for rapidly creating projects with Bootstrap 5.
30-
</p>
28+
Built with best practices, clean architecture, and developer-friendly configuration.
3129

32-
</br>
30+
Perfect for creating production-ready web applications with minimal setup time while maintaining code quality and
31+
extensibility.
3332

3433
![app-basic](docs/home.png)
3534

36-
</br>
35+
## Features
3736

38-
## Directory structure
37+
-**Asset Management** - Optimized asset bundles for CSS, JS, and resource management.
38+
-**Clean Architecture** - Well-organized directory structure following Yii2 best practices.
39+
-**Console Commands** - Example console commands for background tasks and maintenance.
40+
-**Contact Form** - Fully functional contact form with validation and email sending.
41+
-**Developer Tools** - Debugging tools, logging, and development-friendly configurations.
42+
-**Modern Bootstrap 5 UI** - Responsive, mobile-first design with latest Bootstrap components.
43+
-**Multi-language Support** - Built-in internationalization (i18n) support with message translations.
44+
-**Ready-to-Use Pages** - Pre-built pages including home, about, contact, and error handling.
45+
-**Security Features** - Built-in CSRF protection, input validation, and secure configurations.
46+
-**Testing Ready** - Codeception test suite with examples for functional and unit testing.
3947

40-
```text
41-
root
42-
├── config
43-
│ ├── common Common configuration.
44-
│ │ └── components.php
45-
│ ├── console Console configuration.
46-
│ │ └── app.php
47-
│ ├── web Web configuration.
48-
│ │ ├── app.php
49-
│ │ ├── components.php
50-
│ │ └── modules.php
51-
│ ├── messages.php Translation configuration.
52-
│ ├── params-console.php Console parameters.
53-
│ └── params-web.php Web parameters.
54-
├── src
55-
│ ├── framework
56-
│ │ ├── asset Asset bundle files.
57-
│ │ ├── event Event handler files.
58-
│ │ └── resource
59-
│ │ ├── css Css files.
60-
│ │ ├── js Js files.
61-
│ │ ├── layout Layout files.
62-
│ │ ├── message Translation files.
63-
│ │ └── ApplicationParameters.php Configuration application parameters.
64-
│ └── usecase
65-
│ ├── contact Contact use case.
66-
│ ├── hello Hello use case (console).
67-
│ ├── security Security use case.
68-
│ └── site Site use case.
69-
├── tests Tests codeception.
70-
├── vendor Composer dependencies.
71-
└── public Web server public.
72-
```
48+
## Environment support
7349

74-
## Features
50+
[![Apache](https://img.shields.io/badge/apache-%23D42029.svg?style=for-the-badge&logo=apache&logoColor=white)](https://httpd.apache.org/)
51+
[![Nginx](https://img.shields.io/badge/nginx-%23009639.svg?style=for-the-badge&logo=nginx&logoColor=white)](https://nginx.org/)
52+
[![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)](https://www.docker.com/)
7553

76-
The web application contains:
54+
## Quick start
7755

78-
- [x] Pages - [Screenshots]:
79-
- [about](docs/about.png)
80-
- [contact](docs/contact.png)
81-
- [404](docs/404.png)
56+
### How it works
8257

83-
<p align="justify">
84-
It includes all commonly used configurations that would allow you to focus on adding new
85-
features to your application.
86-
</P>
58+
The Yii2 Web Application Basic template provides a complete foundation for building modern web applications. Unlike starting from scratch, this template includes:
8759

88-
## Installation
60+
1. **Pre-configured structure** with organized directories for assets, views, models, and controllers.
61+
2. **Bootstrap 5 integration** for responsive, mobile-first user interfaces.
62+
3. **Security features** including CSRF protection and input validation.
63+
4. **Development tools** for debugging, logging, and testing.
8964

90-
<p align="justify">
91-
If you do not have <a href="http://getcomposer.org/" title="Composer" target="_blank">Composer</a>, you may install it by following the instructions at <a href="http://getcomposer.org/doc/00-intro.md#installation-nix" title="getcomposer.org" target="_blank">getcomposer.org</a>.
92-
</p>
65+
#### Why use this template?
9366

94-
You can then install this project app-basic using the following command:
67+
- **Rapid development**: Start building features immediately without setup overhead.
68+
- **Best practices**: Follow Yii2 conventions and modern web development standards.
69+
- **Extensible**: Easy to customize and extend for specific project requirements.
70+
- **Production-ready**: Includes security features and optimizations for deployment.
9571

96-
```shell
97-
composer create-project --prefer-dist --stability=dev yii2-extensions/app-basic myapp
72+
```text
73+
Application structure:
74+
75+
Web App Basic
76+
├── Assets (CSS, JS, Images)
77+
├── Console (Background tasks)
78+
├── I18n (Multi-language support)
79+
├── Pages (Home, About, Contact, Error)
80+
├── Security (CSRF, Validation, Authentication)
81+
└── Testing (Unit, Functional tests)
9882
```
9983

100-
<p align="justify">
101-
Now you should be able to access the application through the following URL, assuming `public` is the directory
102-
directly under the Web root.
103-
</p>
84+
### Installation
10485

105-
__*Virtual Host:*__
86+
**Quick start**
10687

88+
```bash
89+
composer create-project --prefer-dist --stability=dev yii2-extensions/app-basic myapp
90+
cd myapp
10791
```
108-
http://localhost:8080/
109-
```
11092

111-
__*Server Yii:*__
93+
**Start development server**
94+
95+
```bash
96+
# Using built-in PHP server
97+
php -S localhost:8080 -t public
11298

113-
```shell
99+
# Or using Yii console command
114100
./yii serve
115101
```
116102

117-
__Console commands:__
103+
**Access your application**
118104

119-
```shell
120-
./yii hello/index
105+
```
106+
http://localhost:8080/
121107
```
122108

123-
## Generate translations
109+
### Basic usage
124110

125-
<p align="justify">
126-
To generate the Yii Web Application Basic translations, you can change the language settings in the configuration file.
127-
<p>
111+
#### Directory structure
128112

129-
```
130-
config/messages.php
113+
```text
114+
root/
115+
├── config/ Configuration files
116+
│ ├── common/ Common configuration
117+
│ ├── console/ Console configuration
118+
│ ├── web/ Web configuration
119+
│ └── messages.php Translation config
120+
├── src/
121+
│ ├── framework/ Framework assets & resources
122+
│ │ ├── asset/ Asset bundles
123+
│ │ ├── event/ Event handlers
124+
│ │ └── resource/ CSS, JS, layouts, messages
125+
│ └── usecase/ Application use cases
126+
│ ├── contact/ Contact functionality
127+
│ ├── hello/ Console command example
128+
│ ├── security/ Security features
129+
│ └── site/ Site pages
130+
├── tests/ Test suites
131+
├── vendor/ Composer dependencies
132+
└── public/ Web server document root
131133
```
132134

133-
<p align="justify">
134-
Automatically the generator will create the folder of your language in `src/Framework/resource/message`,
135-
If any translation is needed, you can open an issue to add it.
136-
</p>
135+
#### Creating your first page
137136

138-
Root directory
137+
```php
138+
<?php
139+
// src/usecase/site/SiteController.php
139140

141+
declare(strict_types=1);
142+
143+
namespace app\usecase\site;
144+
145+
use yii\web\Controller;
146+
147+
class SiteController extends Controller
148+
{
149+
public function actionIndex(): string
150+
{
151+
return $this->render('index');
152+
}
153+
154+
public function actionAbout(): string
155+
{
156+
return $this->render('about');
157+
}
158+
}
140159
```
160+
161+
#### Console commands
162+
163+
```bash
164+
# Run the hello command
165+
./yii hello/index
166+
167+
# Generate translations
141168
./yii message config/messages.php
142-
```
143169

170+
# Clear cache
171+
./yii cache/flush-all
172+
```
144173
## Quality code
145174

146175
[![Latest Stable Version](https://poser.pugx.org/yii2-extensions/app-basic/v)](https://packagist.org/packages/yii2-extensions/app-basic)
@@ -149,15 +178,23 @@ Root directory
149178
[![phpstan-level](https://img.shields.io/badge/PHPStan%20level-max-blue)](https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml)
150179
[![StyleCI](https://github.styleci.io/repos/698621511/shield?branch=main)](https://github.styleci.io/repos/698621511?branch=main)
151180

152-
## Tests
181+
## Documentation
182+
183+
For detailed configuration options and advanced usage:
184+
185+
- 📚 [Installation Guide](docs/installation.md)
186+
- ⚙️ [Configuration Reference](docs/configuration.md)
187+
- 💡 [Usage Examples](docs/examples.md)
188+
- 🧪 [Testing Guide](docs/testing.md)
189+
190+
## Screenshots
153191

154-
~~~
155-
// download all composer dependencies root project
156-
$ composer update --prefer-dist -vvv
192+
The web application includes these ready-to-use pages:
157193

158-
// run all tests with code coverage
159-
$ vendor/bin/codecept run --coverage-xml
160-
~~~
194+
- **[Home Page](docs/home.png)** - Welcome page with navigation
195+
- **[About Page](docs/about.png)** - Information about your application
196+
- **[Contact Page](docs/contact.png)** - Contact form with validation
197+
- **[404 Error Page](docs/404.png)** - Custom error handling
161198

162199
## Our social networks
163200

0 commit comments

Comments
 (0)