there are many ways to start a new project using composer.
one simple way to begin with Slim using Composer is typing in a new folder:
composer require slim/slim
now create a folder named public
and after, create a file index.php inside public folder with the following content:
<?php
require 'vendor/autoload.php';
$app = new \Slim\App;
$app->get('/', function () {
echo "Hello, World!";
});
$app->run();
and after, run the command line at the root folder: php -S localhost:8080 -t public public/index.php
all calls to localhost:8080 will pass through index.php