An Expert System that suggests the most suitable programming language based on your interests and preferences.
The system is built with Laravel, Livewire, FastAPI, and Experta.
Another screenshot here.
You can avoid this configurational step by using the Docker installation process.
Before setting up the project, make sure you have the required dependencies:
- Python >= 3.9
- PHP >= 8.0
- pip
- composer
- npm
The following example works for Debian Based Linux Distributions.
Update the system
sudo apt update && sudo apt upgrade -yInstall Python
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.9Install pip
sudo apt install python3-pipInstall PHP
sudo apt get install -y php8.1-cli php8.1-common php8.1-mysql php8.1-zip php8.1-gd php8.1-mbstring php8.1-curl php8.1-xml php8.1-bcmathInstall composer
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composerInstall npm
sudo apt install nodejs npmMake sure you are in the web-app directory
cd src/web-appInstall composer dependencies
composer installInstall npm dependencies and build the assets
npm install
npm run buildCreate the .env file and generate the application encryption key
cp .env.example .env
php artisan key:generateUpdate the package.json file by swapping the scripts section with the one below
"scripts": {
"dev": "vite",
"build": "vite build"
},Update the expert.php config file
'endpoint' => 'http://localhost:5500/detect',Install all the requirements
pip install --no-cache-dir --upgrade -r dockerfiles/expert-system/requirements.txtStart the expert system
python main.pyStart the built-in web server
php artisan serveYou can now access the server at http://localhost:8000.
Make sure Docker is installed.
If you are using a Windows 10/11, you need to know that Windows uses WSL (Windows Subsystem for Linux), which is a layer between Windows and Linux, this makes Docker slow and browser requests may take 30-60 seconds to be completed.
Spin up the containers
docker-compose up -d --build appRunning the command will expose 3 services with the following ports:
- Nginx -
:80 - PHP -
:9000 - FastAPI -
:5500
Install composer dependencies
docker-compose run --rm composer installInstall npm dependencies and build the assets
docker-compose run --rm npm install
docker-compose run --rm --service-ports npm run buildCreate the .env file and generate the application encryption key
cp .env.example .env
docker-compose run --rm php artisan key:generateYou can now access the server at http://localhost.
You can add questions to help get better results by editing the src/web-app/questions.json file.
A question is a json object that has two fields:
"question": The question displayed to the user."fact": The information sent to the system to reason about the problem in case the user answers with "yes".
"18": {
"question": "You want to code to build websites?",
"fact": "web"
}You can add new languages to be displayed to the user as a result by editing the src/web-app/languages.json file.
Make sure you have a rule that leads to the newly defined language using the facts you have, otherwise it will never be displayed, to do so, edit the
src/expert-system/expert.pyand follow the docs here.
A language is a json object that has three fields:
"logo": The filename of the language's logo placed insrc/web-app/resources/images."description": A brief description about the language."infos": A link for more insightful information about the language.
"c/c++": {
"logo": "c-logo.png",
"description": "C++ is a powerful general-purpose programming language. It can be used to develop operating systems, browsers, games, and so on.",
"infos": "https://www.programiz.com/cpp-programming"
}