/scout-x-test

Primary LanguageJavaScriptApache License 2.0Apache-2.0

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

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.

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_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_USE_PRESET_TAXONOMIES Overwrite theme default and force load from outpost taxonomies API true/false No
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

🧪 Tests and linting

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

You can run all the tests with:

npm test

You can lint with:

npm run lint