Skip to content
This repository was archived by the owner on Dec 4, 2024. It is now read-only.

Commit 67f3060

Browse files
committed
📦 update packages; cleanup README file
1 parent 92f9a08 commit 67f3060

File tree

3 files changed

+4625
-5050
lines changed

3 files changed

+4625
-5050
lines changed

README.md

Lines changed: 2 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -2,165 +2,18 @@
22

33
[![Known Vulnerabilities](https://snyk.io/test/github/Fcmam5/algeria-api/badge.svg)](https://snyk.io/test/github/Fcmam5/algeria-api) [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.amrom.workers.dev%2FFcmam5%2Falgeria-api%2Fmaster)](https://stryker-mutator.github.io)
44

5-
A list of Algerian Wilayas, Dairas and Baladyahs.
5+
This is another Algerian administrative areas repository :smiley:. In this project we provide a structured JSON and XML data that can be found in [results/WilayaList.json](./results/WilayaList.json) and [[results/WilayaList.XML](./results/WilayaList.XML) or through our API: [https://algeria-api.herokuapp.com/api/v1/]()
66

77
## Features
88

99
* Exposes a RESTful API
10-
* GraphQL Endpoint
1110
* JSON Files
1211
* Postal codes by wilaya [results/postal-codes-results.json](./results/postal-codes-results.json)
1312
* Wilayas list (with Dairas and Baladiyahs lists) [results/WilayaList.json](./results/WilayaList.json)
1413

1514
## API Documentation
1615

17-
* Get a list of all Wilayas `GET https://localhost:3000/api/v1/wilaya`
18-
* Get Wilaya's details: `GET https://localhost:3000/api/v1/wilaya/matricule/:matricule`, example:
19-
20-
```bash
21-
~: curl -X GET -i http://localhost:3000/api/v1/wilaya/matricule/31
22-
23-
# Response
24-
{
25-
"data": {
26-
"mattricule": 31,
27-
"name": "Oran",
28-
"name_ar": "وهران",
29-
"name_en": "Oran",
30-
"phoneCodes": [
31-
41
32-
],
33-
"postalCodes": [
34-
31000,
35-
31001,
36-
...
37-
31117,
38-
31118
39-
],
40-
"dairats": [
41-
{
42-
"name": "AIN TURK",
43-
"name_ar": "AIN TURK",
44-
"name_en": "AIN TURK",
45-
"baladyiats": []
46-
},
47-
{
48-
"name": "ARZEW",
49-
"name_ar": "ARZEW",
50-
"name_en": "ARZEW",
51-
"baladyiats": []
52-
},
53-
...
54-
]
55-
}
56-
}
57-
```
58-
* Get the adjacent (nearby wilayas)
59-
* Only wilaya codes `/wilaya/adjacence/:matricule`
60-
* Wilaya names `/wilaya/adjacence/:matricule/names` example response:
61-
62-
````json
63-
{
64-
"data": {
65-
"names": [
66-
{
67-
"mattricule": 46,
68-
"name": "Ain Temouchent",
69-
"name_ar": "عين تموشنت",
70-
"name_en": "Ain Temouchent"
71-
},
72-
{
73-
"mattricule": 22,
74-
"name": "Sidi Bel Abbes",
75-
"name_ar": "سيدي بلعباس",
76-
"name_en": "Sidi Bel Abbes"
77-
},
78-
{
79-
"mattricule": 29,
80-
"name": "Mascara",
81-
"name_ar": "معسكر",
82-
"name_en": "Mascara"
83-
},
84-
{
85-
"mattricule": 27,
86-
"name": "Mostaganem",
87-
"name_ar": "مستغانم",
88-
"name_en": "Mostaganem"
89-
}
90-
],
91-
"mattricules": [
92-
46,
93-
22,
94-
29,
95-
27
96-
]
97-
}
98-
}
99-
````
100-
* Short format (only wilaya names in a language and their codes)
101-
102-
```json
103-
{
104-
"data": {
105-
"names": [
106-
"عين تموشنت",
107-
"سيدي بلعباس",
108-
"معسكر",
109-
"مستغانم"
110-
],
111-
"mattricules": [
112-
46,
113-
22,
114-
29,
115-
27
116-
]
117-
}
118-
}
119-
```
120-
121-
* You can get an XML result by adding a `format=xml` query parameter, example:
122-
* GET: `http://localhost:3000/api/v1/wilaya/matricule/31?format=xml` will return:
123-
124-
```xml
125-
<?xml version="1.0" encoding="UTF-8"?>
126-
<wilaya>
127-
<phoneCodes>
128-
<phoneCode>41</phoneCode>
129-
</phoneCodes>
130-
<postalCodes>
131-
<postalCode>31000</postalCode>
132-
<postalCode>31001</postalCode>
133-
...
134-
<postalCode>31118</postalCode>
135-
</postalCodes>
136-
<adjacentWilayas>
137-
<adjacentWilaya>46</adjacentWilaya>
138-
<adjacentWilaya>22</adjacentWilaya>
139-
<adjacentWilaya>29</adjacentWilaya>
140-
<adjacentWilaya>27</adjacentWilaya>
141-
</adjacentWilayas>
142-
<mattricule>31</mattricule>
143-
<name>Oran</name>
144-
<nameAr>وهران</nameAr>
145-
<nameEn>Oran</nameEn>
146-
<dairats>
147-
<dairat>
148-
<baladyiats>
149-
<baladyiat>
150-
<code>3101</code>
151-
<name>ORAN</name>
152-
<nameAr>وهران</nameAr>
153-
```
154-
155-
* Get postal codes by Wilaya
156-
* Get wilaya by postal codes
157-
* Get Wilaya by phone code
158-
* GET: `http://localhost:3000/wilaya/phone-codes?code=41` and for getting XML results `http://localhost:3000/wilaya/phone-codes?code=41&format=xml`
159-
160-
* Healthcheck
161-
* GET: `http://localhost:3000/healthcheck`
162-
163-
Find the full documentation [here](https://documenter.getpostman.com/view/6370698/SW12ywmH?version=latest).
16+
Find the full API documentation [here](https://documenter.getpostman.com/view/6370698/SW12ywmH?version=latest) (*Will be moved to a SWAGGER documentation*).
16417

16518
## TODOs & Future Improvements/Features
16619

0 commit comments

Comments
 (0)