Skip to content

Commit f854264

Browse files
Removed content and linked to dev center
1 parent 7c21840 commit f854264

1 file changed

Lines changed: 4 additions & 150 deletions

File tree

README.md

Lines changed: 4 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -18,155 +18,9 @@ You will need the following:
1818
* Node.js 14.x
1919

2020
## Getting started
21-
1. Start by forking the point-of-sale-foundation repository.
22-
2. Navigate to the root directory of your project and install npm packages.
2321

24-
```shell
25-
npm install
26-
```
27-
## BigCommerce setup
22+
Head to the [POS Foundation](/api-docs/partner/pos-solutions/foundation-guide) guide to begin!
2823

29-
1. [Create BigCommerce store](https://developer.bigcommerce.com/docs/ZG9jOjM4MzMyNTE-create-a-sandbox-store?source=subscription-foundation): go to [https://www.bigcommerce.com/essentials/](https://www.bigcommerce.com/essentials/?source=pos-foundation) and signup for a free trial if you don't have one.
30-
2. The Bigcommerce store you are connected to must have "Pickup in Store" as a shipping option for orders to be created on the POS. Go to "Settings -> Shipping" in your admin to turn it on.
31-
32-
3. Create BigCommerce v2/v3 API credentials. Go to Advanced Settings > API Accounts and create and API Account with these scopes:
33-
34-
```
35-
Customers: MODIFY
36-
Information & settings: READ-ONLY
37-
Orders: MODIFY
38-
Create payments: CREATE
39-
Get payment methods: READ-ONLY
40-
Products: READ-ONLY
41-
Carts: MODIFY
42-
Checkouts: MODIFY
43-
Channel Settings: MODIFY
44-
Storefront API tokens: MANAGE
45-
```
46-
4. Copy the `ACCESS_TOKEN`, `CLIENT ID`, and `CLIENT SECRET` credentials. In a later step, you will need these credentials to update `BC_APP_CLIENT_ID`, `BC_APP_SECRET`, and `BC_AUTH_TOKEN` environment variables in the .env file.
47-
48-
## Stripe setup
49-
50-
1. Go to your Stripe dashboard: https://dashboard.stripe.com/test/developers
51-
2. Copy the Stripe secret key. In a later step, you will use the secret key to update the environment variable `STRIPE_SECRET_KEY` in the .env file.
52-
3. Go to "More > Terminal" in the dashboard. Press "Get Started" when asked to activate the Terminal section.
53-
4. Add a location, then click on the location row to manage details.
54-
5. Add a new reader to the location.
55-
56-
## Set up database
57-
58-
This app works with MongoDB. The `provider` setting in the `/prisma/schema.prisma` should be set to `mongodb`.
59-
60-
![POS-provider-mongodb](https://storage.googleapis.com/bigcommerce-production-dev-center/images/POS-provider-mongodb.png)
61-
62-
We highly recommend using MongoDB, but if you would like to use another type of database, you will need to update the configuration to work with the database of your choice. View the available database options here: https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-schema/data-sources/
63-
64-
Mongo Cloud (https://cloud.mongodb.com) generates the `DATABASE_URL` as shown in the setup instructions below. In a later step, you will need the `DATABASE_URL` to update the environment variable in .env file.
65-
66-
Click on the arrow below and follow the Mongo Cloud setup instructions.
67-
68-
<details>
69-
70-
<summary>Guide on setting up Mongo Cloud</summary>
71-
72-
1. Click [here](https://account.mongodb.com/) and log in. If you don't have an account, you can click [SignUp](https://account.mongodb.com/account/register).
73-
74-
2. On the left-hand sidebar, click "Database Access" > "ADD NEW DATABASE USER".
75-
76-
a. Fill in your username and password, and leave all remaining fields as is.
77-
78-
b. Click "Add User".
79-
80-
81-
3. On the left-hand sidebar, click "Network Access" > "ADD IP ADDRESS".
82-
83-
a. Enter an IP address in the "Access List Entry" field. We recommend using 0.0.0.0/0 so you can connect from anywhere.
84-
85-
![pos-ip-address](https://storage.googleapis.com/bigcommerce-production-dev-center/images/POS-IP-address.png)
86-
87-
b. Click "Confirm".
88-
89-
4. On the left-hand sidebar, click "Database".
90-
91-
a. Click the "Connect" button in your running cluster.
92-
93-
b. Click "Connect your application" in the popup modal.
94-
95-
c. Copy the connection string and replace \<password> with the password and \<username> with the username created in step 2a. Also add "myFirstDatabase" to the connection string as shown below.
96-
97-
```shell
98-
mongodb+srv://<username>:<password>@cluster0.jfohhb8.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
99-
```
100-
101-
_Note: This MongoDB connection string is what you should use to update the `DATABASE_URL` variable in the .env file._
102-
103-
![pos-connection-string](https://storage.googleapis.com/bigcommerce-production-dev-center/images/POS-connection-string.png)
104-
105-
</details>
106-
107-
## Create local environment file
108-
109-
1. Create a `.env` file in the root directory of your project.
110-
2. Copy the content of `.env-sample` to `.env`.
111-
```bash
112-
cp .env.sample .env
113-
```
114-
At a minimum, the following .env variables need to be updated for the app to sucessfully run.
115-
116-
- `DATABASE_URL`
117-
- Follow the [Set up Database](#set-up-database) instructions to get this.
118-
- `BC_STORE_HASH`, `BC_AUTH_TOKEN`, `BC_CHANNEL_ID`, `BC_GQL_URL, `BC_APP_CLIENT_ID`, and `BC_APP_SECRET`
119-
- Follow the [BigCommerce setup](#bigcommerce-setup) instructions to get these.
120-
- `STRIPE_SECRET_KEY`
121-
- Follow the [Stripe setup](#stripe-setup) instructions to get these.
122-
123-
124-
## Create and seed database
125-
126-
1. Once you set up your Mongo Cloud account, create the database and seed it with data by doing the following:
127-
128-
```
129-
$ npx prisma db push
130-
131-
$ npm run seed
132-
```
133-
134-
2. Generate a new prisma client using your database provider settings.
135-
136-
```
137-
$ npx prisma generate
138-
```
139-
140-
_Note: `npx prisma generate` is what creates the DB tables and initial client. If you miss this step, you'll see errors about prisma missing._
141-
142-
3. Now you'll be able to access this database locally via a visual editor and verify you have created the table correctly.
143-
144-
```
145-
$ npx prisma studio
146-
```
147-
148-
_Note: You can also use Mongo Compass as your database GUI. Download and install to connect: [Mongo Compass](https://www.mongodb.com/products/compass)_
149-
150-
4. Run app
151-
152-
```bash
153-
npm run dev
154-
```
155-
156-
Now, the app will be running locally!
157-
158-
Login as an admin role here: http://localhost:3000/signin (the default admin PIN in the seed data is: 1234)
159-
160-
Once logged in, navigate to the "Settings" screen to save your store address. The app uses your store address for checkout tax calculations. You will receive the following error if you do not supply the store address.
161-
162-
![pos-missing-store-address](https://storage.googleapis.com/bigcommerce-production-dev-center/images/POS-missing-store-address.jpeg)
163-
164-
165-
## Connecting to a reader in the POS
166-
167-
On the main register screen, press the 'wifi' icon, which will read all of your terminals from Stripe and check if they are active on your network.
168-
169-
Press "Connect" for the active terminal you'd like to use to take payment at checkout.
17024

17125
## Key areas of codebase
17226

@@ -185,9 +39,9 @@ Press "Connect" for the active terminal you'd like to use to take payment at che
18539
- `/src/providers`
18640
- Where the context providers used within pages and components live.
18741
- Most are built using the concept of an 'ActionBuilder' that manages execution, loading status, and data setting consistently.
188-
- `/{provider}/context.ts`: The types used throughout the provider
189-
- `/{provider}/index.ts`: The actions available to the pages and components using the context providers
190-
- `/{provider}/ methods.ts`: The functions used within the actions to fetch / modify data
42+
- `/{provider}/context.ts`: The types used throughout the provider.
43+
- `/{provider}/index.ts`: The actions available to the pages and components using the context providers.
44+
- `/{provider}/ methods.ts`: The functions used within the actions to fetch / modify data.
19145

19246
## Contributing
19347

0 commit comments

Comments
 (0)