Skip to content

Spring Boot based RESTful API, containing a JPA mapping of the structure listed in the src/data/data.json file

Notifications You must be signed in to change notification settings

alessandrov/campaign-dashboard-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot based RESTful API, containing a JPA mapping of the structure listed in the src/data/data.json file

Prerequisites

Make sure you have Maven (I am using v3.3.9) and Java 1.8 SDK installed on your machine. Make sure your local instance of MySQL is running. The application will create a new database at every startup as well as tables mapped by the JPA entities. You can change your MySQL credentials in the resources/application.properties file.

How to build the application

Navigate to the project folder and run:

mvn clean package

How to run the application

Navigate to the project folder and run:

java -jar .\target\campaign-dashboard-backend-1.0.0.jar

Unit tests

An instance of H2 is in place.

Entities to be mapped

[
  {
    "id":100000001,
    "name": "Test Ad 1",
    "goal": "Increase Reach",
    "total_budget": 120,
    "status":"Delivering",
    "platforms":{
      "facebook": {
        "status":"Delivering",
        "total_budget":40,
        "remaining_budget":12,
        "start_date":1530568800000,
        "end_date":1532901600000,
        "target_audience":{
          "languages":["FR","EN","DE"],
          "genders":["M", "F"],
          "age_range":[20, 66],
          "locations":[
            "France",
            "Germany",
            "Switzerland"
          ],
          "interests":[
            "Docker",
            "Kubernates",
            "DevOps",
            "AWS",
            "Google Cloud Platform",
            "Ubuntu"
          ]
        },
        "creatives":{
          "header":"DevOps Made Easy, We Take care of the heavy lifting for you",
          "description":"DOP SuperHero is where all DevOps is going to happen in the future, join the revolution today!",
          "url":"https://example.io",
          "image":"img1.jpg"
        },
        "insights":{
          "impressions": 4503,
          "clicks": 328,
          "nanos_score": 5.7,
          "cost_per_click": 0.88,
          "click_through_rate": 0.09,
          "advanced_kpi_1": 44.5,
          "advanced_kpi_2": 0.0023
        }
      },
      "instagram": {
        "status":"Delivering",
        "total_budget":44,
        "remaining_budget":14,
        "start_date":1530568800000,
        "end_date":1532901600000,
        "target_audience":{
          "languages":["FR","EN","DE"],
          "genders":["M", "F"],
          "age_range":[20, 66],
          "locations":[
            "France",
            "Germany",
            "Switzerland"
          ],
          "interests":[
            "Docker",
            "Kubernates",
            "DevOps",
            "AWS",
            "Google Cloud Platform",
            "Ubuntu"
          ]
        },
        "creatives":{
          "header":"DevOps Made Easy, We Take care of the heavy lifting for you",
          "description":"DOP SuperHero is where all DevOps is going to happen in the future, join the revolution today!",
          "url":"https://example.io",
          "image":"img1.jpg"
        },
        "insights":{
          "impressions": 436,
          "clicks": 220,
          "website_visits": 178,
          "nanos_score": 5.2,
          "cost_per_click": 1.28,
          "click_through_rate": 0.43,
          "advanced_kpi_1": 39,
          "advanced_kpi_2": 0.00143
        }
      },
      "google": {
        "status":"Delivering",
        "total_budget":36,
        "remaining_budget":24,
        "start_date":1530568800000,
        "end_date":1532901600000,
        "target_audience":{
          "languages":["FR","EN","DE"],
          "genders":["M", "F"],
          "age_range":[20, 66],
          "locations":[
            "France",
            "Germany",
            "Switzerland",
            "Italy",
            "Spain",
            "Belgium",
            "United Kingdom",
            "Poland"
          ],
          "KeyWords":[
            "Easy DevOps",
            "DevOps As A Service",
            "DevOps",
            "AWS",
            "Google Cloud Platform",
            "DevOps Automation",
            "One Click DevOps",
            "NoOps"
          ]
        },
        "creatives":{
          "header_1":"DevOps Made Easy",
          "header_2":"We Take care of the heavy lifting for you",
          "description":"DOP SuperHero is where all DevOps is going to happen in the future, join the revolution today!",
          "url":"https://example.io",
          "image":"img2.jpg"
        },
        "insights":{
          "impressions": 20436,
          "clicks": 420,
          "website_visits": 378,
          "cost_per_click": 0.99,
          "click_through_rate": 0.013,
          "advanced_kpi_1": 3.9
        }
      }
    }
  },
  {
    "id":100000002,
    "name": "Test Ad 2",
    "goal": "Raise Awareness",
    "total_budget": 360,
    "status":"Ended",
    "platforms":{
      "facebook": {
        "status":"Ended",
        "total_budget":180,
        "remaining_budget":12,
        "start_date":1513724400000,
        "end_date":1514674800000,
        "target_audience":{
          "languages":["EN"],
          "genders":["M", "F"],
          "age_range":[20, 45],
          "locations":[
            "Switzerland"
          ],
          "interests":[
            "Docker",
            "Kubernates",
            "DevOps",
            "AWS",
            "Google Cloud Platform",
            "Ubuntu"
          ]
        },
        "creatives":{
          "header":"Tired of doing DevOps?",
          "description":"Let us our smart AI DevOps Assistant help you!",
          "url":"https://example.io",
          "image":"img4.jpg"
        },
        "insights":{
          "impressions": 8293,
          "clicks": 453,
          "nanos_score": 2.9,
          "cost_per_click": 2.88,
          "click_through_rate": 0.003,
          "advanced_kpi_1": 39.7,
          "advanced_kpi_2": 0.035
        }
      },
      "instagram": {
        "status":"Ended",
        "total_budget":180,
        "remaining_budget":0,
        "start_date":1513724400000,
        "end_date":1514674800000,
        "target_audience":{
          "languages":["EN"],
          "genders":["M", "F"],
          "age_range":[20, 45],
          "locations":[
            "Switzerland"
          ],
          "interests":[
            "Docker",
            "Kubernates",
            "DevOps",
            "AWS",
            "Google Cloud Platform",
            "Ubuntu"
          ]
        },
        "creatives":{
          "header":"Tired of doing DevOps ?",
          "description":"Let us our smart AI DevOps Assistant help you #AWS #GCP #DevOps #Docker #Kubernates",
          "url":"https://example.io",
          "image":"img3.jpg"
        },
        "insights":{
          "impressions": 9023,
          "clicks": 1321,
          "website_visits": 943,
          "nanos_score": 8.2,
          "cost_per_click": 4.28,
          "click_through_rate": 0.043,
          "advanced_kpi_1": 93,
          "advanced_kpi_2": 0.08332
        }
      }
    }
  },
  {
    "id":100000003,
    "name": "Test Ad 3",
    "goal": "Raise Awareness",
    "total_budget": 90,
    "status":"Scheduled",
    "platforms":{
      "facebook": {
        "status":"Scheduled",
        "total_budget":40,
        "remaining_budget":40,
        "start_date":1532901600000,
        "end_date":1535580000000,
        "target_audience":{
          "languages":["EN"],
          "genders":["M", "F"],
          "age_range":[20, 65],
          "locations":[
            "Switzerland"
          ],
          "interests":[
            "Software Development",
            "React Native",
            "Angular",
            "React",
            "VueJS",
            "Frontend Development"
          ]
        },
        "creatives":{
          "header":"Need Help?",
          "description":"Let us take care of your frontend needs today!",
          "url":"https://example.io",
          "image":"img4.jpg"
        },
        "insights":{
          "impressions": 0,
          "clicks": 0,
          "nanos_score": 5.9,
          "cost_per_click": 0,
          "click_through_rate": 0,
          "advanced_kpi_1": 0,
          "advanced_kpi_2": 0
        }
      },
      "instagram": {
        "status":"Scheduled",
        "total_budget":50,
        "remaining_budget":40,
        "start_date":1532901600000,
        "end_date":1535580000000,
        "target_audience":{
          "languages":["EN"],
          "genders":["M", "F"],
          "age_range":[20, 45],
          "locations":[
            "Switzerland"
          ],
          "interests":[
            "Software Development",
            "React Native",
            "Angular",
            "React",
            "VueJS",
            "Frontend Development",
            "NodeJS",
            "Facebook Developer",
            "Wordpress"
          ]
        },
        "creatives":{
          "header":"Need Help?",
          "description":"Let us take care of your frontend needs today! #Angular #React #React_native #VueJS #VueIsAwesome, #ReactForever #ILoveAngular #Frontend #Javascript",
          "url":"https://example.io",
          "image":"img4.jpg"
        },
        "insights":{
          "impressions": 0,
          "clicks": 0,
          "website_visits": 0,
          "nanos_score": 8.2,
          "cost_per_click": 0,
          "click_through_rate": 0,
          "advanced_kpi_1": 0,
          "advanced_kpi_2": 0
        }
      }
    }
  }
]

About

Spring Boot based RESTful API, containing a JPA mapping of the structure listed in the src/data/data.json file

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages