Startup to fork from for project in XML API Course
Find a file
2026-05-05 05:50:24 +00:00
project.php Added seed for main php file and style file 2026-05-04 12:25:12 +02:00
ReadMe.mb Add ReadMe.mb 2026-05-05 05:50:24 +00:00
style.css Added seed for main php file and style file 2026-05-04 12:25:12 +02:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### Welcome to the wiki.

Welocme and goodbye idk why you want to read this, this is more for me. yes i, so good bye

**Page Links**

- [Website layout](https://git.webug.se./a25zioma/Projekt_Electionservice_F/wiki/Website-layout)

- [How the data is handeld guide](https://git.webug.se./a25zioma/Projekt_Electionservice_F/wiki/How-the-data-is-handeld-guide)

- [How to spaw get data form Json and XML](https://git.webug.se./a25zioma/Projekt_Electionservice_F/wiki/How-to-spaw-%2F-get-data-form-Json-and-XML)

-------------------------------------


### The website layout is simple. 
There are three main pages, and each is self-contained, so they do not depend on one another. However, both will include a starting dropdown that allows the user to choose what they want to display. The content shown will depend on which country the user selects.

The main page allows users to choose what they want to see most, helping to avoid overwhelming them with too much information. It offers a simpler view of time and a more detailed version of races, letting users decide how they want the information presented.

**The site has two main pages:**

- Time
- Race

**Time** will allow the user to view the timeline of a country, including how it was developed. Users can select a country from a dropdown to see its historical timeline. This page will not contain too much data—just the countrys flag and a brief history of its development.

**Race** will contain significantly more data, as it will display information about presidencies, leadership, and timelines. This is a larger and more detailed part of the site, with the main goal of showing users key information about a countrys history in a more in-depth way.

image flow chart :
`https://media.discordapp.net/attachments/1474077224801144933/1500843100849836132/Untitled.jpg?ex=69f9e88f&is=69f8970f&hm=986e49cdb2b8ebe16db924b50a284bf6ab6e6d5d941766b73a1efcc20120ee52&=&format=webp`

### **Colors**
Since Group F requires a dark bluethemed site, I will use a color palette from a user on Figma, as it is simpler to work with.
Here is the color sheet for reference: `https://www.figma.com/colors/dark-blue/`

-------------------------

There are three main endpoints, all of which support filtering and different display modes. For XML and JSON, this is handled by adding a small parameter at the end of the URL. Below is a clear guide on how to access, modify, and view the data depending on what is needed.

### **Display options**

- Displaying without filtering
- Displaying with filtering
- Displaying specific data

### **Displaying all data without filtering**
```
wwwlab.webug.se/examples/XML/electionservice/races?sort=
wwwlab.webug.se/examples/XML/electionservice/states/?mode=
wwwlab.webug.se/examples/XML/electionservice/timeseries/?mode=
```

These endpoints are used when you want to retrieve all available data without applying any filters. This helps you understand the full structure and organization of the data. It is especially useful when building dropdowns, as it allows you to filter the data later so users only see what they need, without unnecessary information.

### Understanding how to filter the data is important.

**States display**
```
wwwlab.webug.se/examples/XML/electionservice/states?mode=(json/xml)
wwwlab.webug.se/examples/XML/electionservice/states?timezonesearch=CDT
wwwlab.webug.se/examples/XML/electionservice/states?name=Montana
```

**Races display**
```
wwwlab.webug.se/examples/XML/electionservice/races?mode=(json/xml)
wwwlab.webug.se/examples/XML/electionservice/races?rating=likely-rep
wwwlab.webug.se/examples/XML/electionservice/races?lastname=Pierce
```
**Timeseries (timezone) display**
```
wwwlab.webug.se/examples/XML/electionservice/timeseries?mode=(json/xml)
wwwlab.webug.se/examples/XML/electionservice/timeseries?stateid=AK
```

This section demonstrates examples of how the API is structured. Some endpoints support additional filters or parameters, and the data returned may vary depending on what is requested. Some queries return more detailed data, while others return less—it all depends on how the request is configured.

_Further examples can be found here:_
`https://wwwlab.webug.se/examples/XML/electionservice/`

### **States display**

This endpoint displays states along with their code, icons, images, and associated time zones. It mainly serves as a reference for looking up countries/states and their related data. Some data may need to be cleaned or filtered depending on use.

### **Races display**

This endpoint appears to show presidential races, candidates, and possibly current or past presidents (this should be verified). Its main purpose is to present election data and historical information related to races.

### **Timeseries (timezone) display**

This endpoint shows time zone data for each state, including historical timelines and related information. It provides additional context about time-related data for each location.

-------------------------------

There are two ways of retrieving data from the APIs: through JSON or XML. Below is an example of how to choose which format you need:

```
/bookservice/books?mode=json
/bookservice/books?mode=xml
```
Here is a more practical example, similar to the other page, showing how to retrieve data:

```
wwwlab.webug.se/examples/XML/electionservice/races?mode=json
wwwlab.webug.se/examples/XML/electionservice/races?mode=xml
```

For further explanation, visit: [How the data is handeld guide](https://git.webug.se./a25zioma/Projekt_Electionservice_F/wiki/How-the-data-is-handeld-guide)