Giter Club home page Giter Club logo

tea's Introduction

tea

Example of Golang api using OpenAPI schemas

Types generated using https://github.com/deepmap/oapi-codegen/

Development

Updating the schema

  1. Add to the schema.yml file
  2. run go generate ./...

Running the app

Bring up the backend app

cd api/handler
go run main.go

test the endpoints with curl or in vscode using the requests.http files

curl --request GET --url http://localhost:8080/teas
curl --request POST --url http://localhost:8080/teas
curl --request GET --url http://localhost:8080/teas/{id}

Bringing up the graph server:

cd graph && npm run start

Server ready at: http://localhost:4000/

Deployment

Backend ... Infra managed with CDK. See [ops/cdk][./ops/cdk/readme.md]

x-amazon-apigateway-integration Is set to be the execution endpoint of the lambda handler and must be a POST request -> https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-integrations.html

Endpoint currently deployed to: https://z4106slus8.execute-api.us-east-1.amazonaws.com/prod/teas

Frontend... NextJs on Cloudflare pages.

  • / index route for a list of teas
  • /tea/{id} for info about a specific tea
  • /create to add a new tea [route requires auth access and api needs auth access too]

Auth

https://github.com/auth0/nextjs-auth0#edge-for-middleware-and-the-edge-runtime

https://github.com/auth0/nextjs-auth0/blob/main/ARCHITECTURE.md

TODO

References

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-extensions-integrations.html -> extensions support the AWS-specific authorization and API Gateway-specific API integrations for REST APIs and HTTP APIs. https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.SpecRestApi.html -> CDK construct that builds an API Gateway from an OpenAPI spec https://docs.aws.amazon.com/lambda/latest/dg/golang-handler.html -> reference for using go as a lambda handler https://github.com/awslabs/aws-lambda-go-api-proxy/ -> framework allows using go-chi with a lambda handler

https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-lambda-go-alpha.BundlingOptions.html CDK construct for using go as a lambda

tea's People

Contributors

miamollie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.