3030│ ├── Entities/ # Domain entities (Post, Category)
3131│ ├── UseCases/ # Business logic (CreatePost, GetPosts, etc.)
3232│ ├── IO/Http/ # Controllers and HTTP layer
33- │ ├── Specs / # Domain tests
33+ │ ├── Testing / # Domain tests
3434│ └── BlogServiceProvider.php
3535```
3636
4646- PHP 8.1 or higher
4747- Composer
4848- Node.js and npm (for asset compilation)
49- - MySQL or SQLite database
49+ - MySQL database
5050
5151### Setup Steps
5252
@@ -115,19 +115,6 @@ php artisan serve
115115
116116Visit ` http://localhost:8000 ` to see your blog!
117117
118- ## Usage
119-
120- ### Public Access
121- - ** Home Page** : Browse all published posts
122- - ** Category Filter** : Click category buttons to filter posts
123- - ** Post Details** : Click on any post to read the full content
124-
125- ### Admin Access
126- 1 . ** Register** : Create an account at ` /register `
127- 2 . ** Login** : Access admin at ` /login `
128- 3 . ** Dashboard** : Overview at ` /admin/dashboard `
129- 4 . ** Manage Posts** : Create, edit, delete posts at ` /admin/posts `
130- 5 . ** Manage Categories** : Organize content at ` /admin/categories `
131118
132119### Default Admin Account
133120If you ran the seeder:
@@ -142,88 +129,3 @@ The application includes comprehensive tests following the clean architecture:
142129``` bash
143130# Run all tests
144131php artisan test
145-
146- # Run specific test suite
147- php artisan test --testsuite=Feature
148- php artisan test --testsuite=Unit
149-
150- # Run with coverage
151- php artisan test --coverage
152- ```
153-
154- ### Test Structure
155- - ** Domain Tests** : ` app/Blog/Specs/ ` - Tests for use cases and business logic
156- - ** Feature Tests** : ` tests/Feature/ ` - End-to-end HTTP tests
157- - ** Unit Tests** : ` tests/Unit/ ` - Individual component tests
158-
159- ## API Documentation
160-
161- ### Public Endpoints
162- - ` GET / ` - Blog home page
163- - ` GET /blog ` - Blog posts listing
164- - ` GET /blog/{slug} ` - Individual post view
165- - ` GET /?category={id} ` - Filter posts by category
166-
167- ### Admin Endpoints
168- - ` GET /admin/dashboard ` - Admin dashboard
169- - ` GET|POST /admin/posts ` - Posts management
170- - ` GET|POST /admin/categories ` - Categories management
171-
172- ## File Upload
173-
174- The application supports image uploads for blog posts:
175- - ** Supported formats** : JPEG, PNG, JPG, GIF
176- - ** Max size** : 2MB
177- - ** Storage** : ` storage/app/public/posts/ `
178- - ** URL** : Accessible via ` storage/posts/filename.jpg `
179-
180- ## Security Features
181-
182- - ** Authentication** : Laravel's built-in authentication
183- - ** Authorization** : Route protection with middleware
184- - ** CSRF Protection** : All forms include CSRF tokens
185- - ** File Upload Validation** : Secure image upload handling
186- - ** Input Validation** : Comprehensive form validation
187-
188- ## Performance Considerations
189-
190- - ** Eager Loading** : Related models loaded efficiently
191- - ** Pagination** : Large post lists are paginated
192- - ** Image Optimization** : Proper image handling and storage
193- - ** Caching** : Ready for Redis/Memcached implementation
194-
195- ## Deployment
196-
197- ### Production Checklist
198- 1 . Set ` APP_ENV=production ` in ` .env `
199- 2 . Set ` APP_DEBUG=false `
200- 3 . Configure production database
201- 4 . Run ` composer install --optimize-autoloader --no-dev `
202- 5 . Run ` php artisan config:cache `
203- 6 . Run ` php artisan route:cache `
204- 7 . Run ` php artisan view:cache `
205- 8 . Set up proper file permissions
206- 9 . Configure web server (Apache/Nginx)
207-
208- ### AWS Deployment
209- This project is configured for AWS deployment:
210- - ** EC2** : Application server
211- - ** RDS** : Database
212- - ** S3** : File storage (configure for images)
213- - ** CloudFront** : CDN for static assets
214-
215- ## Contributing
216-
217- 1 . Fork the repository
218- 2 . Create a feature branch
219- 3 . Follow the clean architecture patterns
220- 4 . Add appropriate tests
221- 5 . Submit a pull request
222-
223- ## License
224-
225- This project is open-sourced software licensed under the [ MIT license] ( https://opensource.org/licenses/MIT ) .
226-
227- ## Support
228-
229- For support and questions, please create an issue in the repository.
0 commit comments