Skip to content

Commit f95c9b4

Browse files
authored
Merge pull request #313 from reactioncommerce/295-machikoyasuda-readme
docs(295): update readme w/ Stripe, Segment docs, Production network name
2 parents 7d92d54 + 9a1e104 commit f95c9b4

File tree

5 files changed

+169
-72
lines changed

5 files changed

+169
-72
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
Type: **breaking|critical|major|minor**
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
1. Go to '...'
15+
2. Click on '....'
16+
3. Scroll down to '....'
17+
4. See error
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Screenshots**
23+
If applicable, add screenshots to help explain your problem.
24+
25+
**Desktop (please complete the following information):**
26+
- OS: [e.g. iOS]
27+
- Browser [e.g. chrome, safari]
28+
- Version [e.g. 22]
29+
30+
**Smartphone (please complete the following information):**
31+
- Device: [e.g. iPhone6]
32+
- OS: [e.g. iOS8.1]
33+
- Browser [e.g. stock browser, safari]
34+
- Version [e.g. 22]
35+
36+
**Additional context**
37+
Add any other context about the problem here.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new feature for this project
4+
5+
---
6+
7+
# Feature Name
8+
9+
### Summary description
10+
11+
### Rationale for why this feature is necessary
12+
13+
### Expected use cases
14+

