Skip to content

Latest commit

 

History

History
127 lines (88 loc) · 3.26 KB

README.md

File metadata and controls

127 lines (88 loc) · 3.26 KB

Marketplace

Marketplace backend

⚠️ WARNING! ⚠️

This repo contains highly experimental code. Expect rapid iteration.

Global architecture

Global architecture

Github indexing

Github indexing

Data Diagram

Data Diagram

Development

🎗️ Prerequisites

Install rust and the dependencies:

make install

Usage

First, prepare your local environment by configuring your .env. Copy the .env.example file and replace the values tagged with REPLACE_AT_INSTALLATION according to your personal accounts.

cp .env.example .env

The Makefile contains all commands you may need. Please check it.

Examples:

make fmt                # Check code formatting
make check              # Check for compile errors
make clippy             # Run the linter
make                    # build the application
make unit-tests         # Run the unit tests
make integration-tests  # Run the integration tests

Or run the backend in local, each in a dedicated terminal:

make api
make github-indexer

Migrate database

First install diesel CLI

brew install libpq
brew link --force libpq
PQ_LIB_DIR="$(brew --prefix libpq)/lib"
cargo install diesel_cli --no-default-features --features postgres
  • To create a new migration, start running
diesel migration generate <your-migration-name>
  • Edit the generated files with your SQL code for up.sql and down.sql
  • Test your migration up and down by running
diesel migration run
diesel migration revert
diesel migration run
  • The file schema.rs should be then automatically updated

Security

To activate the GitGuardian pre-commit, you need first to connect to GitGuardian :

Then, install GitGuardian pre-commit hook to check if some secrets are leaked inside the code base :

run pre-commit install

Monitoring

We use Datadog as a monitoring solution. Datadog agents and drains are configured using Terraform.

📄 License

marketplace is released under MIT.