This project was inspired by a need to understand an aspect of web networking a bit more deeply. It has since powered my own personal blog for anonymous analytics. It is a rewrite of my initial and now archived attempt (https://github.com/Codeama/analytics). This current version is a leaner and simplified. I hope you find it useful!
GOWN is a blog analytics server that uses a websocket to listen for connections (browser sessions) and creates entries for views in a data storage (DynamoDB).
It uses AWS serverless/managed services: API Gateway, DynamoDB and Lambda.
There is a GOWN client library that you can use for your blog website to connect to your GOWN server. It is a simple JavaScript (actually TypeScript) library that you can use to connect to your GOWN server. It is available on npm.
The easiest way to deploy your own stack is to use the CLI.
You can also use the CLI in docker to deploy your stack, especially if you don't want to install all the dependencies on your machine. More info can be found in the CLI README.md.
If you already have AWS CLI installed locally and an AWS account profile setup, you can follow the steps below for a quick deploy with the CLI.
- clone the repo:
git clone strydio/gown.git - cd into the cli directory
- run
go run cmd/main.go
The GOWN CLI is built with Charmbracelet's Bubbletea TUI framework 💜
Dependencies
To do this, you'll need to have the following installed on your machine:
- Go and NodeJS
- AWS CLI (with an AWS account profile setup)
- AWS CDK CLI
Environment variables
AWS_PROFILE- with AWS CLINAMESPACE- this is used to prefix the resource names to make your GOWN resources identifiable in AWSCLIENT_DOMAIN- your blog website URLCREATE_REFERRER_TABLE- true/falseENVIRONMENT- dev/prod/staging
Scripts to run
./build.sh- builds and bundles the Go Lambda functions./deploy.sh- deploys the stack to AWS
