https://github.com/yii2-extensions/app-basic
Yii Web Application.
https://github.com/yii2-extensions/app-basic
app-basic config-plugin dark-theme multilanguage vertical-slices yii2 yii2-extensions
Last synced: 5 months ago
JSON representation
Yii Web Application.
- Host: GitHub
- URL: https://github.com/yii2-extensions/app-basic
- Owner: yii2-extensions
- License: bsd-3-clause
- Created: 2019-01-12T18:02:39.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2025-07-13T12:33:11.000Z (5 months ago)
- Last Synced: 2025-07-30T07:03:04.917Z (5 months ago)
- Topics: app-basic, config-plugin, dark-theme, multilanguage, vertical-slices, yii2, yii2-extensions
- Language: PHP
- Homepage:
- Size: 3.37 MB
- Stars: 14
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Web Application Basic
A modern, Bootstrap 5-powered Yii2 application template designed for rapid web-application development. Built with best practices, clean architecture, and developer-friendly configuration, it lets you create production-ready apps with minimal setup while maintaining code quality and extensibility.

## Features
- ✅ **Asset Management** - Optimized asset bundles for CSS, JS, and resource management.
- ✅ **Clean Architecture** - Well-organized directory structure following Yii2 best practices.
- ✅ **Console Commands** - Example console commands for background tasks and maintenance.
- ✅ **Contact Form** - Fully functional contact form with validation and email sending.
- ✅ **Developer Tools** - Debugging tools, logging, and development-friendly configurations.
- ✅ **Modern Bootstrap 5 UI** - Responsive, mobile-first design with latest Bootstrap components.
- ✅ **Multi-language Support** - Built-in internationalization (i18n) support with message translations.
- ✅ **Ready-to-Use Pages** - Pre-built pages including home, about, contact, and error handling.
- ✅ **Security Features** - Built-in CSRF protection, input validation, and secure configurations.
- ✅ **SSL Support** - Configured for secure HTTPS connections with SSL (mkcert).
- ✅ **Testing Ready** - Codeception test suite with examples for functional and unit testing.
## Supported web servers
[](docker-compose.yml)
[](docker-compose.caddy.yml)
[](docker-compose.frankenphp.yml)
[](docker-compose.nginx.yml)
## Quick start
### How it works
The Yii2 Web Application Basic template provides a complete foundation for building modern web applications. Unlike starting from scratch, this template includes.
1. **Pre-configured structure** with organized directories for assets, views, models, and controllers.
2. **Bootstrap 5 integration** for responsive, mobile-first user interfaces.
3. **Security features** including CSRF protection and input validation.
4. **Development tools** for debugging, logging, and testing.
#### Why use this template
- **Rapid development**: Start building features immediately without setup overhead.
- **Best practices**: Follow Yii2 conventions and modern web development standards.
- **Extensible**: Easy to customize and extend for specific project requirements.
- **Production-ready**: Includes security features and optimizations for deployment.
### Installation
**Quick start**
```bash
composer create-project --prefer-dist --stability=dev yii2-extensions/app-basic myapp
cd myapp
```
**Start development server**
```bash
# Using built-in PHP server
php -S localhost:8080 -t public
# Or using Yii console command
./yii serve
```
**Start Apache or Nginx server**
```bash
# For Apache
docker-compose up -d
# For Caddy
docker-compose -f docker-compose.caddy.yml up -d
# For FrankenPHP
docker-compose -f docker-compose.frankenphp.yml up -d
# For Nginx
docker-compose -f docker-compose.nginx.yml up -d
```
### Access your application
After starting the server, you can access your application in your web browser.
```bash
# For built-in PHP server
http://localhost:8080/
# For Apache
https://localhost:8443/
# For Caddy
https://localhost:8444/
# For FrankenPHP
https://localhost:8445/
# For Nginx
https://localhost:8446/
```
### Basic usage
#### Directory structure
```text
root/
├── config/ Configuration files
│ ├── common/ Common configuration
│ ├── console/ Console configuration
│ ├── web/ Web configuration
│ └── messages.php Translation config
├── docker/ Docker configuration files
│ ├── apache/ Apache configuration
│ ├── caddy/ Caddy configuration
│ ├── frankenphp/ FrankenPHP configuration
│ ├── nginx/ Nginx configuration
│ ├── php/ PHP configuration
│ ├── ssl/ SSL certificates
│ └── supervisor/ Supervisor configuration
├── src/
│ ├── framework/ Framework assets & resources
│ │ ├── asset/ Asset bundles
│ │ ├── event/ Event handlers
│ │ └── resource/ CSS, JS, layouts, messages
│ └── usecase/ Application use cases
│ ├── contact/ Contact functionality
│ ├── hello/ Console command example
│ ├── security/ Security features
│ └── site/ Site pages
├── tests/ Test suites
├── vendor/ Composer dependencies
└── public/ Web server document root
```
#### Creating your first page
```php
render('index');
}
public function actionAbout(): string
{
return $this->render('about');
}
}
```
#### Console commands
```bash
# Run the hello command
./yii hello/index
# Generate translations
./yii message config/messages.php
# Clear cache
./yii cache/flush-all
```
## Quality code
[](https://packagist.org/packages/yii2-extensions/app-basic)
[](https://packagist.org/packages/yii2-extensions/app-basic)
[](https://codecov.io/github/yii2-extensions/app-basic)
[](https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml)
[](https://github.styleci.io/repos/698621511?branch=main)
## Documentation
For detailed configuration options and advanced usage:
- 📚 [Installation Guide](docs/installation.md)
- ⚙️ [Configuration Reference](docs/configuration.md)
- 🧪 [Testing Guide](docs/testing.md)
## Screenshots
The web application includes these ready-to-use pages:
- **[Home Page](docs/home.png)** - Welcome page with navigation
- **[About Page](docs/about.png)** - Information about your application
- **[Contact Page](docs/contact.png)** - Contact form with validation
- **[404 Error Page](docs/404.png)** - Custom error handling
## Our social networks
[](https://x.com/Terabytesoftw)
## License
[](LICENSE.md)