Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amplitude tracking #937

Closed
wants to merge 117 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
055777d
Next.js and other config
quietbits Jan 9, 2024
6369ec0
Add git-info
quietbits Jan 9, 2024
d8f9bb0
Static build
quietbits Jan 9, 2024
b72f923
V2 Layout and basic page setup (#740)
quietbits Feb 21, 2024
f59f62c
V2 Basic demo setup for state management (#741)
quietbits Feb 21, 2024
32b4b34
V2 Network selector (#742)
quietbits Feb 26, 2024
0a9ba60
Test PR to trigger PR preview for testing (#743)
jacekn Feb 28, 2024
b2e2c01
V2 Intro page + some page placeholders (#744)
quietbits Feb 28, 2024
60e752d
V2 Maintenance banner (#745)
quietbits Feb 28, 2024
4674197
V2 Add Playwright testing framework with initial tests (#748)
quietbits Mar 4, 2024
fa09019
V2 Explore Endpoints: Horizon navigation and routes (#764)
quietbits Mar 5, 2024
f0cada8
Privacy Policy and Terms of Service links (#770)
quietbits Mar 5, 2024
0dbc504
[wip] create account
Mar 4, 2024
3baecba
[Account Routes] add routes for Account
Mar 5, 2024
9f38f2d
updating styles
Mar 5, 2024
16ee93f
rename Account 'routes'
Mar 5, 2024
423c882
fix routes
Mar 5, 2024
9a8ecc2
updating scss to use 'gap'
Mar 5, 2024
080eaf4
fix
Mar 6, 2024
4ff22cc
remove unused styling
Mar 6, 2024
6c4615a
[Account] Adding routes #771
jeesunikim Mar 6, 2024
d915bc8
Network switch update (#778)
quietbits Mar 13, 2024
a126002
Explore Endpoints: Basic tabs view setup (#772)
quietbits Mar 14, 2024
e050af9
add <GenerateKeypair/> component (#779)
jeesunikim Mar 14, 2024
0f350cd
Run `eslint:recommended` when committing (#787)
jeesunikim Mar 15, 2024
88401a6
Creat and Fund Account Page (#788)
jeesunikim Mar 20, 2024
1d7d896
Explore Endpoints: Accounts Params view + template rendering setup (#…
quietbits Mar 21, 2024
491a938
use @stellar/stellar-sdk (#795)
jeesunikim Mar 25, 2024
8897072
Explore Endpoints submit and response (#797)
quietbits Mar 27, 2024
db579f1
Box component + tweak ExpandBox (#800)
quietbits Mar 27, 2024
5bc4d24
Use Node v20 + updated dependencies (#803)
quietbits Mar 29, 2024
083d0cb
[Account] create and parse muxed account (#794)
jeesunikim Mar 29, 2024
9cdbed6
Explore Endpoints: pages part 1 (#805)
quietbits Apr 3, 2024
87649d2
update husky's lintstagedrc and linting rule (#804)
jeesunikim Apr 3, 2024
d6f4c04
Explore Endpoints: pages part 2 (#807)
quietbits Apr 3, 2024
ab6f2cf
Explore Endpoints: pages part 3 (#809)
quietbits Apr 5, 2024
e940a79
Endpoints tests (#811)
quietbits Apr 5, 2024
66bc155
Renamed Explore Endpoints to Endpoints (#813)
quietbits Apr 9, 2024
16500a2
adding tests for create and fund account (#808)
jeesunikim Apr 10, 2024
fd42e8d
[Build Transaction] Attributes view UI only (without input values and…
quietbits Apr 11, 2024
5f273b2
[Sign TX] Input Overview View (#826)
jeesunikim Apr 15, 2024
f39007d
PrettyJson theme + updated network accent colors (#830)
quietbits Apr 23, 2024
b7af0b1
[Create Account] Fund account with Friend button behavior (#827)
jeesunikim Apr 24, 2024
342211d
[Build Transaction] Params input and validation + encode JSON to XDR …
quietbits Apr 26, 2024
3247720
[Build Transaction] Basic Operations layout + button actions (#836)
quietbits Apr 29, 2024
1ce5100
[Build Transaction] Operations setup + create account op (#840)
quietbits May 6, 2024
1f4b89e
[Build Transaction] Added operations (#843)
quietbits May 9, 2024
38b3d30
Update maintenance banner (#846)
quietbits May 16, 2024
a2a4f59
[Build Transaction] Add more operations (#844)
quietbits May 28, 2024
0c4d480
[sign tx] add signing with secrets and ValidationResponseCard (#839)
jeesunikim May 28, 2024
2246f9e
[Build Transaction] More operations pt. 4 (#847)
quietbits May 28, 2024
65186be
[Sign Transaction] Enable persisting data on page refresh (#850)
jeesunikim May 29, 2024
8698ea8
[Build Transaction] Set Options operation (#851)
quietbits May 30, 2024
2ab16d7
[Sign Tx] Integrate with 'stellar-wallets-kit' (#852)
jeesunikim May 31, 2024
935f75e
Update GitHub Action packages (#854)
quietbits May 31, 2024
b7ec22f
[Build Transaction] Change Trust operation (#853)
quietbits Jun 4, 2024
37623db
Use @stellar/stellar-xdr-json-web package and remove temp files (#863)
quietbits Jun 10, 2024
74cbe96
[Sign Tx] Add a sign with hardware wallets (trezor, ledger) (#859)
jeesunikim Jun 11, 2024
7476991
[Build Transaction] Liquidity Pool Deposit and Withdraw (#857)
quietbits Jun 12, 2024
833e309
[UI] Display commit hash + 404 page design (#865)
quietbits Jun 12, 2024
6fe1f70
[View XDR] UI + decoded JSON (#876)
quietbits Jun 12, 2024
80691ee
Link "Sign in Transaction Signer" button to "Sign Transaction" page (…
jeesunikim Jun 14, 2024
ae1c715
Update XDR validation + show error message on View XDR page (#877)
quietbits Jun 14, 2024
d45c33d
[Submit Tx] Add a Submit Tx Page (#879)
jeesunikim Jun 18, 2024
574af79
Updated dependencies + CSP middleware configuration (#884)
quietbits Jun 18, 2024
b916ed0
[View XDR] XDR Type dropdown with search + remove custom key for zust…
quietbits Jun 18, 2024
443c348
Fix clawback claimable balance operation (#887)
quietbits Jun 20, 2024
e929dc3
[XDR] JSON To XDR (#886)
quietbits Jun 21, 2024
7e3e82e
Add Fee Bump Tx (#888)
jeesunikim Jun 25, 2024
03b6ae6
[Endpoints] Saved Endpoints (#892)
quietbits Jun 28, 2024
41a68f3
Wider content + updated transaction base fee note (#896)
quietbits Jul 8, 2024
6672cd5
[Transactions] Saved Transactions (#895)
quietbits Jul 8, 2024
1070142
Maintenance banner: update loading state (#898)
quietbits Jul 9, 2024
dec57de
Temp: test beta website (#902)
quietbits Jul 9, 2024
bb52be2
Small tweaks (#901)
quietbits Jul 9, 2024
1939de7
[RPC Endpoints] (#897)
jeesunikim Jul 12, 2024
2979d61
enable Rpc Url input in network selector
Jul 16, 2024
0a30706
Fix design issues 737 (#914)
jeesunikim Jul 17, 2024
76bf890
Update src/components/NetworkSelector/index.tsx
jeesunikim Jul 17, 2024
c2236f8
Merge branch 'laboratory-v2' into mainnet-rpc-url
jeesunikim Jul 17, 2024
88068b3
Rename validate methods function (#919)
jeesunikim Jul 19, 2024
25694ff
Merge branch 'laboratory-v2' into mainnet-rpc-url
janewang Jul 22, 2024
ee4b179
Merge pull request #913 from stellar/mainnet-rpc-url
janewang Jul 22, 2024
2a9ed07
[Fund Account] switch network page on mainnet (#917)
jeesunikim Jul 22, 2024
51e3119
V2: undo beta test (#905)
quietbits Jul 24, 2024
83a8e54
ThemeSwitch: fix state on page load (#931)
quietbits Jul 26, 2024
7155fc2
[Navigation] Utilize vertical space and add subnavigation for endpoin…
jeesunikim Jul 26, 2024
d73194d
enable switch button when rpc url is different on mainnet (#920)
jeesunikim Jul 26, 2024
f583236
UI tweaks (#932)
quietbits Jul 29, 2024
4d6123c
Amplitude tracking
quietbits Jul 30, 2024
b8da7cd
[Rpc endpoint] Bug fixes (#911)
jeesunikim Jul 30, 2024
1618376
Simulate Transaction page (#934)
quietbits Aug 2, 2024
c154740
Account + Endpoints tracking
quietbits Aug 5, 2024
968b577
Build Transaction tracking
quietbits Aug 5, 2024
67855b8
Saved Transactions tracking
quietbits Aug 5, 2024
52f7473
Sign Transaction tracking
quietbits Aug 5, 2024
7da954b
Merge branch 'laboratory-v2' of https://github.com/stellar/laboratory…
quietbits Aug 5, 2024
9ce4c9c
Simulate + Submit + Fee Bump Txn tracking
quietbits Aug 5, 2024
5292853
XDR tracking + tweaks
quietbits Aug 5, 2024
7bb801f
Tweaks
quietbits Aug 5, 2024
d161cde
Network: persist mainnet RPC URL
quietbits Aug 5, 2024
5eb7585
Merge pull request #940 from stellar/v2-persist-mainnet-rpc-url
janewang Aug 6, 2024
08e06b5
Build config for amplitude env var
quietbits Aug 12, 2024
c6609ed
Merge branch 'laboratory-v2' into v2-amplitude-tracking
quietbits Aug 13, 2024
ef59e98
Cleanup
quietbits Aug 13, 2024
1b5a7a6
Test
quietbits Aug 13, 2024
a23a42a
env docker config
quietbits Aug 13, 2024
b67a4da
Update Makefile
jacekn Aug 14, 2024
816944a
Another try
quietbits Aug 14, 2024
4123753
Try again
quietbits Aug 14, 2024
4b26581
Try global.process.env
quietbits Aug 14, 2024
f6eb3ad
Test
quietbits Aug 14, 2024
7f30d1a
Try .env file
quietbits Aug 14, 2024
acc5b98
Remove .env file
quietbits Aug 14, 2024
473b08b
Test 1
quietbits Aug 15, 2024
bace32e
Test 2
quietbits Aug 15, 2024
2d5786c
Test 3
quietbits Aug 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 0 additions & 14 deletions .babelrc

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

75 changes: 0 additions & 75 deletions .eslintrc.js

This file was deleted.

15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": [
"eslint:recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
"next/core-web-vitals",
"prettier"
],
"rules": {
// @TODO: ideally, these should be removed
"@typescript-eslint/no-explicit-any": "off",
"import/named": "off"
},
"ignorePatterns": ["./src/temp/stellar-xdr-web/*"]
}
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build the app and run Playwright Tests
on: [push, pull_request]
jobs:
build:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install -g yarn && yarn
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Build app
run: yarn build
- name: Run Playwright tests
run: yarn test
13 changes: 0 additions & 13 deletions .github/workflows/test-build.yml

This file was deleted.

31 changes: 24 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,40 @@
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz
package-lock.json

# testing
/coverage

# next.js
/.next/
/out/

# production
/build
/dist

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.eslintcache

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# test files
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
1 change: 1 addition & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn install-if-package-changed
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn pre-commit
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn pre-push
14 changes: 14 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const path = require("path");

const buildEslintCommand = (filenames) =>
`next lint --fix --file ${filenames
.map((f) => path.relative(process.cwd(), f))
.join(" --file ")}`;

const ignoredFiles = ["./src/temp/stellar-xdr-web/**/*"];

const eslintPattern = `!(${ignoredFiles.join(",")})*.{js,ts,jsx,tsx}`;

module.exports = {
"*.{js,jsx,ts,tsx}": [buildEslintCommand],
};
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
v20
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.prettierignore
public/
.gitignore
.husky/
src/temp/stellar-xdr-web/
12 changes: 12 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"arrowParens:": "always",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"printWidth": 80,
"proseWrap": "always",
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
6 changes: 0 additions & 6 deletions CONTRIBUTING.md

This file was deleted.

34 changes: 12 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
FROM ubuntu:22.04 as build
FROM node:20

MAINTAINER SDF Ops Team <[email protected]>

RUN mkdir -p /app
ENV NEXT_TELEMETRY_DISABLED 1
ENV PORT 80
WORKDIR /app
COPY . .

ENV DEBIAN_FRONTEND=noninteractive
# https://create-react-app.dev/docs/advanced-configuration/
ENV INLINE_RUNTIME_CHUNK=false
RUN apt-get update && apt-get install --no-install-recommends -y gpg curl git make ca-certificates apt-transport-https && \
curl -sSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key|gpg --dearmor >/etc/apt/trusted.gpg.d/nodesource-key.gpg && \
echo "deb https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg |gpg --dearmor >/etc/apt/trusted.gpg.d/yarnpkg.gpg && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y nodejs yarn && apt-get clean
# Passing env var to be used on client side
ARG NEXT_PUBLIC_COMMIT_HASH

COPY . /app/
RUN yarn install
ENV NEXT_PUBLIC_AMPLITUDE_API_KEY $NEXT_PUBLIC_AMPLITUDE_API_KEY
ENV NEXT_PUBLIC_AMPLITUDE_API_KEY_TEST_ENV dockerfile123ENV

RUN yarn install
RUN yarn build

FROM nginx:1.17

COPY --from=build /app/build/ /usr/share/nginx/html/

# We're removing /laboratory/ prefix. To allow for transition
# period we'll support /laboratory/ links using rewrites
COPY nginx_default.conf /etc/nginx/conf.d/default.conf
# Run on port 80 for compatibility with laboratory v1
EXPOSE 80
CMD ["npm", "start"]
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Check if we need to prepend docker commands with sudo
SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo")

# If LABEL is not provided set default value
LABEL ?= $(shell git rev-parse --short HEAD)$(and $(shell git status -s),-dirty-$(shell id -u -n))
# If TAG is not provided set default value
TAG ?= stellar/laboratory:$(shell git rev-parse --short HEAD)$(and $(shell git status -s),-dirty-$(shell id -u -n))
TAG ?= stellar/laboratory:$(LABEL)
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
BUILD_DATE := $(shell date -u +%FT%TZ)

docker-build:
$(SUDO) docker build --pull --label org.opencontainers.image.created="$(BUILD_DATE)" -t $(TAG) .
$(SUDO) docker build --pull --label org.opencontainers.image.created="$(BUILD_DATE)" -t $(TAG) --build-arg=NEXT_PUBLIC_COMMIT_HASH="$(shell git rev-parse --short HEAD)" .

docker-push:
$(SUDO) docker push $(TAG)
61 changes: 22 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,36 @@
# laboratory
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

The Stellar Laboratory is a suite of tools to help one learn about exploring the
Stellar network. See it in action:
[https://laboratory.stellar.org/](https://laboratory.stellar.org/).
## Getting Started

## Developing

```sh
yarn start
```

Testing hardware wallets requires an HTTPS connection to enable U2F. The
recommended way to do this is with [`ngrok`](https://ngrok.com/). Once
downloaded and authenticated, start ngrok, and tell the laboratory to start with
a public URL.
First, run the development server:

```bash
./ngrok http 3000
# in a separate terminal
# the subdomain will appear in ngrok's output
yarn start --public randomsubdomain.ngrok.io
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

## Building for production
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

```sh
yarn build
```
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

To build a production docker image using a clean docker build environment:
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

```sh
make docker-build
# or directly with docker
docker build -t lab:localbuild .
```
## Learn More

To build and run production build locally:
To learn more about Next.js, take a look at the following resources:

```sh
yarn production
# or
yarn prod:build
yarn prod:serve
```
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

Production uses Amplitude to emit metrics, so to fully emulate a production build, you'll need to set an `AMPLITUDE_API_KEY` variable in `/public/settings/env-config.js` file.
## Deploy on Vercel

## Internal documentation
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

The [docs.md](./docs.md) file contains code documentation on the laboratory. The
docs.md is only relevant for developing the laboratory.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Loading