Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

GetDKAN/data-catalog-frontend

Repository files navigation

DEPRECATED - please use data-catalog-app

This is a REACT frontend designed to utilize the latest stable version of DKAN 2.x as a backend.

This application serves as a starter app, or example of how to use the data-catalog-components library to easily create open data catalogs.

Auto Set Up

  1. Follow the DKAN Tools README to stand up the backend. Include the --demo flag to have the frontend installed and example pages built as well.

Manual Set Up

If you have a backend already running and just need the frontend:

  1. Install the Gatsby CLI npm install -g gatsby-cli
  2. Clone this repository in your docroot git clone https://github.com/GetDKAN/data-catalog-frontend.git
  3. Install the dependencies with npm:
    1. cd data-catalog-frontend
    2. npm install
  4. Edit the .env.production file to change the GATSBY_API_URL to reflect your site url
  5. Run the server: npm start or gatsby develop
    1. Your site is now running at http://localhost:8000
  6. Build the public files npm run build or gatsby build

Learn More

You can learn more in the Gatsby.js documentation.

To learn React, check out the React documentation.

Structure of the app

This is meant to be a blueprint for your frontend, from which you can make minor color and logo changes or major component or page layout customizations.

├── cypress           # Integration tests
├── public            # The output of the build process
├── src               # This directory will contain all of the source code
|   ├── assets        # Place to store images and content/config files
|   ├── components    # Configure your page structure with the layout component
│   ├── pages         # Components in this directory become pages automatically with paths based on their file name
│   ├── services      # Provides the connections to the backend api
|   └── templates     # Ideas for how to assemble components to display the data
│   └── theme         # Add custom fonts, colors, and css here
├── .env.development  # Local environment variables
├── .env.production   # Production environment variables
├── gatsby-browser.js # Customizations affecting the browser
├── gatsby-config.js  # The main configuration file
├── gatsby-node.js    # Customizations affecting the site build process
├── gatsby-ssr.js     # Customizations affecting server-side rendering
├── package.json      # App dependencies
└── providers.js      # Component that wraps the root element

Basic Customizations

  • Edit the src/assets/config.json file to change the site title, slogan, logo, and container class.
  • Edit the src/theme/styles/_variables.scss file to change the colors and fonts of your site.
  • Add custom .scss files to src/theme/styles/ to override the default css classes with your new color variables and other changes.
  • Import your .scss files to src/theme/styles/index.scss
  • Run gatsby develop to preview, then npm run build to generate the public files.
  • Edit the cypress.json file to update the baseUrl to match your site.

To Do

Update cypress tests to not use ids or classes as identifying elements. These can change without warning.