Siberiana | Aggregator of the Historical and Cultural Heritage of the Yenisei Siberia.
Siberiana GraphQL API serves as an essential gateway to access and interact with the vast historical and cultural heritage of the Yenisei Siberia region. By providing a powerful GraphQL interface, this API offers a comprehensive way to query and retrieve information about the rich historical artifacts, cultural landmarks, and heritage sites of the Yenisei Siberia area.
Before you begin, ensure you have the following installed:
- Go (at least version 1.20)
- Docker
- Docker Compose
You will also need to set up the Task CLI tool and Air. Here's how:
-
Install Task: Task is a task runner that simplifies command execution. If you haven't already, install Task by following the instructions at https://taskfile.dev/installation/.
-
Install Air: Air is used for automatically rebuilding and restarting the application when code changes occur. There are multiple methods to install Air:
a. Install via Binary (preferred):
# Install Air binary into $(go env GOPATH)/bin/ curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin # Alternatively, install it into ./bin/ # curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s
b. Install via Go Install:
go install github.com/cosmtrek/air@latest
c. Using Docker:
docker run -it --rm \ -w "<PROJECT>" \ -e "air_wd=<PROJECT>" \ -v $(pwd):<PROJECT> \ -p <PORT>:<APP SERVER PORT> \ cosmtrek/air -c <CONF>
For more information on installation and usage, visit https://github.com/cosmtrek/air.
Ensure you have running Keycloak and MinIO instances. If you don't have them set up, use the following repositories to set them up:
-
Keycloak Instance: Follow the instructions at https://github.com/dkrasnovdev/siberiana-keycloak to set up a running Keycloak instance. Keycloak provides authentication and authorization services for the Siberiana GraphQL API.
-
MinIO Instance: Set up a running MinIO instance by following the instructions at https://github.com/dkrasnovdev/siberiana-minio. MinIO is used for object storage and is an essential part of the Siberiana GraphQL API.
Follow the steps outlined in the next section to start containers, run tasks, and access the application.
- Clone this repository to your local machine:
git clone https://github.com/dkrasnovdev/siberiana-api.git
cd siberiana-api
- Run the following command to download the required packages specified in the Taskfile:
task install
- Copy the
.env.example
file and rename it to.env
. Fill in the required environment variables with appropriate values.
task env
# Edit .env file with your configuration
To work on the project locally, follow these steps:
- Start the required containers (Postgres, Redis) for local development:
task db
- Run the development task:
task dev
This will start the development server using Air, allowing automatic rebuilding and restarting on code changes.
To build a binary of the application, use the following task:
task build-binary
After building, you can start the application using:
task start
To run the application in a Docker container, follow these steps:
- Build the Docker image:
task build-image
- Start the application in a Docker container:
task up
The application will be accessible at http://localhost:4000.
For deploying the project using Nginx as a reverse proxy, refer to the instructions in the Siberiana Nginx Setup repository.
If you encounter any issues or have questions, please feel free to create an issue on this repository.