Giter VIP home page Giter VIP logo

openousd-site's Introduction

Overview

This is the repo for the OpenOUSD project located at openousd.org. Read the front page for a description of the project. All contributors are volunteers and the project has no private or public funders.

We welcome new team members!

Technology

OpenOUSD uses several technologies:

  • Gatsby, a static site generator built on React
  • Postgres to store public datasets
  • Node.js to serve that data as JSON through a light API (see openousd-api)

Since this is a static site, the data is fetched once and stored in static JSON files in the /data directory. The live site does not require any API or database.

Setting Up The Project Locally

  1. Run git clone [email protected]:openoakland/openousd-site.git
  2. cd openousd-site
  3. npm install (if you don't have npm, install node via the node installer or homebrew (macOS) or nvm if you work on several node projects)
  4. Run npm install -g gatsby-cli to install the gastby command line tool globally
  5. Ask a member of the project team on OpenOakland Slack for a Contentful API token. Insert the token into this command and run it to create a file and populate the token as an environment variable.
echo "CONTENTFUL_ACCESS_TOKEN={insert the token here and remove brackets}" > .env.development
  1. gatsby develop

Go to http://localhost:8000 in your browser

Using docker

Setup

docker-compose up

TODO: may need to delete the volume and recreate the container if you want to updte package.json / containers or look into using the --renew-anon-volumes flag.

Cleaning out old containers

  1. run the script ./cleanDocker.sh
  2. enter y to prune volumes when prompted

See: https://stackoverflow.com/questions/30043872/docker-compose-node-modules-not-present-in-a-volume-after-npm-install-succeeds

Deploying

Staging

Anyone with write privileges to the repository should be able to push a branch to staging.openousd.org.

To do that, run this command from your branch:

npm run deployStaging

This runs some commands listed in package.json which essentially:

  1. run a production gatsby build
  2. creates the CNAME file for GitHub Pages
  3. Pushes to the gh-pages branch using gh-pages

Promote Staging to Production

Only a few members of the group and OO GitHub admins can publish staging.openousd.org to openousd.org.

Please be careful. If you have those permissions, you can run this command from any branch:

npm run promoteStaging

This probably needs to be brought into a proper deploy system, but for now this runs promote_staging.sh which essentially:

  1. git fetches the latest from GitHub
  2. checks out the gh-pages branch
  3. replaces the staging CNAME file with the production one
  4. pushes the files to openousd-site-prod master repo
  5. goes back to the branch you started in

Testing with Percy

Percy is a tool that takes screenshots of web pages across browser types and page widths (mobile, desktop) and does a visual "diff" to see if anthing has changed visually during development. Then you can decide if the changes is desired or not.

OpenOUSD's Percy project is here.

Config / Setup

  • Get a Percy project API token from a member of the team
  • Create a file in your local directory called .env.production
  • In that file, add a line PERCY_TOKEN=<Enter Token Here> to specify the token

Running Tests

Note: The free version of Percy allows 5000 screenshots a month. Each page has a screenshot for each language OpenOUSD supports and for desktop and mobile. At the time of writing this, that was ~125 screenshots per run.

  • To run against Staging: npm run percyStaging
  • To run against Production: npm run percyProd

openousd-site's People

Contributors

alex-engelmann avatar emilybram avatar halsee avatar jbaldo avatar kbrdsk avatar maciejkus avatar morkwood2 avatar vahurtad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

openousd-site's Issues

Some department names are cut off, all caps

In the main departments table, a few of the departments have wonky names:

"Comm. Schools & Student Servic" probably Services?

"Human Resources Services, Supp" not sure what this is supposed to be

"Eng Lang Lrnr/Multilingual Ach"

LINKED LEARNING is in all caps for some reason.

These need to be fixed on the database or in the query, as they're dynamically generated. Otherwise I'd edit them myself :)

Contact and email forms can be submitted empty

Contact and email forms will be "submitted" after pressing buttons, with "submitted" page showing.
Add check for form validity:

  • Check validity of form to enable submission
  • Display error message if form isn't valid

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.