mikeyglitz/pantry-web

By mikeyglitz

Updated almost 3 years ago

Image
0

24

Pantry Web

This hosts the frontend application for the Pocket Pantry application. The web frontend is developed using React in combination with Next.js to provide a seamless Progressive Web Application (PWA) experience that users can use to install the page to their phone as they would an app.

Configuration

Configuration is provided through environment variables either through using .env files or by providing the environment through other means (such as the -e argument in docker run or through Kubernetes deployment environment)

VariableDescription
AUTH_URLURL of the authentication server (i.e. https://example.com/auth)
AUTH_REALM_NAMERealm name to authenticate against
AUTH_SECRETSecret value used to hash JWTs
AUTH_CLIENT_IDAuthentication client ID
AUTH_CLIENT_SECRETAuthentication client secret
GRAPHQL_ENDPOINTBase URL to the backend GraphQL API
DEFAULT_PAGE_SIZENumber - Default page size to page search results as

Development

The project configured to be run inside of a virtual environment through use of the Visual Studio Code devcontainers. Assuming a developer has Visual Studio Code installed with the Remote:DevContainers extension installed, when the developer opens the project in Visual Studio Code, they will be presented with the option to reopen the project inside of a development container.

Should the developer opt to open the project in a devcontainer, Visual Studio code will then go about installing all the requisite IDE extensions and development tools.

NPM tasks

Pocket Pantry is a web application built on top of Node.js. The project provides the following NPM scripts:

Script NameDescription
startStarts the production server. This script is only used when build has been run
buildBuilds the production server
lintLints the code for syntax correctness using ESlint
testLaunches the Jest launcher to continuously execute unit tests
test:ciLaunches the Jest launcher to run tests individually and terminate when tests are complete
devStarts the development server at port 3000

Docker Pull Command

docker pull mikeyglitz/pantry-web