From db64186206ba5fffe9c4c8dcf6522f5b77304b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ubeyde=20Emir=20=C3=96zdemir?= Date: Fri, 1 Mar 2024 19:44:09 +0300 Subject: [PATCH] Last considerations --- README.md | 27 +- src/views/index.pug | 2 +- src/views/url-creator.html | 1082 ------------------------------------ 3 files changed, 24 insertions(+), 1087 deletions(-) delete mode 100644 src/views/url-creator.html diff --git a/README.md b/README.md index aabb7dd..3ec2264 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,29 @@ The API uses [turkiyeapi.dev](https://turkiyeapi.dev) as the main domain. But yo ## Documentation -[API Documentation](https://turkiyeapi.dev/docs) -[Examples](https://turkiyeapi.dev/examples) -[Postman Collection](https://documenter.getpostman.com/view/19561492/UzBguVHM) -[Swagger UI](https://turkiyeapi.dev/swagger) +- [API Documentation](https://turkiyeapi.dev/docs) +- [Examples](https://turkiyeapi.dev/examples) +- [Postman Collection](https://documenter.getpostman.com/view/19561492/UzBguVHM) +- [Swagger UI](https://turkiyeapi.dev/swagger) + +## Last Considerations + +The v1 version seems to have started to lose its developability and maintainability. When I first started developing the project in 2022 (I had just started my first year of university at that time), the name of the project (and of course also the repository) was "Provinces of Turkey API". The reason for this is that during the first few months when the API was first developed, you could only retrieve province information (Also, this information consisted of only five properties: id, name, population, areaCode and isMetropolitan). Over time, I focused on fixing the bugs of the API and adding new features (one of them was districts). Over time, districts became a schema in their own right, just like provinces, but instead of being written separately with an ID-Key connection, these districts were written in the district arrays of the relevant provinces in the same json file. This is the first problem, I have largely solved this problem for v1, but there are still some problems. The second problem was that there was no support for query parameters at first. These parameters were added step by step over time (first added "name, offset, limit", then filtering parameters, then fields, lastly sort). + +It is not easy to write the code from scratch without breaking the API requests of v1 users, however, I want to spare time for other projects and other work. That's why I'm taking a long break for this project. When the time comes, I will most likely start writing v2. Things I need to examine other sample APIs and also decide: + +- Should I use database in v2 as opposed to v1? +- What kind of project structure should I create? +- Should I prefer snake_case instead of camelCase? (like area_code instead of areaCode) +- What kind of route structure should I use? (Should I use routes like "/provinces/34/districts/1852" instead of separate routes for provinces, districts, etc.? +- Municipality support was not added to v1 because it would have been a bit complicated if I had added it. +- What kind of connection should there be between Schemas? (How exactly can we position the municipalities when there is an order like provinces > districts > neighborhoods + villages) +- fields property cannot set quadratic (or more nested) props, also sort property does not work for all fields. How can I find a solution to this? +- Many more things I can't think of right now. + +Because of all this, this time I will try to improve myself in terms of learning and plan well this time. The project has come a long way from when it first started and has much more advanced capabilities. Frankly, I think I've added enough features and made improvements to last until v2. I need some time to realize the things I plan to do for v2, so I'm taking a long break. When v2 is released (if it is released) it will have better and more descriptive documentation, be more systematic and expandable. You can still submit your suggestions, requests, etc. by opening an issue on the Türkiye API GitHub page. you can write. In this case, I will also consider these for v2. + +Best wishes! ## Usage of API diff --git a/src/views/index.pug b/src/views/index.pug index d903664..ac88fec 100644 --- a/src/views/index.pug +++ b/src/views/index.pug @@ -291,7 +291,7 @@ block content footer.footer p.footer__text | Created by - a.footer__link(target='_blank' href='https://ubeydeozdmr.netlify.app') Ubeyde Emir Özdemir + a.footer__link(target='_blank' href='https://ubeyde.me') Ubeyde Emir Özdemir | / a.footer__link(target='_blank' href='https://github.com/ubeydeozdmr/turkiye-api') GitHub | / diff --git a/src/views/url-creator.html b/src/views/url-creator.html deleted file mode 100644 index fbf7d0d..0000000 --- a/src/views/url-creator.html +++ /dev/null @@ -1,1082 +0,0 @@ - - - - - - - - - - - - - - - - URL Creator for Turkiye API - - -

URL Creator for Turkiye API

-

- This tool has not been tested sufficiently yet and may not be stable. You - can describe the problems you encounter on - GitHub Issues. -

-
-

What do you want to do?

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

Is metropolitan?

-
- - -
-
- - -
-
- - -
-
-
- - - (The results start from the order of the number you entered) -
-
- - - (Province data is displayed as many as the number you enter) -
-
-

Fields you want:

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

Sort type:

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

Fields you want:

-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
-
-
-
- - -
-
- - -
-
- - -
-
- - - (The results start from the order of the number you entered) -
-
- - - (District data is displayed as many as the number you enter) -
-
-

Fields you want:

-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
- - - (Districts connected to the same province are listed among - themselves according to their names) -
- (If you are considering something else (eg. population) instead of - name as a secondary sorting method (the primary being 'Province'), - you can try using &sort=province,population instead of - just &sort=province) -
-

Sort type:

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

Fields you want:

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