Overview:
The content provides instructions and guidelines for setting up and running a web application. It covers installation steps, running the application, technology stack, code organization, and key directories.
Features:
- Node.js: Powers the server and is pinned to the latest LTS release.
- Express: A lightweight HTTP server used for hosting the GraphQL API.
- GraphQL: An alternative to REST APIs, supporting a demand-driven architecture.
- Jest: Used for unit testing.
- Webpack: Builds the application for different deployment targets.
- Apollo Link State: Used for client state management.
- Nightmare.js: Used for acceptance testing.
- React Storybook: Provides component documentation and style guides.
- JSVerify: Used for property-based testing.
Installation:
- Install Node.js 10 LTS and yarn. (Recommend nvm and brew install yarn –without-node on Mac)
- Install Docker.app for running the database and other services.
- Symlink
.env.exampleto.envto set up the environment for running from Docker. Modify if needed. - Start Postgres by running
docker-compose up. - Run
yarnto install dependencies. - Run
yarn db:createto create development and test databases. - Run
yarn buildto build the application and supporting scripts.
Running the App:
- Run
yarn buildto create generated types and scripts. - Run
yarn db:migrate:latestto migrate development and test databases. - Optionally, run
yarn db:migrate-and-seedto add test data to the dev database. - Run
yarn devto start the hot-reloading dev server on port 3000. - Visit localhost:9001 to see the interactive style guide and component tests by running
yarn dev:storybook. - Run unit tests with
yarn test:unitoryarn test:unit --watchfor the interactive jest-based test runner.
Summary:
The content provides a step-by-step guide for setting up and running a web application. It covers installation instructions, running the app, technology stack, code organization, and key directories. The application uses technologies like Node.js, Express, GraphQL, Jest, Webpack, Apollo Link State, Nightmare.js, and React Storybook. The code organization encourages viewing the repository as one application, with different entry points for the client and server.