-x509
: Outputs a self-signed certificate.-newkey rsa:4096
: Generates a new RSA key of 4096 bits.-keyout server.key
: Outputs the private key to server.key.-out server.crt
: Outputs the certificate to server.crt.-days 365
: Sets the certificate validity to 365 days.-nodes
: Prevents encrypting the private key.-subj "/CN=localhost"
: Sets the Common Name (CN) to localhost.
# Generate a private key for the root CA
openssl genrsa -out rootCA.key 4096
# Create the root CA certificate
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 3650 -out rootCA.crt \
-subj "/CN=RootCA"
openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -nodes -subj "/CN=localhost"
# Generate the server key and certificate signing request (CSR)
openssl req -new -newkey rsa:4096 -keyout server.key -out server.csr -nodes \
-subj "/CN=poi-backend" \
-addext "subjectAltName=DNS:localhost,DNS:poi-backend,IP:127.0.0.1"
# Sign the server CSR with the root CA
openssl x509 -req -in server.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial \
-out server.crt -days 365 -sha256 -extfile <(printf "subjectAltName=DNS:localhost,DNS:poi-backend,IP:127.0.0.1")
# Make pem
openssl x509 -in rootCA.crt -out rootCA.pem -outform PEM
Create a .env
file in the root directory with the following content:
APIFY_KEY=""
APIFY_ACTOR_EXTRACTOR_ID=""
APIFY_ACTOR_SCRAPER_ID=""
DATABASE_USER="postgres"
DATABASE_PASSWORD="postgres"
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Load environment variables:
source load_env.sh
-
Start Docker containers:
make docker-up
-
Run database migrations:
make migrate-up
-
Generate Protobuf code:
make buf-generate
-
Run the application:
make run
-
Run the application:
make run
-
Start Docker containers:
make docker-up
-
Stop Docker containers:
make docker-down
-
Generate Protobuf code:
make buf-generate
-
Remove Protobuf code:
make buf-remove
-
Run database migrations:
make migrate-up
-
Rollback database migrations:
make migrate-down
-
Check migration version:
make migrate-version
-
Check migration status:
make migrate-status
-
Create a new migration:
make migration-new name=<migration_name>
-
Generate SQLC queries:
make sqlc
-
List POIs in a Box:
GET /v1/poi/box
-
List POIs by H3 Cells:
GET /v1/poi/h3
-
List POIs Along Route with Category:
GET /v1/poi/route/category
-
Search Google Maps Scraper:
POST /v1/maps/search/scraper
-
Search Google Maps Extractor:
POST /v1/maps/search/extractor
-
Insert Apify Dataset Items:
POST /v1/maps/dataset/insert
- Search Tripadvisor:
POST /v1/tripadvisor/search