Giter Site home page Giter Site logo

microwavenby / wic-mt-demo-project-eligibility-remix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from navapbc/wic-mt-demo-project-eligibility-screener

0.0 0.0 0.0 13.13 MB

License: Apache License 2.0

JavaScript 3.38% TypeScript 94.25% HCL 0.96% Dockerfile 0.25% SCSS 1.16%

wic-mt-demo-project-eligibility-remix's Introduction

WIC Eligibility Screener

This is an eligibility screener for the Special Supplemental Nutrition Program for Women, Infants, and Children (WIC). It was developed for the State of Montana.

Contents

This template includes setup for:

  • .github: common GitHub configuration such as an empty PR template and a directory for GitHub workflows
  • app: setup for the Next.js application should go here
  • docs: a directory for project documentation
  • infra: a directory for common infrastructure

How to Run

Without Docker

You can run the Next.js app without docker as follows:

  1. yarn install
  2. yarn dev
  3. Navigate to localhost:3000 in your browser to view the application

You can run storybook without docker by running:

  1. yarn storybook
  2. Navigate to localhost:6006 in your browser to view storybook

With Docker

The Next.js application is dockerized. Take a look at ./app/Dockerfile to see how it works.

A docker-compose.yml has been included to support local development and deployment. Take a look at ./docker-compose.yml for more information.

  1. In your terminal, cd to this repo.
  2. Make sure you have Docker Desktop installed & running.
  3. Run docker-compose up -d --build to build the image and start the container.
  4. Navigate to localhost:3000 in your browser to view the application. Note that it takes a few minutes for the initial sass compiling to complete and load.
  5. Run docker-compose exec nextjs yarn storybook to build and run storybook. Note that the initial sass compiling for storybook also takes a few minutes to complete and load
  6. Navigate to localhost:6006 in your browser to view storybook.
  7. Run docker-compose down when you are done to delete the container.

To support local development, the docker-compose.yml runs the nextjs container in development mode (i.e. yarn dev) instead of production mode (i.e. yarn start). This allows Next.js to do things like hot reload.

The docker-compose file bind mounts app on the host machine to /srv in the guest machine. However, to ensure that the container uses the correct packages in node_modules, we use a named docker volume for the node_modules dir. The named volume will take precedence over the bind mount, so that the node_modules dir in the guest machine will not be overwritten with the host machine's node_modules dir. This also means that if you run yarn add <package> on the host machine in development (which will update yarn.lock), you'll also need to run docker-compose exec nextjs yarn install --frozen-lockfile to update node_modules in the guest machine.

Git Precommit Hook

We use husky to run linting and formatting checks before each commit. Because our husky directory is in app, we configured husky with a custom directory.

One time setup:

  1. cd app
  2. yarn install
  3. yarn husky-prepare

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.