Application for making a simple list of tasks
- PHP 8.3
- MySQL (tested on 8.0.35)
clone repository
$ git clone https://github.com/MikusR/2024-01-17-taskman.git
use Composer to get dependencies
$ composer install
copy .env.example to .env and configure access to database for example:
TIMEZONE = "Europe/Riga"
DBNAME = "task_manager"
DBUSER = "taskman"
PASSWORD = "taskman"
HOST = "localhost"
DRIVER = "pdo_mysql"
database uses this table
create table tasks
(
id int auto_increment
primary key,
task_name varchar(255) null,
task_description text null,
created_at datetime null
);
run the application from /public directory for example using the built-in webserver
php -S localhost:8765 -t .\public
If using apache then check if /etc/apache2/apache2.conf has AllowOverride and use .htaccess. Also check if mod_rewrite is enabled
RewriteEngine On
RewriteCond %{REQUEST_URI} : :$0 ^(/.+)/(.*)::\2$
RewriteRule .* - [E=BASE:%1]
RewriteCond %{ENV : REDIRECT_STATUS} =""
RewriteRule ^index\.php(? : /(.*)|$) %{ENV:BASE}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ %{ENV : BASE}/index.php [L]
- doctrine/dbal (access to database)
- nesbot/carbon (better time and date)
- twig/twig (template engine)
- https://simplecss.org/ (styling)
- nikic/fast-route (for routing)
- vlucas/phpdotenv (configuration environment)
- public/index.php entry point for the application.
- app/Application.php deals with setting up the environment, routing. Calls the main controller and delegates to Twig.
- app/Controllers/TaskController.php creates connection to database and creating of Tasks.
- app/Models contains the used models.
- app/Views contains the Twig templates