Realization of the same model as in FlightDirection repository, but with different stack. In this repository only the back-end is located.
API:
Get summary list of countries in given language. Language affects the title and textSnippet fields. If a country doesn't have an article in the provided language, the country will still be in the list, but title will be equal to the nameTransliterated and the textSnippet will be empty. It will be used to ask user if he wants to see an article in a different language anyway
{/country/:lang, GET}
Create a country. It's created with an original name only, other fields should be edited through further PUT requests.
{/country, POST}
Content-Type: application/json
Required body params: "name_original": string
Get summary list of towns in given language. Language affects the title and textSnippet fields. If a town doesn't have an article in the provided language, the town will still be in the list, but title will be equal to the nameTransliterated and the textSnippet will be empty. It will be used to ask user if he wants to see an article in a different language anyway.
{/town/:lang, GET}
Create a town. It's created with an original name only, other fields should be edited through further PUT requests. By the original name the name in the native language and script is meant, it will then be transliterated and used in React Routing to make more informative URLs (Αθήνα => athena, 北京 => bei-jing).
{/town, POST}
Content-Type: application/json
Required body params: "name_original": string
Get the article with given language and destination id. Returns an object, if nothing is found - fields of the object are null
{/article/:lang/:destination_id, GET}
Get a file by id. Returns Base64 string
{/file/:id, GET}
Upload a file as a byte array
{/destination/file/:destination_id, POST}
Content-Type: multipart/form-data
Required body params:
file: Buffer
name: string
Put an article to a destination in a language.
{/destination/article/:lang/:destination_id, PUT}
Content-Type: multipart/form-data
Required body params:
file: Buffer
name: string
Put a flag of country
{/country/flag/:destination_id, PUT}
Content-Type: multipart/form-data
Required body params:
file: Buffer
Stack:
- Node.js
- Nest.js, TypeScript
- Prisma - ORM/query construction
- PostgreSQL