Skip to content

dotaviTS/Week7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Week 7

Tauspace Developer Internship

Outcomes:

  1. Understand API's
  2. Build a simple Elixir REST API.
  3. Document the API endpoints.

Prerequisites

Your computers support Hyper-V. This needs to first be enabled in the BIOS, then the feature activated in windows.

To enable Hyper-V using PowerShell:

Press the Win key, and type powershell. ...
In the PowerShell window, type the following shell command and hit Enter: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All.
PowerShell will run the cmdlet and initiate the Hyper-V enabling process.

Setup local virtual POSTGres environment in Hyper-V

We will be using Postgres on ubuntu in your Hyper-V VM.

1. APIs

1.1 What is an API?

API stands for Application Programming Interface. It's a set of rules and protocols that allows different software applications to communicate with each other. Think of it as a menu in a restaurant. You, the customer, have a list of dishes you can order, prepared by the kitchen. The waiter (API) takes your request to the kitchen and brings back the dish you ordered. In this analogy:

  • You are the user.
  • The order represents the request.
  • The kitchen is the system or application that processes the request.
  • The dish that is served to you is the response.
  • In a technical context, when you use an app on your phone to check the weather, the app sends a request to a server via an API. The server processes the request, retrieves the data, and sends it back to your app, which then displays the weather to you.

1.2 Why are APIs important?

  • Interoperability: APIs allow different software systems, which might have been developed independently and possibly in entirely different programming languages, to work together.
  • Modularity: Systems can be built modularly, with different components interacting through well-defined APIs. This makes development, scaling, and troubleshooting easier.
  • Security: Instead of giving direct access to databases or core systems, APIs allow controlled access, exposing only what's necessary.
  • Efficiency: APIs can provide a standardized way to provide and receive data, which can lead to faster development and integration times.
  • Economic Value: Companies often monetize their data and services through APIs. For instance, cloud providers offer a plethora of services accessed primarily through APIs.

1.3 Different types of APIs:

  • REST (Representational State Transfer): REST is an architectural style for distributed systems. RESTful APIs use HTTP requests to perform CRUD (Create, Read, Update, Delete) operations on resources, which are represented as URLs.

  • GraphQL: Developed by Facebook, GraphQL is a query language for APIs. Instead of having multiple endpoints, GraphQL APIs typically have a single endpoint that can interpret and respond to complex queries, allowing clients to request only the data they need.

  • SOAP (Simple Object Access Protocol): A protocol, primarily used for web services. It's known for its robustness and has built-in error handling. However, it's considered heavier than REST.

  • WebSockets: Unlike the request-response model of REST and GraphQL, WebSockets allow a continuous two-way communication between the client and server. It's useful for applications that require real-time functionality.

  • gRPC: Developed by Google, gRPC is a high-performance, open-source framework that uses HTTP/2 for transport and Protocol Buffers as the interface description language.

2. OAS 3.0 Specification

2.1. Introduction - What is OAS?

  • OAS (formerly known as Swagger) is a specification for building APIs. OAS defines a standard, language-agnostic interface to RESTful APIs. Allows both humans and computers to understand the capabilities of a service without accessing its source code or seeing further documentation.

2.2 Major Components

  • OpenAPI Object: The root document object of the OAS document.

  • Info Object: Provides metadata about the API like title, version, and other details.

  • Paths Object: Defines the available paths and operations for the API.

  • Components Object: A set of reusable objects for different aspects of the OAS. Can include schemas (like JSON schemas for request and response bodies), parameters, responses, examples, request bodies, headers, security schemes, links, callbacks, and more.

IANA Status Codes OpenAPI Definitions Designer

Please read this page ^^Focus on the architecture diagrams. --> If anyone knows how to embed them here, please add

3. Course Material on Setting up an API

PostGres Cheatsheet

CICD

About

Introduction to Concurrency, Processes, API's

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published