Xplorers API is the backend service for the Xplorers website and other related tasks. It provides endpoints to interact with Slack users and channels, among other functionalities.
In order for gcloud command to be acessible globally, extract google-cloud-sdk into Home Directory.
Navite to downloads folder or where google-cloud-cli is installed
cd ~/Downloads
Extract and move (.tar.gz) file into $home
path.
tar -xzvf filename.tar.gz -C $HOME
Run the install.sh
command
cd ~/google-cloud-sdk && ./install.sh
Initialize the SDK
$HOME/google-cloud-sdk/bin/gcloud init
Clean up the downloaded archive and any temporary files
rm ~/Downloads/google-cloud-sdk-*.tar.gz
You will need access to the Google Cloud Platform to deploy the Xplorers API. If you don't have access, please contact the project owner.
Once you have access, login to Google Cloud via gcloud cli + setup application default credentials via Application Default Credentials (ADC),
Run gcloud init to authorize gcloud and other SDK tools to access Google Cloud using your user account credentials.
Run gcloud auth application-default login to obtain access credentials for your user account via a web-based authorization flow. When this command completes successfully, it sets the active account in the current configuration to the account specified. If no configuration exists, it creates a configuration named default.
To install and deploy a feature branch of the Xplorers API, follow these steps:
Clone the repository:
git@github.com:xplorer-io/xplorers-api.git
cd xplorers-api
Install dependencies:
task install
Update TERRAFORM_WORKSPACE
in configuration/defaults.conf
The TERRAFORM_WORKSPACE
variable in the configuration/defaults.conf
file should be updated to the name of the github issue number you are working on.
For example, if you are working on issue #1, the TERRAFORM_WORKSPACE
variable should be set to issue-1
.
This ensures multiple developers can work on different issues concurrently without interfering with each other.
Run terraform init:
This command initializes the Terraform working directory and downloads the required providers. This command also initializes the Terraform backend which is Google Cloud Storage in this case.
task terraform-init
Run terraform plan:
This command creates an execution plan. By default, it shows what actions Terraform will take to change the infrastructure. This command does not make any changes to the infrastructure and is safe to run to see what changes will be made.
task terraform-plan
Run terraform apply:
This command applies the changes required to reach the desired state of the configuration. This command will create the resources defined in the Terraform configuration.
task terraform-apply
Contributions are welcome! Please follow these steps to contribute:
When creating branches, please adhere to the following naming conventions to ensure clarity and consistency across the project. The branch name should provide relevant information about the work being done and include the issue number if it exists.
Feature Branches:
feat/issue-1_header
Bug Fix Branches:
bug/issue-10_login_auth
feat/issue-23_add_user_profile_page
bug/issue-45_fix_payment_gateway_error
chore/update_dependencies
docs/add_api_documentation
For commit messages, please follow Conventional Commits structure. This ensures that commit messages are consistent, informative, and can be easily parsed by automated tools.
A commit message should consist of a header, an optional body, and an optional footer. The header has a specific format that includes a type, an optional scope, and a subject.
<type>(<scope>): <subject>
Type:
Scope:
Subject:
feat(auth): Add user authentication
fix(login): Fix login form validation
docs(api): Update API documentation
style(header): Format header component
refactor(utils): Refactor utility functions
test(api): Add tests for API endpoints
chore(deps): Update dependencies