You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-150Lines changed: 4 additions & 150 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,155 +18,9 @@ You will need the following:
18
18
* Node.js 14.x
19
19
20
20
## 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.
23
21
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!
28
23
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`.
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.
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.
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.
0 commit comments