In order to develop locally, you can use Makefile commands to set up dependencies and run services.
First, clone the repo and set up dependencies:
- Clone the repository:
git clone https://github.com/your-username/url-shortener.git
- Navigate to the project directory:
cd url-shortener
- Run PostgreSQL container for
alias-gen
service:make run-postgres
- Run Redis container:
make run-postgres
- Create Docker network for ClickHouse and Metabase:
make create-docker-network
- Run ClickHouse container:
make run-clickhouse
- Setup ClickHouse plugin for Metabase:
make setup-metabase-plugins
- Run Metabase container:
make run-metabase
After setting up the dependencies you can create local configuration files local.yaml
in config
directories of both services, they are pretty much the same as production.yaml
. Also, instead of
using mongo
as main storage you can use SQLite
, to do that specify active_storage: "sqlite"
in local.yaml
for main
service and create storage directory in root:
mkdir storage
Finally, you can export CONFIG_PATH
paths for both services and run them:
- Export config path for
alias-gen
service and run it:export CONFIG_PATH=services/alias-gen/config/local.yaml && make run-alias-gen
- Export config path for
main
service and run it:export CONFIG_PATH=services/main/config/local.yaml && make run-main