This project created for Holiday Pirates company. You need first add some users and a moderator to system. Then, you have to login. After login you can access job posting page. It will check your past job records and will send email if needed. If it is first job offer of user, managers will get an email. You have to login as manager to approve or mark as spam it.
- Used composer for package management.
- Created adapter interfaces for packages to make them decoupled from the system.
- All logic is in src folder.
- All 3rd party packages are in vendor folder.
- Configuration file is in config folder.
- Template (Twig/Html) files are in templates folder.
- Tests are in tests folder.
- Css files and other public files are under web folder.
- I created a bootstrap file that loads all necessary things in a file. Defined class dependencies in dependencies file and defined routes in routes.php
You need a web server that runs PHP code and a database such as MySQL or SQLite. Your browser have to support a mail function or you can use SMTP to send emails. You can use Homestead or similar development environment.
PHP 7.0+
Apache / Nginx
Mysql, Oracle, SQL Server, PostgreSQL, SQLite
Web Browser
composer install
- Duplicate
config/config.dist.php
file asconfig.php
and set your config variables. - Go to
/auth/register
page to add user or moderator - Go to
/auth/login
page to login - If you want to logout go to
/auth/logout
- Go to
/job/add
page to add a job offer
run phpunit tests
I used PSR1/2 code styles and PSR4 for namespaces. You can use Codesniffer to check the code against some standards.
./vendor/bin/phpcs src
./vendor/bin/phpcs --standard=psr2 src
- Friendly error page for live environment
- Validation for username and password
- Better code coverage for tests
- More decoupling more dependencies
- A common repository
- Error codes and memorable functions for errors / responses
- Redirect for controllers and after successful login
- Don't delete whole input data if there is a validation error
- Command bus pattern for simpler controllers
- Logging
- Cache
- Type casting for repositories
- Middleware layer
- Model relations
- Create a common class for email events
- Different class for managers
- Better authorization
- Ability to test repositories
- Filp/Whoops - Error handler
- Phpmailer - Popular email sending library
- HttpFoundation - Popular and powerful Symfony component for requests and responses in PHP
- FastRoute - A fast request router for PHP
- Auryn - IoC Dependency Injector
- Twig - Template engine for PHP
- Symfony/Validator - DSymfony componenet for data validation
- DBAL - Database Abstraction Package
- Hassankhan/Config - Config is a lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files
- PureCSS - Simple responsive css helper