Skip to content

strydio/gown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GOWN Analytics

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!

What Is GOWN Analytics

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.

GOWN Client

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.

Deploying Your Own Stack

Deploying With GOWN CLI

The easiest way to deploy your own stack is to use the CLI.

GOWN 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 💜

Deploying With Scripts (Manual)

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 CLI
  • NAMESPACE - this is used to prefix the resource names to make your GOWN resources identifiable in AWS
  • CLIENT_DOMAIN - your blog website URL
  • CREATE_REFERRER_TABLE - true/false
  • ENVIRONMENT - dev/prod/staging

Scripts to run

  • ./build.sh - builds and bundles the Go Lambda functions
  • ./deploy.sh - deploys the stack to AWS