Git Product home page Git Product logo

scout-x's Introduction

Service directories done right


Example screens from the app


CI

Netlify Status

๐Ÿšจ This is BETA software. Please file an issue for any bugs ๐Ÿšจ

A simple API-driven front-end for local authority service directories and local offers.

It's intended for use with Outpost and its API service, but, with some tweaks, could consume any API that follows the Open Community standard.

๐Ÿงฑ How it's made

It's a client-rendered React app, built on create-react-app.

The pinboard feature uses localstorage, and it has one email-sending function that is intended to run on Netlify functions.

๐Ÿ’ป Running it locally

Locally

You need Node.js and npm installed, plus an API for Scout to consume data from.

First, clone the repo:

npm install
npm run dev

Before building, it will attempt to grab the latest version of the collection, category and SEND needs filters if there's an appropriate datasource available.

It'll be on localhost:3000.

Using docker-compose

git clone [email protected]:wearefuturegov/scout-x.git && cd scout-x

docker compose up -d

# open shell in container
docker compose exec scout /bin/ash;

# stop the container
docker compose stop

Serverless functions

To test out the email-sending function locally you'll need to install Netlify Dev and use netlify dev to start the app instead.

It should be on port 8888.

๐ŸŒŽ Running it on the web

Deploy

It's suitable for any static host, such as Netlify.

Run the npm run build command and then serve the /build folder.

If you want to use the built-in email sending function, you'll need to host it on Netlify.

๐Ÿงฌ Configuration

You can configure it using a .env file locally. Run cp .env.example .env to make a fresh one.

Variable Description Example Required?
REACT_APP_THEME Which version of scout are we deploying, generic or other generic, BFIS, BOD Yes, for theme switching
REACT_APP_API_HOST The location of the API where service data can be read https://example.com/api/v1 Yes
REACT_APP_GOOGLE_CLIENT_KEY Needs the Google Places, Maps Javascript and Maps Static APIs enabled Yes, for map features
REACT_APP_GOOGLE_STATIC_MAPS_API_KEY Separate API key restricted to Static API and specific urls Yes, for map features
REACT_APP_GA_PROPERTY_ID Google Analytics property ID UA-00000-1 No
REACT_APP_FEEDBACK_URL The URL to a form where users can submit feedback about the service https://example.com Yes, for feedback form links
REACT_APP_OUTPOST_REGISTER_URL The URL to where users can register to the related outpost install https://example.com Yes, for users to be able to register
REACT_APP_OUTPOST_LOGIN_URL The URL to where users can sign in to the related outpost install https://example.com Yes, for users to be able to sign in and manage their service
REACT_APP_FILTERS_DATASOURCE A non-standard API endpoint, to grab data about taxonomies and SEND needs to populate filters on app boot https://example.com/api/v1 No
NOTIFY_API_KEY Your API key for Notify Yes, for email features
NOTIFY_TEMPLATE_ID The ID of a Notify email template to use Yes, for email features
EMAIL_HOST URLs in emails will be built using this host. https://example.com Yes, for email features
REACT_APP_TARGETS If you have created directories in outpost set this field to fetch for those you want to display here, otherwise all services will be fetched bfis,bod No
REACT_APP_SITE_URL The site url - used for the /public html files needing a canonical url for best SEO (set automatically if using netlify) https://github.com/wearefuturegov/scout-x Yes
REACT_APP_PARENT_TAXONOMY_SLUG If you don't want to start the left hand side taxonomies from the top level you can define a parent taxonomy slug here https://github.com/wearefuturegov/scout-x No

๐Ÿงช Tests and linting

It uses Prettier to enforce code style, along with Jest for unit tests and Cypress for integration/UI tests.

Make sure you have the server running before you run the Cypress tests. You can run all the tests with:

npm test

You can lint with:

npm run lint

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.