Home
Softono
r

reactioncommerce

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
3

Software by reactioncommerce

reaction
Open Source

reaction

<h1 align="center"> Mailchimp Open Commerce (formerly Reaction Commerce) </h1> <h4 align="center"> <a href="https://mailchimp.com/developer/open-commerce/">Open Commerce Website</a> | <a href="https://twitter.com/getreaction">Twitter</a> | <a href="https://mailchimp.com/developer/open-commerce/">Documentation</a> | <a href="https://discord.gg/Bwm63tBcQY">Discord</a> | <a href="https://github.com/reactioncommerce/reaction/discussions">Discussions</a> </h4> [Mailchimp Open Commerce](https://mailchimp.com/developer/open-commerce/) is an API-first, headless commerce platform built using Node.js, MongoDB, and GraphQL. It plays nicely with npm, Docker and Kubernetes. ![MOC Admin](https://user-images.githubusercontent.com/20409254/61161477-bb033c80-a4b8-11e9-9c5e-4f4f6a68b8d0.png) # Features <table> <tr><td><strong>Fast</strong></td><td>Returns data in split seconds, and faster queries mean faster web pages</td></tr> <tr><td><strong>Proven</strong></td><td>Open Commerce fuels sites doing 10's of thousands of orders per day with 100's of thousands of products</td></tr> <tr><td><strong>Composable</strong></td><td>A flexible plugin system allows you to pick and choose which integrations work best for you</td></tr> <tr><td><strong>Multi-tenant</strong></td><td>Host multiple shops in the same installation</td></tr> <tr><td><strong>Scalable</strong></td><td>Start out with a single server and scale up to hundreds</td></tr> <tr><td><strong>Flexible Products</strong></td><td>Allows Products, with options and variants to fit a wide variety of needs</td></tr> <tr><td><strong>Inventory</strong></td><td>Track inventory, allow or disallow backorders and more</td></tr> <tr><td><strong>Shipping</strong></td><td>Integrate with a shipping rate provider or build your own custom table</td></tr> <tr><td><strong>Taxes</strong></td><td>Integrate with a tax rate provider or build your own custom tax table</td></tr> <tr><td><strong>Fulfillment</strong></td><td>Flexible fulfillment system allows you create your own fulfillment methods</td></tr> <tr><td><strong>Order Tracking</strong></td><td>View and manage your orders in the included admin system</td></tr> <tr><td><strong>Emails</strong></td><td>Customizable templates for Order confirmations and more</td></tr> <tr><td><strong>Open</strong></td><td>Fully open source. Never be locked in again</td></tr> </table> # Getting started To start working with your own project built on Mailchimp Open Commerce you can start by using our new CLI. The CLI is the quickest and easiest way to develop on Open Commerce. It allows you to create and work with API, Admin, and Storefront projects all via the command line. ## What you need - We recommend installing [nvm](https://github.com/nvm-sh/nvm) - [14.18.1 ≤ Node version < 16](https://nodejs.org/ja/blog/release/v14.18.1/) - [Git](https://git-scm.com/) - [Docker](https://www.docker.com/get-started/) - [Docker Compose](https://docs.docker.com/compose/) In addition, you need to have your system setup for [SSH authentication with GitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh) ## Install the CLI First install the cli by running: ``` npm install -g reaction-cli ``` You can test to see if it has worked here by running: ``` reaction help ``` ## Creating a project You can create your Open Commerce project by running: ``` reaction create-project api <your-project-name> ``` This will create an Open Commerce project in the directory <your-project-name>. Once this is complete, navigate to the project directory: ``` cd <your-project-name> ``` Install the project dependencies: ``` npm install ``` Finally, start the server in development mode: ``` reaction develop api ``` Note: Optionally, from within the project-directory you may issue the above command without mentioning the project type and the CLI would check your package.json for the "projectType" and pick it up from there. This expects that the project itself was built using the latest version of the CLI as explained in the above steps. Example, instead of the above command, you may skip mentioning 'api' and just use: ``` reaction develop ``` This will start the Open Commerce GraphQL server and Mongo Server. Press Ctrl+C to stop. - A sample custom plugin has been installed, and you should see its output in the logs. (Your Sample Plugin) - To add a new plugin based on our plugin template run: ``` reaction create-plugin api <your-plugin-name> ``` Validate whether the plugin was created in the `custom-packages` ``` cd custom-packages ``` ``` cd <your-plugin-name> ``` ``` npm install ``` You now need to change back up to the root: ``` cd ../../ ``` now you can run: ``` reaction develop ``` This plugin will now be loaded the next time you start Open Commerce. ### Congratulations!! You're ready to start developing with Open Commerce See the [Complete CLI instructions](https://github.com/reactioncommerce/cli) for how to create your local storefront and admin. Go to the complete [installation instructions](https://mailchimp.com/developer/open-commerce/guides/quick-start/#access-the-dashboard-playground-and-storefront) to see how to set up your store # API development If you are working on core plugins (not developing plugins for your own installation) you should follow these instructions ## What you need - [pnpm](https://pnpm.io/) - [Docker](https://www.docker.com/get-started/) - [Docker Compose](https://docs.docker.com/compose/) ## Install PNPM ```bash npm i -g [email protected] ``` ## Clone and Start the source ```bash git clone https://github.com/reactioncommerce/reaction.git cd reaction pnpm install cp apps/reaction/.env.example apps/reaction/.env ``` Start dev-server with mongo on local: ```bash ## you must change MONGO_URL in the .env to mongodb://localhost:27017/reaction before start pnpm run start:dev ``` Start dev-server with mongodb on docker ```bash docker-compose up -d pnpm run start:dev ``` ## Development Flow 1. Make some changes in one or more packages. 2. [Add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) in that same PR. 3. Repeat the process of making changes and adding changesets. 4. Create PR ## How to release 1. Run `release` action to create `Version PR`. This PR will remove all changeset files, bump up packages versions, update CHANGELOG files. 2. Merge `Version PR` into trunk, CircleCI will publish all the packages into npm. ## Prerelease flows 1. All PRs will be merged into `prerelease` branch before triggering `PRERELEASE` action. 2. Before merging PRs into `prerelease` branch, please make sure that all the changesets are added. 3. Manually trigger `PRERELEASE` action to create `Version Packages (next)` PR. After merged, the changeset/action will bump up packages versions as `{next-version}-next.{number}`, update CHANGELOG files. 4. Merge `Version Packages (next)` PR into `prerelease` branch, action will publish all the packages into npm. # Get involved ## Contribute :star: If you like what you see, star us on GitHub. Find a bug, a typo, or something that’s not documented well? We’d love for you to [open an issue](https://github.com/reactioncommerce/reaction/issues) telling us what we can improve! This project uses [commitlint](https://commitlint.js.org/), please use their [commit message format](https://www.conventionalcommits.org/en/v1.0.0/#summary). We love your pull requests! Check out our [`Good First Issue`](https://github.com/reactioncommerce/reaction/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) and [`Help Wanted`](https://github.com/reactioncommerce/reaction/issues?q=label%3A%22help+wanted%22) tags for good issues to tackle. Check out our [contributors guide](CONTRIBUTING.md) for more information ### License Reaction is [GNU GPLv3 Licensed](./LICENSE.md)

E-commerce Platforms Marketplace & Multi-vendor
12.4K Github Stars
example-storefront
Open Source

example-storefront

# Example Storefront [Mailchimp Open Commerce](https://mailchimp.com/developer/open-commerce/) is an API-first, headless commerce platform built using Node.js, React, and GraphQL. It plays nicely with npm, Docker and Kubernetes. This Example Storefront is to serve as a reference on how to implement a web based storefront using the Reaction Commerce GraphQL API. You can fork this project as a jumping off point or create your own custom experience using your preferred client-side technology. While we believe our example storefront is full-featured enough to use in production, it may be missing features your shop requires at this time. ## Features Mailchimp Open Commerce comes with a robust set of core commerce capabilities right out of the box. And since anything in our codebase can be extended, overwritten, or installed as a package, you may also customize anything on our platform. This example storefront is built with [Next.js](https://nextjs.org/), [React](https://reactjs.org/), [GraphQL](https://graphql.org/), and [Apollo Client](https://www.apollographql.com/docs/react/) - Headless ecommerce example storefront built with [Next.js](https://nextjs.org/), [React](https://reactjs.org/), [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/) with Strong Customer Authentication included. - 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/) - Written in ES6, configured with ES6 - Containerized with Docker ## Getting Started Follow the [Quick Start Guide](https://mailchimp.com/developer/open-commerce/guides/quick-start/) 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](localhost:3000/graphql) || | [`reaction-admin`](https://github.com/reactioncommerce/reaction-admin): Reaction Admin | [localhost:4080](localhost:4080) | | [`reaction`](https://github.com/reactioncommerce/reaction): MongoDB | [localhost:27017](localhost:27017) | | [`example-storefront`](https://github.com/reactioncommerce/example-storefront): Storefront | [localhost:4000](localhost:4000) | **Note**: The storefront has redirects so that if you open [http://localhost:4000/graphql](http://localhost:4000/graphql), you'll be redirected to the GraphQL Playground. ## Configuration ### Set up Stripe 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: 1. Add public Stripe API key (`STRIPE_PUBLIC_API_KEY`) to `.env`. 2. Open the Reaction Admin app, at `http://localhost:4080`. Log in as an Admin user. 3. Open **Payments**: Enable Stripe by checking the box. Add a Stripe secret key and public key. 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. ### Set up Analytics event tracking Read the docs for [setting up Segment or a custom analytics tracker](docs/tracking-events.md) ## Documentation - [Example Storefront full documentation](./docs) - [Example Storefront Component Library repository](https://github.com/reactioncommerce/reaction-component-library), [documentation](https://github.com/reactioncommerce/reaction-component-library/tree/master/docs) - [Reaction Docs: Testing with Jest](https://mailchimp.com/developer/open-commerce/docs/testing-requirements/) ## Development The Reaction Platform runs the storefront 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 storefront, make sure to change directories into the `example-storefront` directory within the `reaction-platform` repository: ```sh cd example-storefront ``` ### Build and run in development mode with logs Create a symbolic link to use the development Docker image: ``` ln -s docker-compose.dev.yml docker-compose.override.yml ``` If running for the first time or environment variables in `.env.example` have changed execute the command below to update environment variables. ``` ./bin/setup ``` Start the storefront by executing: ```sh docker-compose up -d && docker-compose logs -f ``` ### Run in development against a production API Change the `INTERNAL_GRAPHQL_URL` in `.env` to the production API URL. The URL should end in `/graphql`, like: `https://my-website.com/graphql`. Save the `.env` file and restart the application with: ```sh docker-compose run --rm --service-ports web yarn start ``` ### Run commands in container ```sh docker-compose run --rm web [command] ``` 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. See Yarn section below for more examples. ### Run tests in container Run tests locally ```sh docker-compose run --rm web yarn test ``` Run tests locally without cache (this can be helpful if changes aren't showing up) ```sh docker-compose run --rm web yarn test --no-cache ``` To run Snyk security tests (this will run tests in the same way as CI) ```sh docker-compose run --rm web sh -c "cp package.json ../ && cp .snyk ../ && cd .. && snyk auth && snyk test" ``` To run ESLint ```sh docker-compose run --rm web eslint src ``` ### Debugging the server with Chrome DevTools You can use the Google Chrome DevTools to debug the code running in the Node.js application server while it's running inside Docker. - run `docker-compose run --rm --publish 9229:9229 --publish 4000:4000 -e NODE_ENV=development web node --inspect=0.0.0.0:9229 ./src/server.js` - Open Chrome and browse to `chrome://inspect`. Find the process under **Remote Target** and click **inspect**. ### Yarn Commands Yarn & NPM should run inside the Docker container. We've taken steps to ensure that the node_modules are placed into a cacheable location. If you run Yarn locally, the node_modules are written directly to the project directory and take precedence over those from the Docker build. **Yarn Add** ``` docker-compose run --rm web yarn add --dev [package] ``` **Yarn Install** ⚠️ Always rebuild the image and start a new container after modifying yarn.lock or Dockerfile! ``` docker-compose run --rm web yarn install docker-compose down --rmi local docker-compose up -d --build ``` ### Testing component library in the storefront 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 1. `cd` into the `package` folder of this repo, and run the command `yarn install` followed by `yarn build` 1. After the build is done, `cd` into the new `dist` folder it just built and run `yarn link` to allow the library to be installed into the storefront. This will link `@reactioncommerce/components` 1. Inside the `example-storefront` repo, temporarily rename your `.yarnrc` file to anything else (i.e. `.yarnrc-temp`) 1. Run `yarn install` and then the command `yarn link "@reactioncommerce/components"` to set the local version as an override of the published npm version 1. Inside your `.env` file, change `INTERNAL_GRAPHQL_URL` to equal `http://localhost:3000/graphql`, the same as the `EXTERNAL_GRAPHQL_URL` 1. Start the storefront locally by running the command `export $(cat .env | xargs) && yarn dev` 1. Your storefront should now be running at `localhost:4000` - If you see errors about not being able to find peer dependency packages, that seems to be an issues with yarn linking. You can just temporarily `yarn add` each of those packages in the component library `package/dist` folder. (This folder is gitignored anyway.) 1. After your changes are tested, shut down the storefront by running the command `CTRL+C` 1. Run `yarn unlink "@reactioncommerce/components"` in the storefront repo folder 1. `cd` to the `package/dist` folder of the `reaction-component-library` repo. Run the command `yarn unlink` to unlink the local version of the component library 1. Undo the renaming of your `.yarnrc` file 1. Undo the URL change inside your `.env` file ## Clean up containers Stop, and retain containers: ```sh docker-compose stop ``` Stop, and remove containers: ```sh docker-compose down ``` Stop, and remove containers, volumes and built images: ```sh docker-compose down -v --rmi local ``` ## Build and run the production app locally Sometimes it is helpful during development to make a production build of the app and run that locally. Run this command to build a Docker image with the production build of the app in it: ```sh docker build --network=host -t reactioncommerce/example-storefront:X.X.X . ``` Where X.X.X indicates the tag version you want to use, i.e. `3.1.0` Then, to start the app on your machine, make sure the Reaction API container is already running and enter: ```sh docker run -it --name storefront -p 4000:4000 --env-file .env.prod --network reaction.localhost reactioncommerce/example-storefront:X.X.X ``` _**NOTE:** You can replace the number before the colon in `4000:4000` with a different localhost port you'd like the application to run at._ _**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._ To stop the Docker container after starting it with the above command, use: ```sh docker stop reaction-storefront ``` ## Contribute Find a bug, a typo, or something that’s not documented well? We’d love for you to [open an issue](https://github.com/reactioncommerce/example-storefront/issues) telling us what we can improve! This project uses [semantic-release](https://semantic-release.gitbook.io/semantic-release/), please use their [commit message format.](https://semantic-release.gitbook.io/semantic-release/#commit-message-format). Want to request a feature? Use our [Reaction Feature Requests repository](https://github.com/reactioncommerce/reaction-feature-requests) to file a request. We love your pull requests! Check our our [`Good First Issue`](https://github.com/reactioncommerce/example-storefront/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) and [`Help Wanted`](https://github.com/reactioncommerce/example-storefront/issues?q=label%3A%22help+wanted%22) tags for good issues to tackle. ### Pull Request guidelines Pull requests should pass all automated tests, style, and security checks. #### Automated Tests Your code should pass all acceptance tests and unit tests. Run ```sh docker-compose run --rm web yarn test ``` to run the test suites locally. If you're adding functionality to Reaction, you should add tests for the added functionality. You can run the tests locally without cache if necessary by passing the `--no-cache` flag. This can be helpful if changes aren't showing up. ```sh docker-compose run --rm web yarn test --no-cache ``` To update a failing snapshot (if you've made changes to a component) ```sh docker-compose run --rm web yarn test -u ``` #### Eslint We require that all code contributed to Reaction follows [Reaction's ESLint rules](https://github.com/reactioncommerce/reaction-eslint-config). You can run ``` docker-compose run --rm web eslint src ``` to run ESLint against your code locally. ### Developer Certificate of Origin We use the [Developer Certificate of Origin (DCO)](https://developercertificate.org/) in lieu of a Contributor License Agreement for all contributions to Reaction Commerce open source projects. We request that contributors agree to the terms of the DCO and indicate that agreement by signing all commits made to Reaction Commerce projects by adding a line with your name and email address to every Git commit message contributed: ``` Signed-off-by: Jane Doe <[email protected]> ``` You can sign your commit automatically with Git by using `git commit -s` if you have your `user.name` and `user.email` set as part of your Git configuration. We ask that you use your real name (please no anonymous contributions or pseudonyms). By signing your commit you are certifying that you have the right have the right to submit it under the open source license used by that particular Reaction Commerce project. You must use your real name (no pseudonyms or anonymous contributions are allowed.) We use the [Probot DCO GitHub app](https://github.com/apps/dco) to check for DCO signoffs of every commit. If you forget to sign your commits, the DCO bot will remind you and give you detailed instructions for how to amend your commits to add a signature. ## License 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. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Freactioncommerce%2Fexample-storefront.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Freactioncommerce%2Fexample-storefront?ref=badge_large)

Frontend Templates E-commerce Platforms
615 Github Stars
reaction-component-library
Open Source

reaction-component-library

# Reaction Storefront Component Library [![npm (scoped)](https://img.shields.io/npm/v/@reactioncommerce/components.svg)](https://www.npmjs.com/package/@reactioncommerce/components) [![CircleCI](https://circleci.com/gh/reactioncommerce/reaction-component-library.svg?style=svg)](https://circleci.com/gh/reactioncommerce/reaction-component-library) This is a single project with a package of React components for the [Example Storefront](https://github.com/reactioncommerce/example-storefront/): - [`@reactioncommerce/components`](https://www.npmjs.com/package/@reactioncommerce/components): See the [package.json](https://github.com/reactioncommerce/reaction-component-library/blob/master/package/package.json) in [`/package`](https://github.com/reactioncommerce/reaction-component-library/tree/master/package) folder. - [Reaction Storefront Component Library](https://designsystem.reactioncommerce.com/): See the root [package.json](https://github.com/reactioncommerce/reaction-component-library/blob/master/package.json). We use the [React Styleguidist](https://react-styleguidist.js.org/) package to run and build the documentation website, and running the style guide locally doubles as an interactive playground for developing and testing the components. ## Use the React components in your storefront Refer to the [Reaction Storefront Component Library docs](https://designsystem.reactioncommerce.com/#!/Using%20Components) ## Contribute to this project Refer to the [contributor docs](./docs) ## License 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. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

JavaScript Libraries & Components E-commerce Platforms
96 Github Stars