Data Model - AlexScotte/CVKotlin GitHub Wiki
Data stocked in azure are in JSON format. Data can be retrieved through a web API developed in this project.
At startup, the application checks if there is already a local database corresponding to the application,
- If it does not exist, the application will recover the remote data thanks to the Firebase library. After recovering this data, it will create a local database using Realm to be able to use the application offline.
- If a local database already exists, the application will compare the versions, if the remote version is newer than the local version, then the local database is deleted then recreated with the updated data.
The application can be used offline if it contains local data. At startup the application tests if the device is connected to the internet:
- If it is connected, the application will execute the instructions above.
- If it is not connected and there is no local data, a message tells the user to restart the application after having connected to the internet
- If it is not connected but there is local data, a message warns the user that the data present may not be up to date.
Example of JSON file
{
"companies" : [ {
"clients" : [ {
"experience" : {
"details" : {
"context" : "Context 1\\nContext 1\\nContext 1\\n",
"missions" : "- Mission 1\\n- Mission 2\\n- Mission 3\\n- Mission 4\\n"
},
"duration" : "1 an 5 mois",
"id" : 0,
"job" : "Job 1",
"skills" : [ {
"id" : 0,
"important" : 1,
"name" : "Skills 1"
}, {
"id" : 1,
"important" : 1,
"name" : "Skills 2"
}, {
"id" : 2,
"important" : 1,
"name" : "Skills 3"
}, {
"id" : 3,
"important" : 0,
"name" : "Skills 4"
} ]
},
"id" : 0,
"imageUrl" : "",
"location" : "Location 1",
"name" : "Clients 1",
"site" : "https://www.google.fr"
}, {
"experience" : {
"details" : {
"context" : "Context 2\\nContext 2\\nContext 2\\n",
"missions" : "- Mission 1\\n- Mission 2\\n- Mission 3\\n- Mission 4\\n"
},
"duration" : "1 an 5 mois",
"id" : 0,
"job" : "Job 2",
"skills" : [ {
"id" : 0,
"important" : 1,
"name" : "Skills 5"
}, {
"id" : 1,
"important" : 1,
"name" : "Skills 6"
}, {
"id" : 2,
"important" : 1,
"name" : "Skills 7"
}, {
"id" : 3,
"important" : 0,
"name" : "Skills 8"
} ]
},
"id" : 1,
"imageUrl" : "",
"location" : "Location 2",
"name" : "Clients 2",
"site" : "https://www.google.fr"
}, {
"experience" : {
"details" : {
"context" : "Context 3\\nContext 3\\nContext 3\\n",
"missions" : "- Mission 1\\n- Mission 2\\n- Mission 3\\n- Mission 4\\n"
},
"duration" : "1 an 5 mois",
"id" : 0,
"job" : "Job 3",
"skills" : [ {
"id" : 0,
"important" : 1,
"name" : "Skills 1"
}, {
"id" : 1,
"important" : 1,
"name" : "Skills 5"
}, {
"id" : 2,
"important" : 1,
"name" : "Skills 6"
}, {
"id" : 3,
"important" : 0,
"name" : "Skills 10"
} ]
},
"id" : 2,
"imageUrl" : "",
"location" : "Location 3",
"name" : "Clients 3",
"site" : "https://www.google.fr"
} ],
"dateEnd" : "End date 1",
"dateStart" : "Start date 1",
"department" : "69",
"id" : 0,
"job" : "Job 1",
"name" : "Nom 1",
"town" : "Town 1"
}, {
"clients" : [ {
"experience" : {
"details" : {
"context" : "Context 1\\nContext 1\\nContext 1\\n",
"missions" : "- Mission 1\\n- Mission 2\\n- Mission 3\\n- Mission 4\\n"
},
"duration" : "10 mois",
"id" : 0,
"job" : "Job 1",
"skills" : [ {
"id" : 0,
"important" : 1,
"name" : "Skills 1"
}, {
"id" : 1,
"important" : 1,
"name" : "Skills 2"
}, {
"id" : 2,
"important" : 1,
"name" : "Skills 3"
}, {
"id" : 3,
"important" : 0,
"name" : "Skills 4"
} ]
},
"id" : 1,
"imageUrl" : "",
"location" : "Location 1",
"name" : "Clients 1",
"site" : "https://www.google.fr"
}, {
"experience" : {
"details" : {
"context" : "",
"missions" : ""
},
"duration" : "",
"id" : 1,
"job" : "",
"skills" : [ {
"id" : 0,
"important" : 1,
"name" : "Skill perso 1"
}, {
"id" : 1,
"important" : 1,
"name" : "Skill perso 2"
}, {
"id" : 2,
"important" : 1,
"name" : "Skill perso 3"
} ]
},
"id" : 1,
"imageUrl" : "",
"location" : "",
"name" : "Perso",
"site" : ""
} ],
"dateEnd" : "End date 2",
"dateStart" : "Start date 2",
"department" : "69",
"id" : 1,
"job" : "Job 2",
"name" : "Name 2",
"town" : "Town 2"
} ],
"contact" : {
"cvUrl" : "https://www.google.fr",
"email" : "[email protected]",
"externalLinks" : [ {
"id" : 0,
"imageUrl" : "https://upload.wikimedia.org/wikipedia/commons/thumb/c/ca/LinkedIn_logo_initials.png/480px-LinkedIn_logo_initials.png",
"name" : "LinkedIn",
"url" : "https://www.linkedin.com/in/John-doe"
}, {
"id" : 1,
"imageUrl" : "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"name" : "GitHub",
"url" : "https://github.com/AlexScotte"
} ],
"phone" : "0XXXXXXXXX"
},
"formations" : [ {
"date" : "208",
"description" : "Description 0",
"establishment" : "Establishment 0",
"id" : 0,
"name" : "Nom 0",
"town" : "Town 0",
"url" : "https://www.google.fr"
}, {
"date" : "2009",
"description" : "Description 1",
"establishment" : "Establishment 1",
"id" : 1,
"name" : "Nom 1",
"town" : "Town 1",
"url" : ""
}, {
"date" : "2011",
"description" : "Description 2",
"establishment" : "Establishment 2",
"id" : 2,
"name" : "Nom 2",
"town" : "Town 2",
"url" : ""
}, {
"date" : "2014",
"description" : "Description 3",
"establishment" : "Establishment 3",
"id" : 3,
"name" : "Nom 3",
"town" : "Town 3",
"url" : ""
} ],
"informations" : {
"version" : 1.8
},
"profile" : {
"age" : 18,
"backgroundImageUrl" : "",
"birthDate" : "01/01/1991",
"description" : "Profile description\\n\\n\\n",
"firstName" : "John",
"hobbies" : [ {
"id" : 0,
"name" : "Hobby 1"
}, {
"id" : 1,
"name" : "Hobby 2"
}, {
"id" : 2,
"name" : "Hobby 3"
} ],
"imageUrl" : "",
"job" : "Job",
"lastName" : "Doe",
"location" : "Location"
}
}