Skip to content

argonmining/kat-gov

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kat-Gov

Project Status

This project is under active development, and changes are made often. Currently, Kat Gov is operating in a closed beta with dedicated customers. This repository contains the backend for the Kat Gov system. The frontend can be found here.

While the project is in closed beta, everything Nacho the Kat does is open source and built in public, so all development is committed here publicly and immediately. We welcome all contributors and would love to help you set up governance for your project. More information about Kat Gov can be found at KatGov.xyz.

Prerequisites

Before setting up the application, ensure you have the following installed on your Ubuntu VPS:

  • Bun (JavaScript runtime)
  • PostgreSQL

Setup Instructions

1. Update and Upgrade the System

sudo apt update && sudo apt upgrade -y

2. Install Bun

Install Bun by running the following command:

curl -fsSL https://bun.sh/install | bash

After installation, ensure Bun is in your PATH. You may need to restart your terminal or source your profile:

source ~/.bashrc

Verify the installation:

bun -v

3. Install PostgreSQL

sudo apt install -y postgresql postgresql-contrib

4. Set Up the Database

Switch to the PostgreSQL user and create a new database and user:

sudo -i -u postgres
psql

In the PostgreSQL shell, run:

CREATE DATABASE katgov;
CREATE USER katgovuser WITH ENCRYPTED PASSWORD 'yourpassword';
GRANT ALL PRIVILEGES ON DATABASE katgov TO katgovuser;
\q
exit

5. Clone the Repository

Clone the Kat Gov repository to your VPS:

git clone https://github.com/yourusername/kat-gov.git
cd kat-gov

6. Set Up Environment Variables

Create a .env file in the root of your project and add the following environment variables:

DB_USER=katgovuser
DB_PASS=yourpassword
DB_NAME=katgov
DB_HOST=localhost
DB_PORT=5432
PORT=8080
KASPA_API_BASE_URL=https://api.kaspa.org

7. Install Project Dependencies

Install the necessary packages using Bun:

bun install

8. Build the Project

Compile the TypeScript code to JavaScript:

bun run tsc

9. Run the Application

You can run the application using PM2 to ensure it stays up:

bun install -g pm2
pm2 start dist/index.js --name kat-gov
pm2 save
pm2 startup

10. Verify the Application

Visit http://your-vps-ip:8080 to verify that the application is running.

Additional Information

  • CORS Configuration: The application is configured to allow CORS from any origin.
  • Testing: Run tests using bun test.

For more detailed information about the application architecture and endpoints, refer to the backendPlans.md file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published