The Job Board API is a RESTful API developed with Symfony for managing companies, job postings, applicants, and job applications. Users can sign up and log in to use the various routes, including creating, reading, updating, and deleting, as well as searching and filtering job postings. The API offers user authentication, input data validation, and quality tools such as PHPStan and PHPCodeSniffer.
- PHP 8.1
- Composer
- XAMPP
- Symfony CLI (optional)
-
Clone the repository:
git clone https://github.com/Giorgio163/job-board-api.git # or git clone https://gitlab.com/TiPhOoN/job-board-api.git
-
Access the directory:
cd job-board-api
-
Install the Composer dependencies:
composer install
-
Go to MySQL and create the database
job-board-api
. -
Create a file
.env.local
and add your database connection. Example:DATABASE_URL="mysql://root:@localhost:3306/job-board-api"
-
Create the tables:
php bin/console doctrine:migrations:migrate
-
Run the application:
symfony server:start # or php -S localhost:8000 -t public
-
Go to http://localhost:8000
To generate the jwt keys, run the following command: docker-compose run -it php-fpm php bin/console lexik:jwt:generate-keypair
.
To access the API documentation, go to http://localhost:8000/api/doc.
You can run PHP codesniffer to check the code quality and PHPStan for static analysis.
Install PHP codesniffer:
composer require squizlabs/php_codesniffer
Run PHP codesniffer:
./vendor/bin/phpcs --standard=PSR12 src/
Install PHPStan:
composer require --dev phpstan/phpstan
Run PHPStan:
vendor/bin/phpstan analyse src
To know more about the development of Symfony applications, check the official documentation.