Welcome to the Govsky project!
Here you will find the code that powers Govsky. The aim of making this code available is two-part: (1) transparency about how Govsky works and (2) providing working code that others can use to implement part or all of the Govsky offerings.
Govsky provides Bluesky bots and lists that track official government accounts on Bluesky. Additionally, Govsky provides a web app to search and visualize government presence.
If you're here to suggest new countries or domains, thank you! The best way to get started is to open an issue in this repo and we can discuss adding it.
Big thanks to the following folks for making Govsky happen!
Miguel Correa 💻 🚇 |
Nick Scialli 💻 🚇 🐛 🖋 🔣 💵 🚧 📦 |
If you're just interested in consuming the Govsky API from your own code, that's great! You can hit the following endpoint to get a list of validated Bluesky government handles:
https://api.govsky.org/api/[domain-here]
For example, if you want to see all .gov
domains, you can use the following URL: https://api.govsky.org/api/.gov. If the government domain you want is not available, please open an issue in this repo and we can get it added.
This codebase is a Rush.js monorepo with the following node.js-based projects:
Project | Description | Location |
---|---|---|
@govsky/api | A node API server that returns government entity handles, dids, and display names. | projects/api |
@govsky/bots | A node project that periodically hits the API and performs various automated actions by Bluesky bot accounts: follow, unfollow, welcome message, add to list. | projects/bots |
@govsky/config | Shared config files used in other projects in the monorepo. | projects/config |
@govsky/database | Shared database specification for tracking plc.directory changes. | projects/database |
@govsky/plc-backfill | Code used to keep up-to-date with plc.directory changes and periodically validate relevant entries. | projects/plc-backfill |
@govsky/web | Code for the Govsky web app UI. | projects/web |
Each project directory has its own README file where you can learn more about the individual project.
All of the projects in the monorepo require node and rush to be installed. All of the projects except @govsky/bots
require you to have a database up-and-running.
To run the project locally, you'll need to make sure you have node.js installed. Additionally, you'll want the Rush.js CLI, which can be installed globally with node's package manager:
$ npm install -g @microsoft/[email protected]
Assuming this worked, you should be able to run/see the following
$ rush --version
Rush Multi-Project Build Tool 5.148.0
Note: this step is not required if you're just planning on running the @govsky/bots
project.
For convenience, a docker-compose.yml
has been included in the root level of this project, which will run a Dockerized postgres database locally. To use this, you'll need to have Docker installed first.
Assuming docker is installed, you should be able to run the following command to start a local database:
docker-compose up
Run the following rush command anywhere inside the monorepo to install dependencies:
rush update
With the exception of the @govsky/config
project, each project has a .env-example
file that will need to be copied to .env
in the same directory.
The variables in this file will (probably) need to be updated with your own settings. For example, you may need to add the correct connection strings for your database or the correct handle/password for your Bluesky account(s).
You can build all the projects using the following command:
rush build
Rush also has some flags for the build
command to on build a project and some of its dependencies. You can read up on those flags here.
Each of the project, with the exception of @govsky/config
, can be run with the following command in the project's directory:
rushx start
Note that this command is just an alias for running node dist/index.js
.
Rush has a handy deploy command. You can deploy the backend services using the following command:
rush deploy -p @govsky/api
Or the web app using this command:
rush deploy -p @govsky/web
This bundles up all the projects as specified in common/config/rush/deploy.json
and puts them in the common/deploy
directory. This directory can then be placed on a server and the individual projects can be run.
There following files are related to how Govsky gets deployed to and run on fly.io:
Dockerfile
fly.toml
- The
scripts
directory
These likely won't be of interest unless you're deploying all or part of the service.