Skip to content

Full-text search across 12M of cities in few milliseconds. Powered by PostgreSQL™

License

Notifications You must be signed in to change notification settings

leandronsp/yacs

Repository files navigation

Yacs

Yet another City search.

__   __ _    ____ ____  
\ \ / // \  / ___/ ___| 
 \ V // _ \| |   \___ \ 
  | |/ ___ \ |___ ___) |
  |_/_/   \_\____|____/

A simple application for searching cities and related data from around the world, powered by geonames.org and PostgreSQL full-text search capabilities.

  • Fast and reliable city search functionality using PostgreSQL, across +12M cities from around the world
  • Easy to set up and run locally

Made with

Requirements

Docker. You only need Docker. Seriously.

Setup

$ make bundle.install  # Install app dependencies
$ make up              # Start the database and application
$ make db.populate     # Populate the database using data from geonames.org

Server is running at http://localhost:4000

Running in production mode (before deploy)

$ docker network create yacs-production

$ make build.production.db
$ make run.production.db version=latest db_user=yacs db_password=yacs db_name=yacs
$ make populate.production.db db_user=yacs db_name=yacs

$ make build.production.app
$ make run.production.app version=latest db_host=yacs-production-db db_user=yacs db_password=yacs db_name=yacs

Server in production mode is running at http://localhost:5000

Provisioning & Deploy

First things first, you need to copy the ansible vars example:

$ cp ansible/vars.yml.example ansible/vars.yml

Change the placeholder values, then:

$ make ansible.setup
$ make ansible.setup.db
$ make ansible.deploy version=latest

Help

make help:

Usage: make <target>
  help                       Prints available commands
  bundle.install             Install app dependencies
  up                         Start the database and application
  logs                       Follow logs
  psql                       Open psql
  db.populate                Populate data from geonames.org
  db.reset                   Reset database
  build.production.app       Build the app image for production
  build.production.db        Build the database image for production
  push.production.app        Push the app production image
  push.production.db         Push the database production image
  run.production.db          Run the database in production mode
  populate.production.db     Populate the production database
  run.production.app         Run the app in production mode
  ansible.setup              Setup Docker & NGINX in production
  ansible.setup.db           Setup & Populate the database in production
  ansible.deploy             Deploy the application in production at a specific version (version=)

ASCII art generator

About

Full-text search across 12M of cities in few milliseconds. Powered by PostgreSQL™

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published