CODE_OF_CONDUCT.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Reaction Commerce Code of Conduct
2+
3+
All Community Guidelines content is licensed under a [Creative Commons Attribution](https://creativecommons.org/licenses/by/3.0/) license.
4+
5+
Like the technical community as a whole, the Reaction team and community is made up of a mixture of professionals and volunteers from all over the world, working on every aspect of the mission - including mentorship, teaching, and connecting people.
6+
7+
Diversity is one of our huge strengths, but it can also lead to communication issues and unhappiness. To that end, we have a few ground rules that we ask people to adhere to. This code applies equally to founders, mentors, and those seeking help and guidance.
8+
9+
This isn’t an exhaustive list of things that you can’t do. Rather, take it in the spirit in which it’s intended - a guide to make it easier to enrich all of us and the broader communities in which we participate.
10+
11+
This code of conduct applies to all spaces managed by Reaction Commerce. This includes our [development chat room](https://gitter.im/reactioncommerce/reaction), [forums](https://forums.reactioncommerce.com), [blog](https://blog.reactioncommerce.com), mailing lists, [issue tracker](https://github.com/reactioncommerce/reaction/issues), [project boards](https://github.com/reactioncommerce/reaction/projects), Reaction events and meetups, and any other forums or service created by the core project team which the community uses for communication. In addition, violations of this code outside these spaces may affect a person's ability to participate within them.
12+
13+
If you believe someone is violating the code of conduct, we ask that you report it by emailing <mailto:[email protected]>. For more details, please see our [Reporting Guidelines](https://docs.reactioncommerce.com/reaction-docs/master/reporting-guide).
14+
15+
- **Be friendly and patient.**
16+
17+
- **Be welcoming.** We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, color, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.
18+
19+
- **Be considerate.** Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we're a world-wide community, so you might not be communicating in someone else's primary language.
20+
21+
- **Be respectful.** Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important to remember that a community where people feel uncomfortable or threatened is not a productive one. Members of the Reaction community should be respectful when dealing with other members as well as with people outside the Reaction community.
22+
23+
- **Be careful in the words that you choose.** We are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren't acceptable. This includes, but is not limited to:
24+
25+
- Violent threats or language directed against another person.
26+
- Discriminatory jokes and language.
27+
- Posting sexually explicit or violent material.
28+
- Posting (or threatening to post) other people's personally identifying information ("doxing").
29+
- Personal insults, especially those using racist or sexist terms.
30+
- Unwelcome sexual attention.
31+
- Advocating for, or encouraging, any of the above behavior.
32+
- Repeated harassment of others. In general, if someone asks you to stop, then stop.
33+
34+
- **When we disagree, try to understand why.** Disagreements, both social and technical, happen all the time and Reaction is no exception. It is important that we resolve disagreements and differing views constructively. Remember that we’re different. The strength of Reaction comes from its varied community, people from a wide range of backgrounds. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes.
35+
36+
## Questions?
37+
38+
If you have questions, please see the [FAQs](https://docs.reactioncommerce.com/reaction-docs/master/guideline-faqs). If that doesn't answer your questions, feel free to [contact us](mailto:[email protected]).

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Contributing
2+
3+
At Reaction Commerce, we're dedicated to the open source community. In fact, we've designed our entire platform and business to grow from the passion and creativity that an open source community ignites. We've already attracted a small, dedicated team of open source contributors, and there's always room for more.
4+
5+
If you'd like to join us, check out our detailed [Contributing Guide](https://docs.reactioncommerce.com/reaction-docs/master/contributing-to-reaction).
6+

README.md

Lines changed: 74 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,89 @@
11
# Reaction Storefront Next.js Starter Kit
22
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Freactioncommerce%2Freaction-next-starterkit.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Freactioncommerce%2Freaction-next-starterkit?ref=badge_shield)
33

4-
54
_**Note:** This project is a work in progress and should not be used in production at this time._
65

7-
Reference Storefront application for [Reaction Commerce](https://reactioncommerce.com/).
6+
Reference headless ecommerce storefront for [Reaction Commerce](https://reactioncommerce.com/) v 2.0.0.
7+
8+
## Features
9+
10+
- Headless ecommerce starter kit 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/)
11+
- [Reaction GraphQL API](https://github.com/reactioncommerce/reaction/tree/master/imports/plugins/core/graphql) integration
12+
- Server-side rendering
13+
- Payments with [Stripe](https://stripe.com/)
14+
- Analytics with [Segment](https://segment.com/)
15+
- Reusable, customizable, themeable ecommerce React components from the new [Reaction Component Library](https://github.com/reactioncommerce/reaction-component-library/) with [Styled Components](https://www.styled-components.com/)
16+
- Fully-configured test suite: Jest snapshot testing, Mocha integration testing
17+
- Written in ES6, configured with ES6
18+
- Containerized with Docker
819

920
## Getting Started
10-
_Follow steps as necessary. If you already have Reaction installed, you may be able to skip some of these steps._
1121

12-
0. Prerequesites
22+
1. Requirements:
23+
1324
- Install [Docker](https://docs.docker.com/install/) and [Docker Compose](https://docs.docker.com/compose/install/). Docker Compose is included when installing Docker on Mac and Windows, but will need to be installed separately on Linux.
25+
- Install [Node.js](https://nodejs.org/en/)
26+
- Install [Reaction Platform](https://github.com/reactioncommerce/reaction-platform)
27+
- Make sure you are not running any applications on ports `3000` and `4000`.
1428

15-
1. Clone the main [Reaction repo](https://github.com/reactioncommerce/reaction) and checkout the `release-1.15.0` branch
16-
```sh
17-
git clone [email protected]:reactioncommerce/reaction.git
18-
cd reaction
19-
git checkout release-1.15.0
29+
1. Follow the instructions at [Reaction Platform](https://github.com/reactioncommerce/reaction-platform) to run Reaction, Reaction Hydra and the starterkit with Reaction Platform.
2030

21-
# change directory to the parent of your reaction install
22-
cd ..
23-
```
31+
After the initial bootstrapping, you can use `make start` to start all the necessary containers:
2432

25-
2. Clone this repo
26-
```sh
27-
git clone [email protected]:reactioncommerce/reaction-next-starterkit.git
28-
```
33+
```sh
34+
make start
35+
```
36+
37+
1. Once the `make` process finishes, the Reaction Platform services will be accessible at the following URLs:
2938

30-
3. Create a local docker network
39+
| Application | URL |
40+
| ------------ | ----------------------- |
41+
| `starterkit` | localhost:4000 |
42+
| GraphQL API | localhost:3000/graphiql |
43+
| `reaction` | localhost:3000 |
3144

32-
You'll need to create a docker network for the GraphQL service and the Reaction Storefront to communicate
33-
```
34-
docker network create api.reaction.localhost
35-
```
36-
You can run `docker network ls` to verify the network has been created.
45+
Visit the storefront at `localhost:4000` and the GraphQL API playground at `localhost:3000/graphiql`.
3746

38-
4. Start Reaction's GraphQL server
39-
From your `reaction` directory run
40-
```
41-
docker-compose up -d --build
42-
```
43-
You'll need to run the full app at least once in order for step 5 to work. After this initial run, if you don't want to start the Reaction Meteor app, you can just run `docker-compose up -d devserver`
47+
1. To view the logs for the Starterkit, run: `docker-compose logs -f`
4448

45-
5. Generate a Meteor login token
49+
## Configuration
4650

47-
_This process will be eliminated once we've built out the GraphQL API for authentication_
48-
- Visit the Reaction Meteor shop [localhost:3000](http://localhost:3000)
49-
- Open devtools and copy the Meteor.loginToken from `localStorage`.
51+
### Set up Stripe
5052

51-
6. Setup the Storefront environment
53+
When running the storefront and Reaction for the first time, you will need to configure Stripe payment processing and shipping options to test a complete order checkout flow. After signing up for a Stripe API key, follow these steps:
5254

53-
Navigate to the `reaction-next-starterkit` directory and create a `.env` file.
54-
```sh
55-
cp .env.example .env
56-
```
57-
7. Start the storefront application in development mode using Docker Compose
58-
```
59-
docker-compose up -d --build
60-
```
55+
1. Add public Stripe API key (`STRIPE_PUBLIC_API_KEY`) to `.env`.
56+
2. Open the Reaction Classic app, at `http://localhost:3000`. Log in as an Admin user.
57+
3. Open **Payments**: Enable Stripe by checking the box. Add a Stripe secret key and public key.
58+
4. Open **Shipping**: Enable flat-rate shipping by checking the box. Enable at least one type of flat-rate shipping by clicking on the option in the table and checking the box.
6159

62-
8. Visit the storefront on `localhost:4000`
60+
### Set up Analytics event tracking
6361

62+
Read the docs for [setting up Segment or a custom analytics tracker](docs/tracking-events.md)
63+
64+
## Documentation
65+
- [Starter Kit full documentation](./docs)
66+
- [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](https://stoic-hodgkin-c0179e.netlify.com/)
67+
- [Reaction Docs: Using GraphQL](https://docs.reactioncommerce.com/docs/graphql-using)
68+
- [Reaction Docs: Testing with Jest](https://docs.reactioncommerce.com/docs/testing-reaction)
69+
- [Reaction Docs: Develping with Docker](https://docs.reactioncommerce.com/docs/installation-docker-development
70+
)
6471

6572
## Development
6673

67-
### Build and run in development mode with logs
74+
The Reaction Platform runs the Starterkit with Docker, so you will have to use Docker commands to view logs, run commands inside the container and more. To run commands specifically for the Starterkit, make sure to change directories into the `reaction-next-starterkit` directory within the `reaction-platform` repository:
75+
76+
```sh
77+
cd reaction-next-starterkit
6878
```
79+
80+
### Build and run in development mode with logs
81+
```sh
6982
docker-compose up -d && docker-compose logs -f
7083
```
7184

7285
### Running Commands inside the container
73-
```
86+
```sh
7487
docker-compose run --rm web [command]
7588
```
7689
Run any command inside a Docker container and then remove the container. Use this to run any tooling operations. Remember your project directory will be mounted and things will usually just work.
@@ -140,56 +153,45 @@ Sometimes we need to test [`reaction-component-library`](https://github.com/reac
140153

141154
## Cleanup Containers
142155
Stop, and retain containers:
143-
```
156+
```sh
144157
docker-compose stop
145158
```
146159

147160
Stop, and remove containers:
148-
```
161+
```sh
149162
docker-compose down
150163
```
151164

152165
Stop, and remove containers, volumes and built images:
153-
```
166+
```sh
154167
docker-compose down -v --rmi local
155168
```
156169

157-
## Production
158-
Running the command below will build the starterkit for production.
170+
## Building and running the production app locally
159171

160-
```
172+
Sometimes it is helpful during development to make a production build of the app and run that locally.
173+
174+
Run this command to build a Docker image with the production build of the app in it:
175+
176+
```sh
161177
docker build -t reaction-storefront --build-arg BUILD_ENV=production .
162178
```
163179

164-
To start the app in production mode execute:
180+
Then, to start the app on your machine, make sure the Reaction API container is already running and enter:
165181

166-
```
182+
```sh
167183
docker run -d --name storefront -p ${port}:4000 --env-file .env --network api.reaction.localhost reaction-storefront
168184
```
169185

170-
To stop the docker container after starting it with the above command
171-
```
172-
docker stop storefront
173-
```
174-
175-
_**NOTE:** Replace the `${port}` with the localhost port you'd like the application to run at. I'm partial to 4040_
176-
_**NOTE:** The above command is assuming ether the `devserver` or `reaction` is also running._
177-
178-
## Documentation
179-
See our [full documentation](./docs)
186+
_**NOTE:** Replace the `${port}` with the localhost port you'd like the application to run at._
180187
181-
## Features
182-
- [Docker](https://docs.docker.com)
183-
- [React](https://reactjs.org/)
184-
- [Apollo](https://www.apollographql.com/docs/react/)
185-
- [MobX](https://mobx.js.org/getting-started.html)
186-
- [nextjs](https://github.com/zeit/next.js/)
187-
- [Material UI](https://material-ui.com/)
188+
_**NOTE:** This is not the way to run the app in actual production deployment. This is only for running the production build locally for development, demo or trial purposes._
188189
189-
## Reference links for development
190-
### CSS in JS
191-
- [Responsive Breakpoints](https://material-ui.com/layout/css-in-js/#responsive-breakpoints)
190+
To stop the Docker container after starting it with the above command, use:
192191
192+
```sh
193+
docker stop storefront
194+
```
193195
194196
## License
195197
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Freactioncommerce%2Freaction-next-starterkit.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Freactioncommerce%2Freaction-next-starterkit?ref=badge_large)

0 commit comments

Comments
 (0)