diff --git a/content/articles/personal-website.md b/content/articles/personal-website.md index 0d7ad77..d770a4b 100644 --- a/content/articles/personal-website.md +++ b/content/articles/personal-website.md @@ -1,10 +1,120 @@ --- title: "Personal Website" -description: "Stuff go here." +description: "Open-source content management system." +navigation: false --- -# Test! +Open-source content management system.
+Repository at +[GitHub](https://github.com/riyyi/website), +[GitLab](https://gitlab.com/riyyi/website) or +[Gitea](https://git.riyyi.com/riyyi/website). +
-This is another article. +This is the CMS that is used for this website! It's written in PHP 7, MySQL and +jQuery, with the libraries Klein.php and Mailer. -![database design](/img/personal-website/database-design.png) +Features: + +- PHP 7 +- Composer + - [Klein.php](https://github.com/klein/klein.php) + - [Mailer](https://github.com/txthinking/Mailer) +- MVC design pattern +- MySQL database for storing data +- CMS with CRUD functions for managing data +- ORM for mapping between PHP classes and data +- Login system + - Stay logged in using cookies + - Forget password with a generated link send using mail +- Security mitigations + - Password hashing using BCrypt + - Per-user cryptographically secure generated salt + - SQL injection protection using prepared statements + - XSS + - Cookies set to 'HttpOnly' + - Escape rendered user input using: `htmlentities(ENT_QUOTES | ENT_HTML5, 'UTF-8');` + - CSRF + - Cookies 'SameSite' set to 'Strict' + - Token for each session used in POST/PUT/DELETE requests +- Bootstrap +- jQuery + +Directory structure: + +``` +. +├── app +│ ├── classes +│ │ └── +│ ├── controllers +│ │ └── +│ ├── helper.php +│ ├── model +│ │ └── +│ ├── seed.php +│ ├── traits +│ │ └── Log.php +│ └── views +│ └── +├── composer.json +├── config.php +├── config.php.example +├── public +│ ├── index.php +│ └── +├── route.php +├── syncconfig.sh +├── syncconfig.sh.example +└── sync.sh +``` + +
+
+ +Pictured below is the EER (Enhanced entity-relationship) diagram of the MySQL database: +![website database design](/img/personal-website/database-design.png "website database design") + +
+
+ +Some of the pages of the CMS. + +
+
+ +Admin menu. +![admin menu](/img/personal-website/admin-menu.png "admin menu") + +
+
+ +CRUD index page, displaying all the entries of this table, including pagination. +![crud index page](/img/personal-website/crud-index.png "crud index page") + +
+
+ +CRUD edit page, editing an entry. +![crud edit page](/img/personal-website/crud-edit.png "crud edit page") + +
+
+ +CRUD show page, show all values of an entry. +![crud show page](/img/personal-website/crud-show.png "crud show page") + +
+
+ +Login page. +![login page](/img/personal-website/login.png "login page") + +
+
+ +Password reset page, showing a flash message. +![password reset page](/img/personal-website/reset-password.png "password reset page") + +
+
diff --git a/public/img/personal-website/admin-menu.png b/public/img/personal-website/admin-menu.png new file mode 100644 index 0000000..c800d02 Binary files /dev/null and b/public/img/personal-website/admin-menu.png differ diff --git a/public/img/personal-website/crud-edit.png b/public/img/personal-website/crud-edit.png new file mode 100644 index 0000000..1d648b6 Binary files /dev/null and b/public/img/personal-website/crud-edit.png differ diff --git a/public/img/personal-website/crud-index.png b/public/img/personal-website/crud-index.png new file mode 100644 index 0000000..3cfb6df Binary files /dev/null and b/public/img/personal-website/crud-index.png differ diff --git a/public/img/personal-website/crud-show.png b/public/img/personal-website/crud-show.png new file mode 100644 index 0000000..3854076 Binary files /dev/null and b/public/img/personal-website/crud-show.png differ diff --git a/public/img/personal-website/login.png b/public/img/personal-website/login.png new file mode 100644 index 0000000..f9385df Binary files /dev/null and b/public/img/personal-website/login.png differ diff --git a/public/img/personal-website/reset-password.png b/public/img/personal-website/reset-password.png new file mode 100644 index 0000000..5e8736c Binary files /dev/null and b/public/img/personal-website/reset-password.png differ