Readme modified

This commit is contained in:
2026-03-19 12:12:26 -04:00
parent ac3fe06750
commit be6520c1bb
10 changed files with 1045 additions and 39 deletions
+181 -39
View File
@@ -1,60 +1,202 @@
# CodeIgniter 4 Framework
# tokslaw.com — Personal Portfolio & Professional Website
## What is CodeIgniter?
A containerized portfolio website for **Toks Lawal**, a Product Architect and Senior Software Engineer specializing in microservices architecture, event-driven systems, and full-stack development. Built with CodeIgniter 4 and deployed via Docker.
CodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure.
More information can be found at the [official site](https://codeigniter.com).
---
This repository holds the distributable version of the framework.
It has been built from the
[development repository](https://github.com/codeigniter4/CodeIgniter4).
## About
More information about the plans for version 4 can be found in [CodeIgniter 4](https://forum.codeigniter.com/forumdisplay.php?fid=28) on the forums.
This site serves as the central hub for Toks Lawal's professional presence, featuring:
You can read the [user guide](https://codeigniter.com/user_guide/)
corresponding to the latest version of the framework.
- **Portfolio** — Curated showcase of projects and engineering work
- **About / Experience** — Career history across MyFit.ai, Intralot, Float Mobility, and ChiefSoft Works
- **Services** — Software architecture, microservices design, and full-stack development offerings
- **Blog** — Dynamically pulled from an external blog data API (`blogdata.chiefsoft.net`)
## Important Change with index.php
Live at: **[tokslaw.com](https://tokslaw.com)**
`index.php` is no longer in the root of the project! It has been moved inside the *public* folder,
for better security and separation of components.
---
This means that you should configure your web server to "point" to your project's *public* folder, and
not to the project root. A better practice would be to configure a virtual host to point there. A poor practice would be to point your web server to the project root and expect to enter *public/...*, as the rest of your logic and the
framework are exposed.
## Tech Stack
**Please** read the user guide for a better explanation of how CI4 works!
| Layer | Technology |
|---|---|
| Framework | CodeIgniter 4 (PHP 8.1+) |
| Web Server | Apache 2.4 with `mod_rewrite` |
| Containerization | Docker + Docker Compose |
| Frontend | HTML5, CSS3, JavaScript (Hub Template by LiquidThemes) |
| Fonts | Google Fonts — Be Vietnam Pro, Libre Baskerville, Space Grotesk |
| External API | `https://blogdata.chiefsoft.net/blogdata/tokslaw` |
| Image Registry | `registry.chiefsoft.net` (private) |
| Extensions | MongoDB, Redis, xDebug (dev), GD, mysqli, pgsql |
## Repository Management
---
We use GitHub issues, in our main repository, to track **BUGS** and to track approved **DEVELOPMENT** work packages.
We use our [forum](http://forum.codeigniter.com) to provide SUPPORT and to discuss
FEATURE REQUESTS.
## Project Structure
This repository is a "distribution" one, built by our release preparation script.
Problems with it can be raised on our forum, or as issues in the main repository.
```
TokslawMain/
├── app/
│ ├── Controllers/
│ │ ├── BaseController.php # Shared APIcall() cURL helper
│ │ ├── Home.php # Homepage — fetches live blog data
│ │ ├── About.php # Experience timeline (hardcoded)
│ │ ├── Portfolio.php # Portfolio page
│ │ ├── Services.php # Services offered
│ │ └── Project.php # Project detail view
│ ├── Views/
│ │ ├── welcome_message.php # Homepage template
│ │ ├── about.php # About/Experience template
│ │ ├── portfolio.php # Portfolio template
│ │ ├── services.php # Services template
│ │ ├── project.php # Project detail template
│ │ └── styles.css # Custom overrides
│ └── Config/
│ ├── Routes.php # URL routing
│ └── App.php # App-level configuration
├── public/ # Web root — point your server here
│ ├── index.php # Application entry point
│ ├── .htaccess # URL rewriting rules
│ └── assets/ # CSS, JS, images, fonts, vendors
├── docker/
│ └── apache/
│ ├── Dockerfile # PHP 8.1-Apache image definition
│ └── 000-default.conf # Apache VirtualHost config
├── docker-compose.yml # Container orchestration
├── writable/ # Cache, logs, sessions (auto-generated)
├── apache_log/ # Apache access and error logs (mounted)
├── composer.json # PHP dependency manifest
├── env # Environment variable template
└── spark # CodeIgniter CLI
```
## Contributing
---
We welcome contributions from the community.
## Routes
Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/CodeIgniter4/blob/develop/CONTRIBUTING.md) section in the development repository.
| Method | URL | Controller | Description |
|---|---|---|---|
| GET | `/` | `Home::index()` | Homepage with live blog feed |
| GET | `/portfolio` | `Portfolio::index()` | Portfolio showcase |
| GET | `/about` | `About::index()` | Experience & background |
| GET | `/services` | `Services::index()` | Services offered |
| GET | `/project` | `Project::index()` | Project detail page |
## Server Requirements
---
PHP version 8.1 or higher is required, with the following extensions installed:
## Getting Started
- [intl](http://php.net/manual/en/intl.requirements.php)
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
### Prerequisites
> [!WARNING]
> - The end of life date for PHP 7.4 was November 28, 2022.
> - The end of life date for PHP 8.0 was November 26, 2023.
> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
> - The end of life date for PHP 8.1 will be December 31, 2025.
- [Docker](https://docs.docker.com/get-docker/) and Docker Compose installed
- Git
Additionally, make sure that the following extensions are enabled in your PHP:
### Local Setup
- json (enabled by default - don't turn it off)
- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php) if you plan to use MySQL
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library
```bash
# 1. Clone the repository
git clone <repo-url> TokslawMain
cd TokslawMain
# 2. Copy environment template
cp env .env
# 3. Set your local container port and UID (edit .env)
# CONTAINER_PORT=7083
# UID=1000
# 4. Build and start the container
docker-compose up -d --build
# 5. Install PHP dependencies (inside the container)
docker-compose exec tokslaw-main composer install
```
The site will be available at: **http://localhost:7083**
---
## Environment Variables
Copy `env` to `.env` and configure as needed:
```env
CONTAINER_PORT=7083 # Port to expose the site locally
UID=1000 # Host user UID for file permission mapping
```
No database credentials are required — the site does not use a local database. Blog content is fetched at runtime from the external API.
---
## Docker Details
- **Base image**: `php:8.1-apache`
- **Published image**: `registry.chiefsoft.net/tokslawcom-web:latest`
- **Exposed port**: 80 (mapped to `CONTAINER_PORT` on host)
- **Document root**: `/var/www/html/public`
- **Restart policy**: `unless-stopped`
- **Volumes**:
- `./ → /var/www/html` (source code, live-mounted)
- `./apache_log → /var/log/apache2` (persistent logs)
**PHP Extensions installed in image:**
`bcmath`, `bz2`, `calendar`, `curl`, `exif`, `gd`, `gettext`, `iconv`, `intl`, `mysqli`, `pgsql`, `pdo_mysql`, `pdo_pgsql`, `soap`, `tidy`, `xsl`, `zip` + PECL: `xdebug`, `mongodb`, `redis`
---
## Deployment
Images are built and pushed to the private ChiefSoft registry:
```bash
# Build the image
docker build -t registry.chiefsoft.net/tokslawcom-web:latest -f docker/apache/Dockerfile .
# Push to registry
docker push registry.chiefsoft.net/tokslawcom-web:latest
# On the server — pull and restart
docker-compose pull && docker-compose up -d
```
> **Note:** `xdebug` is active in the Docker image by default. Disable it in production for performance.
---
## Development
```bash
# Run tests
composer test
# PHP CodeSniffer / CS-Fixer
./vendor/bin/php-cs-fixer fix app/
# CodeIgniter CLI (spark)
php spark <command>
# View application logs
tail -f writable/logs/log-$(date +%Y-%m-%d).log
# View Apache logs
tail -f apache_log/error.log
```
---
## PHP Requirements
- PHP **8.1 or higher**
- Required extensions: `intl`, `mbstring`, `curl`, `json`
- Optional: `mysqlnd` (MySQL), `libcurl` (HTTP requests)
---
## License
MIT License — see [LICENSE](LICENSE) for details.
---
*Built and maintained by Toks Lawal — [tokslaw.com](https://tokslaw.com)*