Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release v2.1.0 #557

Merged
merged 15 commits into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
# v2.1.0

Example Storefront v2.1.0 is a minor update to keep this project in sync with [Reaction v2.1.0](https://github.com/reactioncommerce/reaction) and [reaction-hydra v2.1.0](https://github.com/reactioncommerce/reaction-hydra)

## Docs

docs(readme): component library naming [#555](https://github.com/reactioncommerce/example-storefront/pull/555)
docs: Adjust graphiql URLs links and docs [#551](https://github.com/reactioncommerce/example-storefront/pull/551)

## Chores

chore: Add 302 redirects to env.EXTERNAL_GRAPHQL_URL [#550](https://github.com/reactioncommerce/example-storefront/pull/550)
chore: update changelog + version match [#548](https://github.com/reactioncommerce/example-storefront/pull/548)

## Breaking Changes

None

# v2.0.0

Reaction v2.0.0—an API-first, real-time commerce engine built using Node.js, React, and GraphQL. It’s the second major release of our open source commerce software.

This release is coordinated with [Reaction Platform](https://github.com/reactioncommerce/reaction-platform) and is designed to work with the [Reaction](https://github.com/reactioncommerce/reaction) and [reaction-hydra](https://github.com/reactioncommerce/reaction-hydra).

Reaction v2.0.0 is built as a truly headless commerce platform that decouples the Reaction backend services from the frontend. We’ve decoupled the storefront application from the API. Reaction platform now consists of this [Example Storefront](https://github.com/reactioncommerce/example-storefront), which integrates with the Reaction application via GraphQL to provide a customer-facing storefront. The API is provided by the [Reaction](https://github.com/reactioncommerce/reaction) project, which is now primarily our GraphQL API. The legacy integrated Meteor storefront is no longer part of the Reaction project.
Reaction v2.0.0 is built as a truly headless commerce platform that decouples the Reaction backend services from the frontend. We’ve decoupled the storefront application from the API. Reaction platform now consists of this [Example Storefront](https://github.com/reactioncommerce/example-storefront), which connects with the Reaction application via GraphQL to provide a customer-facing storefront. The API is provided by the [Reaction](https://github.com/reactioncommerce/reaction) project, which is now primarily our GraphQL API. The legacy integrated Meteor storefront is no longer part of the Reaction project.

### Notable changes
This Example Storefront is brand new for the 2.0 version of Reaction. Check out [previous release notes](https://github.com/reactioncommerce/example-storefront/releases) from this project for details and associated issues and PRs.
Expand Down
33 changes: 22 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,34 @@ Check out the full list of Reaction [features](https://www.reactioncommerce.com/

This example storefront is built with [Next.js](https://nextjs.org/), [React](https://reactjs.org/), [MobX](https://mobx.js.org/getting-started.html), [GraphQL](https://graphql.org/), and [Apollo Client](https://www.apollographql.com/docs/react/)

We've integrated payments with [Stripe](https://stripe.com/) and analytics with [Segment](https://segment.com/)

This project is written in ES6, containerized with Docker, and there's a fully-configured test suite using Jest snapshot testing and Mocha integration testing
- Headless ecommerce example storefront built with [Next.js](https://nextjs.org/), [React](https://reactjs.org/), [MobX](https://mobx.js.org/getting-started.html), [GraphQL](https://graphql.org/), [Apollo Client](https://www.apollographql.com/docs/react/)
- [Reaction GraphQL API](https://github.com/reactioncommerce/reaction/tree/master/imports/plugins/core/graphql) integration
- Server-side rendering
- Payments with [Stripe](https://stripe.com/)
- Analytics with [Segment](https://segment.com/) or any other provider
- Reusable, customizable, themeable ecommerce React components from the [Example Storefront Component Library](https://github.com/reactioncommerce/reaction-component-library/) with [Styled Components](https://www.styled-components.com/)
- Fully-configured test suite: Jest snapshot testing, Mocha integration testing
- Written in ES6, configured with ES6
- Containerized with Docker

## Getting Started

Follow the [Reaction Platform docs](https://docs.reactioncommerce.com/docs/installation-reaction-platform) to install and run all the services necessary to run the storefront:

| Directory: Service | URL |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------ |
| [`reaction`](https://github.com/reactioncommerce/reaction): GraphQL API | [localhost:3000/graphql-beta](localhost:3000/graphql-beta) |
| [`reaction`](https://github.com/reactioncommerce/reaction): GraphQL API playground | [localhost:3000/graphiql](localhost:3000/graphiql) |
| [`reaction`](https://github.com/reactioncommerce/reaction): Operator UI | [localhost:3000](localhost:3000) |
| [`reaction`](https://github.com/reactioncommerce/reaction): GraphQL API | [localhost:3000/graphql-beta](localhost:3000/graphql-beta) |
| [`reaction`](https://github.com/reactioncommerce/reaction): GraphiQL developer tool | [localhost:3000/graphql-beta](localhost:3000/graphql-beta) |
| [`reaction`](https://github.com/reactioncommerce/reaction): Operator UI | [localhost:3000](localhost:3000) |
| [`reaction`](https://github.com/reactioncommerce/reaction): MongoDB | [localhost:27017](localhost:27017) |
| [`reaction-hydra`](https://github.com/reactioncommerce/reaction-hydra): Authentication | [localhost:4444](localhost:4444) |
| [`reaction-hydra`](https://github.com/reactioncommerce/reaction-hydra): Authentication | [localhost:4444](localhost:4444) |
| [`example-storefront`](https://github.com/reactioncommerce/example-storefront): Storefront | [localhost:4000](localhost:4000) |

**Note**: The storefront has redirects so if you open any of the following URLs, you'll be redirected to the GraphiQL developer tool:
- [localhost:4000/graphql]()
- [localhost:4000/graphql-beta]()
- [localhost:4000/graphiql]()

## Configuration

### Set up Stripe
Expand All @@ -45,7 +56,7 @@ Read the docs for [setting up Segment or a custom analytics tracker](docs/tracki

## Documentation
- [Example Storefront full documentation](./docs)
- [Reaction Component Library repository](https://github.com/reactioncommerce/reaction-component-library), [documentation](https://github.com/reactioncommerce/reaction-component-library/tree/master/docs), and [component documentation](http://designsystem.reactioncommerce.com/)
- [Example Storefront Component Library repository](https://github.com/reactioncommerce/reaction-component-library), [documentation](https://github.com/reactioncommerce/reaction-component-library/tree/master/docs), and [component documentation](http://designsystem.reactioncommerce.com/)
- [Reaction Docs: Using GraphQL](https://docs.reactioncommerce.com/docs/graphql-using)
- [Reaction Docs: Testing with Jest](https://docs.reactioncommerce.com/docs/testing-reaction)
- [Reaction Docs: Developing with Docker](https://docs.reactioncommerce.com/docs/installation-docker-development
Expand Down Expand Up @@ -131,9 +142,9 @@ docker-compose down --rmi local
docker-compose up -d --build
```

### Testing `reaction-component-library` components in the storefront
### Testing component library in the storefront

Sometimes we need to test [`reaction-component-library`](https://github.com/reactioncommerce/reaction-component-library) components in the context of the storefront. Unfortunately, there isn't an easy wasy to do this within our Docker containers, so we need to run the `storefront` outside of docker.
Sometimes we need to test the [Example Storefront Component Library](https://github.com/reactioncommerce/reaction-component-library) components in the context of the storefront. Unfortunately, there isn't an easy wasy to do this within our Docker containers, so we need to run the `storefront` outside of docker.

1. `cd` to your local [`reaction-component-library`](https://github.com/reactioncommerce/reaction-component-library) repo.
1. Git checkout the proper branch that you want to link
Expand Down Expand Up @@ -248,7 +259,7 @@ If you forget to sign your commits, the DCO bot will remind you and give you det


## License
Copyright 2018 Reaction Commerce
Copyright 2019 Reaction Commerce

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "example-storefront",
"version": "2.0.0",
"version": "2.1.0",
"description": "The Example Storefront serves as a reference for implementing a web based storefront using the Reaction Commerce GraphQL API.",
"main": "index.js",
"keywords": [],
Expand Down
5 changes: 5 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ app

configureAuthForServer(server);

// add graphiql redirects to EXTERNAL_GRAPHQL_URL
server.get(["/graphiql", "/graphql-beta", "/graphql-alpha", "/graphql"], (req, res) => {
res.redirect(301, config.EXTERNAL_GRAPHQL_URL);
});

// apply to routes starting with "/sitemap" and ending with ".xml"
server.use(/^\/sitemap.*\.xml$/, sitemapRoutesHandler);

Expand Down