Skip to content

Commit be6e5a0

Browse files
committed
add ecommerce
1 parent 5ac9c42 commit be6e5a0

File tree

234 files changed

+49741
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+49741
-0
lines changed

ecommerce/.npmrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
PUPPETEER_SKIP_DOWNLOAD=true
2+
registry=https://artifactory.oci.oraclecorp.com/api/npm/global-dev-npm
3+
@types:registry=https://artifactory.oci.oraclecorp.com/api/npm/global-dev-npm
4+
@oracle:registry=https://artifactory.oci.oraclecorp.com/api/npm/global-dev-npm
5+
strict-ssl=false
6+
scripts-prepend-node-path=true

ecommerce/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# How to run:
2+
3+
## sample-data
4+
5+
### change to the sample-data directory
6+
$ cd sample-data
7+
8+
### setup the schema
9+
$ mysqlsh --sql -u admin -p'<pw>' < ddl.sql
10+
11+
### seed the sample data
12+
$ mysqlsh --sql -u admin -p'<pw>' < data.sql
13+
14+
### define the stored procedures
15+
$ mysqlsh --sql -u admin -p'<pw>' < define_stored_procedures.sql
16+
17+
### insert the reviews
18+
$ msqlsh --sql -u admin
19+
<pw>
20+
mysqlsh> call insert_reviews();
21+
mysqlsh> \quit
22+
23+
## strapi
24+
25+
### install
26+
$ cd strapi
27+
$ npm install
28+
29+
### setup
30+
$ cp .env.example .env
31+
32+
Also, add the following values to your .env file
33+
34+
# Database
35+
DATABASE_CLIENT=mysql2
36+
DATABASE_HOST=localhost
37+
DATABASE_PORT=3306
38+
DATABASE_NAME=<database name>
39+
DATABASE_USERNAME=<database username>
40+
DATABASE_SSL=true
41+
DATABASE_SSL_REJECT_UNAUTHORIZED=false
42+
43+
### run
44+
$ DATABASE_PASSWORD=<pw> npm develop
45+
46+
### access
47+
48+
http://localhost:1337
49+
50+
## next.js
51+
52+
### install
53+
$ cd nextjs
54+
$ npm install
55+
56+
## run
57+
$ npm run dev
58+
59+
### access
60+
61+
http://localhost:3000
62+

ecommerce/nextjs/.env.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Add custom values
2+
SITE_NAME="Ecwid Store"
3+
COMPANY_NAME="Ecwid by Lightspeed."
4+
TWITTER_CREATOR="@ecwid"
5+
TWITTER_SITE="https://ecwid.com"
6+
7+
# Your Store ID: https://support.ecwid.com/hc/en-us/articles/207806465-Where-is-my-Store-ID
8+
ECWID_STORE_ID=""
9+
10+
# We recommend using a public token. How you can get it: https://api-docs.ecwid.com/reference/customizations-for-a-single-store
11+
ECWID_API_KEY=""
12+
13+
# Provide Ecwid team (https://developers.ecwid.com/contact) with webhook URL and webhook events to set for your application:
14+
# category.created, category.deleted, category.updated, product.created, product.deleted, product.updated, profile.updated
15+
# and custom HTTP header "X-Ecwid-Revalidation-Secret" with value of your revalidation secret
16+
ECWID_REVALIDATION_SECRET=""

ecommerce/nextjs/.eslintrc.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
extends: ['next', 'prettier'],
3+
plugins: ['unicorn', 'prettier'],
4+
rules: {
5+
'no-unused-vars': [
6+
'error',
7+
{
8+
args: 'after-used',
9+
caughtErrors: 'none',
10+
ignoreRestSiblings: true,
11+
vars: 'all',
12+
varsIgnorePattern: '^_',
13+
argsIgnorePattern: '^_',
14+
},
15+
],
16+
'prettier/prettier': ['error'],
17+
'prefer-const': 'error',
18+
'react-hooks/exhaustive-deps': 'error',
19+
'unicorn/filename-case': [
20+
'error',
21+
{
22+
case: 'kebabCase',
23+
},
24+
],
25+
},
26+
parserOptions: {
27+
babelOptions: {
28+
presets: [require.resolve('next/babel')],
29+
},
30+
},
31+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'github-actions'
4+
directory: '/'
5+
schedule:
6+
interval: 'weekly'
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: test
2+
on: pull_request
3+
4+
# Cancel in progress workflows on pull_requests.
5+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v4
16+
- name: Set node version
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version-file: '.nvmrc'
20+
- name: Set pnpm version
21+
uses: pnpm/action-setup@v2
22+
with:
23+
run_install: false
24+
version: 7
25+
- name: Cache node_modules
26+
id: node-modules-cache
27+
uses: actions/cache@v3
28+
with:
29+
path: '**/node_modules'
30+
key: node-modules-cache-${{ hashFiles('**/pnpm-lock.yaml') }}
31+
- name: Install dependencies
32+
if: steps.node-modules-cache.outputs.cache-hit != 'true'
33+
run: pnpm install --no-frozen-lockfile
34+
- name: Run tests
35+
run: pnpm test

ecommerce/nextjs/.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
.playwright
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
.pnpm-debug.log*
28+
29+
# local env files
30+
.env*
31+
!.env.example
32+
33+
# vercel
34+
.vercel
35+
36+
# typescript
37+
*.tsbuildinfo
38+
next-env.d.ts
39+
.env*.local

ecommerce/nextjs/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18

ecommerce/nextjs/.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vercel
2+
.next
3+
pnpm-lock.yaml

ecommerce/nextjs/.prettierrc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/** @type {import('prettier').Config} */
2+
module.exports = {
3+
singleQuote: true,
4+
arrowParens: 'avoid',
5+
quoteProps: 'as-needed',
6+
trailingComma: 'es5',
7+
useTabs: false,
8+
singleAttributePerLine: true,
9+
semi: true,
10+
printWidth: 100,
11+
tabWidth: 4,
12+
// plugins: ['prettier-plugin-tailwindcss'],
13+
};

0 commit comments

Comments
 (0)