Code Monkey home page Code Monkey logo

open-business-directory's Introduction

Open Business Directory

A directory of essential businesses using Airtable (or Google sheets) as database

How to Contribute

  • File an issue via this repo's issues page.
  • Request a feature via this repo's issues page.
  • Comment on issues.
  • Write code to fix issues or to create new features. When contributing code, please be sure to:
    • Fork this repository, modify the code (changing only one thing at a time), and then issue a pull request for each change.
    • Test your code locally before issuing a pull request.
    • Clearly state the purpose of your change in the description field for each commit.

Architecture

This map shows business locations from data hosted in Airtable.

Built using Svelte, Leaflet, and Carto.js.

Icons from Maps Icons Collection.

Database overview

All data comes from 'public/data/row.csv', which is pulled every hour using get-data-from-airtable.yml github actions script.

If you would like to adapt this code for your project Duplicate the Airtable base using this link.

Afterwards change AIRTABLE_API_KEY , AIRTABLE_BASE_ID, AIRTABLE_TABLE_NAME on github secrets, or your .env file

Code overview

  1. The App component loads the public/data/row.csv into the rows store via the util/importData.js script, which pulls styles from constants.js to set up icon and color.
  2. The App component separated into two main components Sidebar and MapView which loads the rows Store.
  3. The filter store array filters the rows Store for both RowItems components and MapView
  4. When an item is selected by either clicking the element on the map or RowItems, it will set the selectedItem store (selectedItem.select(item)), and show the ItemDetails component.
  • Including map and center attributes in the selectedItem.select method will toggle the map to zoom in.

Setup

Setup .env

cd public
cp .env.example .env

Fill in your AIRTABLE_API_KEY

Download data

npm install 
npm run start

Setup the app

cd ..
npm install

You can either build by running npm run build or run live development environment by running npm run dev, then opening localhost:5000 in your browser.

Copyrights

Please see license file for details.

  • Non-code, Creative Commons Attribution 4.0
  • Code, GNU General Public License

Have Questions?

Email Zhi Keng He

open-business-directory's People

Contributors

zhik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.