Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josepedro-22/backend-test
The project consists of implementing an API in Laravel to pair professionals (Pros) with projects based on specific criteria.
https://github.com/josepedro-22/backend-test
algoritmos composer ddd-architecture ddd-patterns end-to-end-testing laralve php php8 test-automation unit-testing
Last synced: 7 days ago
JSON representation
The project consists of implementing an API in Laravel to pair professionals (Pros) with projects based on specific criteria.
- Host: GitHub
- URL: https://github.com/josepedro-22/backend-test
- Owner: JosePedro-22
- Created: 2024-02-22T12:26:58.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-26T18:24:23.000Z (11 months ago)
- Last Synced: 2024-11-24T02:24:32.102Z (2 months ago)
- Topics: algoritmos, composer, ddd-architecture, ddd-patterns, end-to-end-testing, laralve, php, php8, test-automation, unit-testing
- Language: PHP
- Homepage: https://www.linkedin.com/in/josepedro-sm/
- Size: 101 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Backend Test - Cloud Humans
Based on their skills, professionals (Pros) are assigned projects. The system assesses which project is most appropriate for Pro using an intricate algorithm based on data provided via the Pro Portal. The infrastructure for the project is comprised of an API that receives data from the front-end application, applies the allocation mechanism, and gives the Pro access to the chosen project.
![Badge em Desenvolvimento](http://img.shields.io/static/v1?label=STATUS&message=EM%20DESENVOLVIMENTO&color=GREEN&style=for-the-badge)
![Laravel](https://img.shields.io/badge/laravel-%23FF2D20.svg?style=for-the-badge&logo=laravel&logoColor=white)
![PHP](https://img.shields.io/badge/php-%23777BB4.svg?style=for-the-badge&logo=php&logoColor=white)## 🚀 starting
These instructions will allow you to get a copy of the project running on your local machine for development and testing purposes.
### 📋 Prerequisites
What things do you need to install the software and how do you install it?
|Technologies |PHP |Composer |
|----------------|-------------------------------|-----------------------------|
|Version |`^8.1` |`2.6.6` |### 🔧 Installation
1. Clone the repository:
```
git clone https://github.com/JosePedro-22/Backend-Test.git
```
2. Navigate to the project directory:
```
cd Backend-Test
```
3. Install dependencies:
```
composer install
```
4. starting project:
```
php artisan serve
```### Use postman to test the api
### Access the route
```http://127.0.0.1:8000/api/pro/select-project```### Put it in the header
Key:
```Accept```
Value:
```application/json```### Put it on the body:
```
{
"age": 35,
"education_level": "high_school",
"past_experiences": {
"sales": false,
"support": true
},
"internet_test": {
"download_speed": 50.4,
"upload_speed": 40.2
},
"writing_score": 0.6,
"referral_code": "token1234"
}
```### your output:
```
"score": 4,
"selected_project": "support_users_from_xyz",
"eligible_projects": [
"support_users_from_xyz",
"collect_information_for_xpto"
],
"ineligible_projects": [
"calculate_dark_matter_nasa",
"determine_schrodinger_cat_is_alive"
]
```## ⚙️ Running the tests
To run test
```
php artisan test
```### 🔩 Unitary tests (Unit Tests):
To run the test, run the command
```
php artisan test tests/Unit/app/Services/ScoreServiceTest.php
```### 🔩 End-to-End Tests (Feature Tests):
To run the test, run the command
```
php artisan test tests/Feature/app/Http/Controllers/ProControllerTest.php
```## 🎲 The main technical decisions I made:
* Language and Framework: Laravel is a popular choice for developing PHP web applications due to its elegant syntax and comprehensive feature set. Furthermore, the PHP language is widely used and has a large community of developers and resources available.
* Architecture: We chose to apply the principle of Domain-Driven Design (DDD) to organize the code into distinct layers. This helps maintain a clear separation of responsibilities and facilitates application maintenance and scalability.
* Tests: Unit tests and end-to-end tests were implemented to ensure code quality and correct application functionality. Testing helps identify and fix problems earlier in the development cycle.
* Data Validation: Data validation has been implemented to ensure that the data received by the API is correct and complete. This helps prevent errors and security issues.
* API Output: Using the Eloquent's resource class allows you to expressively and easily transform your models and model collections into JSON.## 💬 comments about the project:
#### Diagrams of the path from request to response
```mermaid
graph LR
A[HTTP Request] --> B[Routing Middleware]
B --> C[Controller]
C --> D[Service]
D --> C
C --> E[Resource]
E --> F[HTTP Response]```
## 🎲 Other
|Name Branch |Description |
|----------------|-------------------------------------------------------------|
|main |base project, implementation of the algorithm to select which projects the pro is eligible or ineligible and his score, use of ddd plus integration of end-to-end and unitary tests|## 🛠️ Building with
* [Laravel](https://laravel.com/) - The web framework used
* [Composer](https://getcomposer.org/) - Dependency Manager## ✒️ Authors
* **José Pedro** - *Development / Documentation* - [Developer](https://www.linkedin.com/in/josepedro-sm/)