trigger a build
github.com/99designs/gqlgen: For generating GraphQL servers in Go.github.com/charmbracelet/log: A charming logger for all your logging needs.github.com/go-chi/chi/v5: Lightweight and feature-rich router for building Go HTTP services.github.com/redis/go-redis/v9: A Redis client for Golang.gorm.io: A developer-friendly ORM for handling interactions with your PostgreSQL database.
- Go 1.18 or higher
- Docker
- Fork the repository, and clone it to your machine
git clone https://github.com/fivetentaylor/pointy- Move into the project directory.
cd code- Download the required Go dependencies.
make install- Setup local certs for tls
make certs-
Setup your database and fill the required information in the
.envfile. Look at the.env.example. -
Run the server locally.
make devNow, your server should be running at localhost:8080. (or what ever ADDR you set in your .env file.
You can build the project using the standard Go build tool. This will create a binary file that can be executed.
go build -o main .This project is licensed under the MIT License - see the LICENSE.md file for details.
This project wouldn't be possible without these wonderful projects and their contributors:
Please feel free to contribute to this project, report bugs and issues, and suggest improvements.
Login to ECR:
assume-role staging:admin aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 533267310428.dkr.ecr.us-west-2.amazonaws.comSet environment variables:
export PR_NUMBER=(your PR number)
export NODE_ENV=production
export WEB_HOST=https://pr-$PR_NUMBER-www.reviso.biz
export APP_HOST=https://pr-$PR_NUMBER-app.reviso.biz
export WS_HOST=wss://pr-$PR_NUMBER-app.reviso.bizBuild and push the server image to ECR:
docker build -t 533267310428.dkr.ecr.us-west-2.amazonaws.com/reviso-server:$(git rev-parse HEAD) -f cmd/reviso/Dockerfile --build-arg NODE_ENV=$NODE_ENV --build-arg APP_HOST=$APP_HOST --build-arg WS_HOST=$WS_HOST --build-arg WEB_HOST=$WEB_HOST .
docker push 533267310428.dkr.ecr.us-west-2.amazonaws.com/reviso-server:$(git rev-parse HEAD)Run the terraform:
cd terraform/postbuild/previewSet the environment variables:
export TF_VAR_web_sha=$(git rev-parse HEAD)
export TF_VAR_server_sha=$(git rev-parse HEAD)
export TF_VAR_pr_number=$PR_NUMBER
export TF_VAR_slack_webhook_url=(get from https://api.slack.com/apps/A06KB3LHGAY/incoming-webhooks)
assume-role staging:admin terraform init
assume-role staging:admin terraform plan
assume-role staging:admin terraform applyLogin to ECR:
assume-role staging:admin aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 533267310428.dkr.ecr.us-west-2.amazonaws.comSet environment variables:
export NODE_ENV=production
export WEB_HOST=https://www.reviso.biz
export APP_HOST=https://app.reviso.biz
export WS_HOST=wss://app.reviso.bizBuild and push the server image to ECR:
docker build -t 533267310428.dkr.ecr.us-west-2.amazonaws.com/reviso-server:$(git rev-parse HEAD) -f cmd/reviso/Dockerfile --build-arg NODE_ENV=$NODE_ENV --build-arg APP_HOST=$APP_HOST --build-arg WS_HOST=$WS_HOST --build-arg WEB_HOST=$WEB_HOST .
docker push 533267310428.dkr.ecr.us-west-2.amazonaws.com/reviso-server:$(git rev-parse HEAD)Run the terraform:
cd terraform/postbuild/stagingSet the environment variables:
export TF_VAR_web_sha=$(git rev-parse HEAD)
export TF_VAR_server_sha=$(git rev-parse HEAD)
export TF_VAR_slack_webhook_url=https://hooks.slack.com/services/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assume-role staging:terraform terraform init
assume-role staging:terraform terraform plan
assume-role staging:terraform terraform applyView the logs:
assume-role staging:terraform aws logs tail --follow /ecs/reviso-server/mainaws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 998899136269.dkr.ecr.us-west-2.amazonaws.com
docker build -t 998899136269.dkr.ecr.us-west-2.amazonaws.com/reviso-server:$(git rev-parse HEAD) -f cmd/reviso/Dockerfile .
Note you need to remove your node_modules first, since it needs to build from scratch
rm -rf frontend/web/node_modules
aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 998899136269.dkr.ecr.us-west-2.amazonaws.com
docker build -t 998899136269.dkr.ecr.us-west-2.amazonaws.com/reviso-server:$(git rev-parse HEAD) -f cmd/reviso/Dockerfile .
aws ecs execute-command \
--region <region> \
--cluster <cluster-name> \
--task <task-id> \
--container <container-name> \
--command "/bin/sh" \
--interactivedocker pull contribsys/faktory:latest
assume-role staging:admin aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 533267310428.dkr.ecr.us-west-2.amazonaws.com
docker tag contribsys/faktory:latest 533267310428.dkr.ecr.us-west-2.amazonaws.com/faktory-cache:latest
docker push 533267310428.dkr.ecr.us-west-2.amazonaws.com/faktory-cache:latest
Note: using staging here