Giter VIP home page Giter VIP logo

recruitis-api-project's Introduction

Recruitis API Project

Welcome to the Recruitis API Project! This project is designed as a composer package to be integrated into Symfony projects, providing a robust API client for interacting with the Recruitis platform. Below, you'll find a comprehensive guide on how to set up, use, and extend this package.

Official API Documentation

Table of Contents

Installation

To install the Recruitis API package, use Composer:

composer require davidbrend/recruitis-api-project

This will add the package to your Symfony project and make it available for use.

Configuration

After installation, configure the package by setting the necessary environment variables. These typically include API credentials and endpoint URLs. Add the following to your .env file:

RECRUITIS_API_TOKEN=your_api_token

Definition in services.yaml file:

parameters:
    recruitis-api-token: '%env(RECRUITIS_API_TOKEN)%'

recruitis_api:
    api_token: '%recruitis-api-token%'

Last definition add into bundle.php file:

Davebrend\RecruitisApiProject\RecruitisApiProject::class => ['all' => true]

Usage

Here's a simple example of how to use the Recruitis API client in your Symfony project:

use Davebrend\RecruitisApiProject\Clients\Query;
use Davebrend\RecruitisApiProject\Facades\JobFacade;
use GuzzleHttp\Exception\GuzzleException;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;

class HomepageController extends AbstractController
{
    #[Route('/', 'homepage')]
    public function homepage(JobFacade $jobFacade): Response
    {
        $query = new Query(); // query parameters same as API 
        $jobs = $jobFacade->getJobsByQuery($query);
        return $this->render('default/homepage.html.twig');
    }
}

Directory Structure

The directory structure of the project is as follows:

  • src/
    • Base/: Contains base classes and utilities.
    • Client/: Contains the API client class.
    • Configs/: Configuration classes for setting up the client.
    • DI/: Dependency injection related classes.
    • Dtos/: Data transfer objects for handling API data.
    • Enums/: Enumerations used across the package.
    • Facades/: Facades to simplify interaction with the client.
    • Factories/: Factory classes for initialize .env data to package.
    • Services/: Service classes for handling business logic.
    • RecruitisApiProject.php: Main class for the project.

Testing

This project uses PHPUnit for testing. To run the tests, use the following command:

vendor/bin/phpunit

or

composer run run-tests

The configuration for PHPUnit is provided in phpunit.xml, specifying test directories and coverage settings.

recruitis-api-project's People

Contributors

davidbrend avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.