/CountryInfo

SCHOOL: Individual assignment - System support and integration with 3P systems

Primary LanguageTypeScript

CountryInfo

SCHOOL: Individual assignment - Communication with Web APIs

Description of assignment

In this assignment, you must create a website that displays information retrieved from your self-built API. Your own API must also retrieve data from an external API and then send the data on to the client. Your own API must be an Express server built in NodeJS that handles any resource. For G, there must be an endpoint to retrieve all entities from your resource (GET) and an endpoint to create a new entity (POST). For VG, the API must be expanded with endpoints to update an entity (PUT), delete an entity (DELETE) and retrieve a specific entity (GET). It must be clearly stated in your client interface that you are retrieving data from an external API of your choice. The data that is downloaded must therefore be displayed in your interface.

You then choose for yourself if you want to use an extended development stack in the project, note that this is not a requirement. Examples of frameworks you can add to your stack are: Typescript, React, Vue, Angular, etc.

My project

  • Structure

    • Client: React.ts and mui
    • Server: Node.js using express
    • "Database": JSON-file using fs
  • External API - https://restcountries.com/

    • Gets information about countries. I have used:
      • List of all countries
      • List of all countries by region
      • specific country by country
  • Own API

    • Able to see, post, change and delete comments/notes about specific country

Below follows the assignments different requirements in Swedish.

Krav för G

  1. Skapa ett API baserat på en valfri resurs (GET & POST) ✅
  2. Samtliga endpoints skall kunna nås via en REST Client fil (.rest) ✅
  3. Datan som API:et hanterar sparas lokalt i serverfilen ✅
  4. Ett simpelt klient-gränssnitt skall finnas för att anropa ert API olika endpoints, samt visa upp resultatet vid GET anrop ✅
  5. Ert API skall hämta och data ifrån ett externt API och skicka vidare datan till klienten ✅
  6. Git & GitHub har använts ✅
  7. Projektmappen innehåller en README.md fil ✅
  8. Uppgiften lämnas in i tid! ✅

Krav för VG

  1. Alla punkter för godkänt är uppfyllda ✅
  2. Resursen i ert API skall även ha endpoints för PUT, DELETE och GET för en entitet ✅

Link to repo: https://github.com/totaldekadens/CountryInfo

Installing

  • Open project in your code editor

  • Open terminal. Make sure you are standing in the "server" folder.

    • Npm i
    • Npm start
  • Redirect to "client"

    • Npm i
    • Npm run dev

Sneak peak

Desktop

front vald region valt land kommentarer lägg till kommentar ändra kommentar sökresultat sök not found

Mobile

front drawer region land kommentar sök