A demo project for Advertisement API with symfony 4.2, Doctrine, React and sample data in Sqlite database
PHP > 7.2
NPM
composer
Docker
Clone the Repository
cd to project directory
Run command "composer install"
Run command "php bin/console server:run"
Check http://localhost:8000/
Clone the Repository
cd to project directory
Run command "composer install"
Run command "docker-compose up"
Check http://localhost:8000/
SELECT c.name, count(a.campaign_id) AS numberOfAds
FROM campaign c
LEFT JOIN ads a ON (c.id = a.campaign_id)
WHERE c.advertiser_id = 100
GROUP BY c.id
HAVING numberOfAds > 50
http://localhost:8000/campaign/100/50
run the app to see the test url
SELECT c.id as campaignID, c.name AS campaignName , count(a.campaign_id) AS numberOfAds
FROM campaign c
LEFT JOIN ads a
ON (c.id = a.campaign_id)
GROUP BY c.id
HAVING numberOfAds = 0
http://localhost:8000/campaign/withoutad run the app to see the test url
Protocol: HTTP
Method: GET
URi: ad/adID
Content-Type:application/json
RequestBody:
{ }
http://localhost:8000/ad/2
run the app to see the test url
Protocol: HTTP
Method: GET
URi: campaign/campaignID
Content-Type:application/json
RequestBody:
{ }
http://localhost:8000/campaign/100
run the app to see the test url
Protocol: HTTP
Method: GET
URi: advertiser/listads/advertiserID
Content-Type:application/json
RequestBody:
{ }
http://localhost:8000/advertiser/listads/80
run the app to see the test url
Protocol: HTTP
Method: POST
URi: ad/new
Content-Type:application/json
RequestBody:
{
"action": "NewAd"
"ad": {
"title": "Sample title",
"text": "Sample text"
"image": "Sample image"
"sponsoredBy": "Sample Sponsor"
"trackingUrl": "sample URL"
}
}
No server implementation of this functionality
Protocol: HTTP Method: PUT URi: ad/update/adID Content-Type:application/json RequestBody:
{
"action": "UpdateAd",
"id": "AdID",
"ad": {
"title": "Updated title",
"text": "Updated text"
"image": "Updated image"
"sponsoredBy": "Updated Sponsor"
"trackingUrl": "Updated URL"
}
}
No server implementation of this functionality
Run the symfony app to see this functionality on home Url http://localhost:8000/