this is fiber aws serverless example source code. it uses a serverless framework, It's more simple serverless framework than AWS SAM or CDK for beginners.
Sorry AWS, Cheer up. I bought your stocks.
- gorm (for manipulate DB)
- fiber(for http application)
- cobra (for cli application)
- serverless framework tool
📦fiber-aws-serverless
┣ 📂cmd
┣ 📂const
┣ 📂config
┣ 📂db
┣ 📂docs
┃ ┣ 📜todo.http # like swagger. It's descript for application
┃ ┗ 📜aws_diagrams.py # It can generate aws architecture diagrams
┣ 📂model
┣ 📂internal # about business logics
┃ ┣ 📂container # this module is dependency conainer for sharing between application package and service package
┃ ┣ 📂app # this module manage about grpc, http and websocket applications.
┃ ┗ 📂service # about business logics for each domains
┣ 📂lambda
┃ ┗ 📜main.go # for serverless main.go
┣ 📜main.go # for dockerize or cli
┣ 📜.enc # It's important, It must have secrets.
┣ 📜serverless.yml # it's deploy tool for aws serverless lambda for http
- dependency inject direction
main => cmd(module) => container(module) => app(module) => service(todo and etc.)
I recommend you first see ./main.go, ./lambda/main..go. It's quite dif
npm install -g serverless serverless-dotenv-plugin
# start server at local
go run main.go http start
# initialize DB
go run main.go gorm init
# deploy
make deploy
# generate docs
make docs
# tail cloudwatchlogs realtime
aws logs tail /aws/lambda/fiber-aws-serverless-alpha-api --follow
see demo docs/todo.http
https://y6dgbjxz50.execute-api.ap-northeast-2.amazonaws.com/alpha/health
- documentation tools: mingrammers/diagrams