Skip to content

sidan-lab/sidan-gov-api

Repository files navigation

Backend API for SIDAN Lab Governance Discord Bot

This is the backend API, used to interact with the Discord Bot for SIDAN Lab Governance.

Getting Started

Installation

yarn # or npm install

Pre-requisites

  1. (For database) Download and set up local PostgreSQL database, or use a cloud-based database service, like (Supabase)[https://supabase.com/].

Environment Variables

Create a .env file in the workspace repository and set the environment variables according to .env.example. For details, please refer to the internal documentation.

For database schema changes & migrations, port 5432 should be used for the database connection.

"postgresql://postgres:<database_password>@/sidan-gov?host=/cloudsql/gcp_project_id>:<region>>:<database_instance_name>"

For database connection & operation, port 6543 should be used.

DATABASE_URL=postgresql://postgres:[email protected]:6543

Running database migrations

Environment variable must be set for DATABASE_URL to connect to the database.

yarn db:generate # or npm run db:generate

Running the server

The server will start on http://localhost:3002 by default.

yarn dev # or npm run dev

Swagger Documentation

/api-docs will show the Swagger documentation for the API.

Testing

yarn test # or npm test

testing

About

The backend API server in SIDAN Lab governance project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •