Skip to content

Commit 29329c3

Browse files
authored
chore: add portal project (#145)
### Tasks - [x] Change from NodeJS `18.14` to `18.19` - [x] Remove indexer-related files - [x] Remove old docker configuration - [x] Fix/improve tooling configuration (eslint, tsconfig) - [x] Bring portal project for explorer - [x] Adapt `package.json` to run scripts from both projects - [x] Rename folder to `app-explorer` and `app-portal` - [x] Add `docker/` from portal - [x] Add `scripts/` from portal - [x] Test if is running properly - [x] Adjust github-actions to have both projects accordingly - [x] Adjust `vercel.config` to deploy both project
1 parent a9e9cb5 commit 29329c3

File tree

596 files changed

+26172
-8609
lines changed

Some content is hidden

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

596 files changed

+26172
-8609
lines changed

.eslintignore

+25-19
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
1-
.changeset
2-
.eslintrc.js
3-
.lintstagedrc.js
4-
node_modules
5-
**/node_modules/**
1+
**/**/.*
2+
**/build/**
63
**/coverage/
7-
dist
84
**/dist/**
9-
build
10-
**/build/**
11-
CHANGELOG.md
12-
*.typegen.ts
13-
*.html
14-
.next/*
15-
generated
5+
**/fuel-v2-contracts
166
**/generated/**
17-
storybook
7+
**/node_modules/**
8+
**/public/storybook/**
9+
**/public/ui/**
10+
**/storybook-static
11+
**/storybook-static/**
1812
**/storybook/**
13+
*.html
14+
*.typegen.ts
15+
.changeset
16+
.eslintrc.js
17+
.lintstagedrc.js
18+
.next/*
1919
.turbo
20+
CHANGELOG.md
21+
build
22+
dist
23+
generated
24+
generated
25+
node_modules
26+
packages/app-portal/public/**
27+
packages/app-portal/src/types
2028
pnpm-lock.yaml
21-
**/**/.*
22-
.*/
23-
packages/app/public/**
24-
contracts/predicate/vitest.config.ts
25-
./tailwind.config.ts
29+
scripts/bridge/fuel-bridge
30+
**/**/tsconfig.json
31+
**.js

.eslintrc.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
const { resolve } = require('path');
2-
const { dependencies } = require('./packages/app/package.json');
3-
4-
const project = [
5-
resolve(__dirname, './tsconfig.json'),
6-
resolve(__dirname, './packages/**/tsconfig.json'),
7-
resolve(__dirname, './contracts/**/tsconfig.json'),
8-
];
1+
const { dependencies } = require('./packages/app-explorer/package.json');
92

103
module.exports = {
114
root: true,
@@ -16,7 +9,6 @@ module.exports = {
169
],
1710
parserOptions: {
1811
tsconfigRootDir: __dirname,
19-
project,
2012
},
2113
settings: {
2214
react: {
@@ -29,7 +21,6 @@ module.exports = {
2921
},
3022
[require.resolve('eslint-import-resolver-typescript')]: {
3123
alwaysTryTypes: true,
32-
project,
3324
},
3425
},
3526
},
@@ -40,6 +31,7 @@ module.exports = {
4031
{ prefer: 'type-imports', fixStyle: 'separate-type-imports' },
4132
],
4233
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
34+
'import/namespace': 'off',
4335
'import/order': [
4436
'error',
4537
{

.lintstagedrc.mjs

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
import { getTsconfig } from 'get-tsconfig';
2-
import { relative } from 'node:path';
3-
41
export default {
52
'**/*.(js|jsx|ts|jsx|md|mdx|json|html|css)': ['prettier --write'],
6-
'**/*.ts?(x)': (files) => {
7-
const commands = files.flatMap((file) => {
8-
const tsConfig = relative(process.cwd(), getTsconfig(file).path);
9-
return [`tsc -p ${tsConfig} --noEmit`, `eslint .`];
10-
});
11-
return Array.from(new Set(commands));
12-
},
3+
'**/*.ts?(x)': ['eslint'],
134
};

.npmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
node-version=18.19.0
1+
node-version=20.11.0
22

33
# Not always possible to be strict, but if it works for you, keep it to true.
44
# https://pnpm.io/next/npmrc#strict-peer-dependencies

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.19.0
1+
20.11.0

.prettierignore

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
.changeset
2-
**/node_modules/
1+
**/**/.*
2+
**/build/**
33
**/coverage/
4-
dist
54
**/dist/**
6-
build
7-
**/build/**
8-
CHANGELOG.md
9-
*.typegen.ts
10-
*.html
11-
.next/*
12-
generated
5+
**/fuel-v2-contracts
136
**/generated/**
14-
storybook
15-
**/storybook/**
16-
storybook-static
17-
**/storybook-static/**
18-
**/public/ui/**
7+
**/node_modules/**
198
**/public/storybook/**
9+
**/public/ui/**
10+
**/storybook-static
11+
**/storybook-static/**
12+
**/storybook/**
13+
*.typegen.ts
14+
.next/*
2015
.turbo
21-
pnpm-lock.yaml
22-
.next
23-
graphql.schema.json
16+
CHANGELOG.md
17+
build
18+
dist
19+
generated
2420
helm
25-
packages/graphql/src/schemas/*.graphql
21+
node_modules
22+
packages/app-portal/public/**
23+
packages/app-portal/src/types
24+
pnpm-lock.yaml
25+
scripts/bridge/fuel-bridge

.prettierrc

-1
This file was deleted.

.prettierrc.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const fuelPrettierConfig = require('@fuels/prettier-config');
2+
3+
/** @type {import("prettier").Config} */
4+
module.exports = {
5+
...fuelPrettierConfig,
6+
// trailingComma always adds comma on the end of functions params, that can cause
7+
// issues, when a second param can't be undefined.
8+
trailingComma: 'es5',
9+
overrides: [
10+
{
11+
files: '*.json',
12+
options: {
13+
trailingComma: 'none',
14+
},
15+
},
16+
],
17+
};

.vscode/settings.json

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"editor.codeActionsOnSave": {
55
"source.fixAll.eslint": "explicit"
66
},
7-
"rust-analyzer.linkedProjects": ["./packages/indexer/Cargo.toml"],
87
"editor.quickSuggestions": {
98
"strings": "on"
109
},

README.md

+34-14
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,40 @@
33

44
## 📗 Table of contents
55

6-
- [Getting Started](./docs/GETTING_STARTED.md)
7-
- [Requirements](./docs/GETTING_STARTED.md#requirements)
8-
- [Running Project Locally](./docs/GETTING_STARTED.md#running-project-locally)
9-
- [📚 - Getting the Repository](./docs/GETTING_STARTED.md#---getting-the-repository)
10-
- [📦 - Install Dependencies](./docs/GETTING_STARTED.md#---install-dependencies)
11-
- [📒 - Run Local Node](./docs/GETTING_STARTED.md#---run-local-node)
12-
- [💻 - Run Web App](./docs/GETTING_STARTED.md#---run-web-app)
13-
- [📗 Project Overview](./docs/GETTING_STARTED.md#-project-overview)
14-
- [🧰 Useful Scripts](./docs/GETTING_STARTED.md#-useful-scripts)
15-
- [Running Tests](./docs/GETTING_STARTED.md#run-tests)
16-
- [Run Tests in Development Mode](./docs/GETTING_STARTED.md#run-tests)
17-
- [Contribution Guide](./docs/CONTRIBUTING.md)
18-
- [Finding Something to Work On](./docs/CONTRIBUTING.md#finding-something-to-work-on)
19-
- [Contribution Flow](./docs/CONTRIBUTING.md#contribution-flow)
6+
### Explorer
7+
8+
- [Getting Started](./docs/explorer/GETTING_STARTED.md)
9+
- [Requirements](./docs/explorer/GETTING_STARTED.md#requirements)
10+
- [Running Project Locally](./docs/explorer/GETTING_STARTED.md#running-project-locally)
11+
- [📚 - Getting the Repository](./docs/explorer/GETTING_STARTED.md#---getting-the-repository)
12+
- [📦 - Install Dependencies](./docs/explorer/GETTING_STARTED.md#---install-dependencies)
13+
- [📒 - Run Local Node](./docs/explorer/GETTING_STARTED.md#---run-local-node)
14+
- [💻 - Run Web App](./docs/explorer/GETTING_STARTED.md#---run-web-app)
15+
- [📗 Project Overview](./docs/explorer/GETTING_STARTED.md#-project-overview)
16+
- [🧰 Useful Scripts](./docs/explorer/GETTING_STARTED.md#-useful-scripts)
17+
- [Running Tests](./docs/explorer/GETTING_STARTED.md#run-tests)
18+
- [Run Tests in Development Mode](./docs/explorer/GETTING_STARTED.md#run-tests)
19+
- [Contribution Guide](./docs/explorer/CONTRIBUTING.md)
20+
- [Finding Something to Work On](./docs/explorer/CONTRIBUTING.md#finding-something-to-work-on)
21+
- [Contribution Flow](./docs/explorer/CONTRIBUTING.md#contribution-flow)
22+
- [License](#license)
23+
24+
### Portal
25+
26+
- [Getting Started](./docs/portal/GETTING_STARTED.md)
27+
- [Requirements](./docs/portal/GETTING_STARTED.md#requirements)
28+
- [Running Project Locally](./docs/portal/GETTING_STARTED.md#running-project-locally)
29+
- [📚 - Getting the Repository](./docs/portal/GETTING_STARTED.md#---getting-the-repository)
30+
- [📦 - Install Dependencies](./docs/portal/GETTING_STARTED.md#---install-dependencies)
31+
- [📒 - Run Local Node](./docs/portal/GETTING_STARTED.md#---run-local-node)
32+
- [💻 - Run Web App](./docs/portal/GETTING_STARTED.md#---run-web-app)
33+
- [📗 Project Overview](./docs/portal/GETTING_STARTED.md#-project-overview)
34+
- [🧰 Useful Scripts](./docs/portal/GETTING_STARTED.md#-useful-scripts)
35+
- [Running Tests](./docs/portal/GETTING_STARTED.md#run-tests)
36+
- [Run Tests in Development Mode](./docs/portal/GETTING_STARTED.md#run-tests)
37+
- [Contribution Guide](./docs/portal/CONTRIBUTING.md)
38+
- [Finding Something to Work On](./docs/portal/CONTRIBUTING.md#finding-something-to-work-on)
39+
- [Contribution Flow](./docs/portal/CONTRIBUTING.md#contribution-flow)
2040
- [License](#license)
2141

2242
## License

contracts/predicate/.env.example

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
FUEL_PROVIDER_URL=https://beta-5.swayswap.io/graphql
1+
FUEL_PROVIDER_URL=https://beta-4.fuel.network/graphql
2+
PRIVATE_KEY=
3+

contracts/predicate/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"author": "",
1313
"license": "ISC",
1414
"devDependencies": {
15-
"dotenv": "16.3.1",
16-
"fuels": "0.71.0",
17-
"vitest": "1.1.3",
15+
"dotenv": "16.4.1",
16+
"fuels": "0.71.1",
17+
"vitest": "1.2.1",
1818
"tsx": "4.7.0"
1919
}
2020
}

contracts/predicate/scripts/run-predicate.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ import { BaseAssetId, Predicate, Provider, Wallet, bn, hexlify } from 'fuels';
22
import { promises as fs } from 'node:fs';
33
import { resolve } from 'node:path';
44

5-
const { FUEL_PROVIDER_BETA5, PRIVATE_KEY } = process.env;
5+
const { FUEL_PROVIDER_URL, PRIVATE_KEY } = process.env;
66
const BIN_PATH = resolve(__dirname, '../out/debug/predicate-app.bin');
77
const AMOUNT = 300_000;
88

9-
if (!FUEL_PROVIDER_BETA5 || !PRIVATE_KEY) {
9+
if (!FUEL_PROVIDER_URL || !PRIVATE_KEY) {
1010
throw new Error('Missing some config on your .env file');
1111
}
1212

1313
async function main() {
1414
const binHex = hexlify(await fs.readFile(BIN_PATH));
15-
const provider = await Provider.create(FUEL_PROVIDER_BETA5!);
15+
const provider = await Provider.create(FUEL_PROVIDER_URL!);
1616
const wallet = Wallet.fromPrivateKey(PRIVATE_KEY!, provider);
1717
const { minGasPrice: gasPrice } = wallet.provider.getGasConfig();
1818
const walletAddress = wallet.address.toB256();
@@ -43,7 +43,7 @@ async function main() {
4343
BaseAssetId,
4444
{
4545
gasPrice,
46-
},
46+
}
4747
);
4848
const res2 = await tx2.waitForResult();
4949
console.log(`→ Transaction Id: ${res2.id}`);

deployment/Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ FROM node:20-slim AS base
44

55
# Expose the ENVs to the env of the container
66
ENV PORT="${PORT}"
7-
ENV FUEL_PROVIDER_BETA5="${FUEL_PROVIDER_BETA5}"
7+
ENV FUEL_PROVIDER_URL="${FUEL_PROVIDER_URL}"
88
ENV PNPM_HOME="/pnpm"
99
ENV PATH="$PNPM_HOME:$PATH"
1010

1111
# Enable pnpm using corepack form node.js
1212
RUN corepack enable
1313

14-
COPY . /app
15-
WORKDIR /app
14+
COPY . /app-explorer
15+
WORKDIR /app-explorer
1616

1717
RUN pnpm install --frozen-lockfile
1818

1919
EXPOSE 4444
2020

21-
WORKDIR /app/packages/graphql
21+
WORKDIR /app-explorer/packages/graphql
2222

2323
CMD ["pnpm", "start"]

docker/.env

-2
This file was deleted.

docker/Makefile

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
start:
2-
# sh ./scripts/start.sh
3-
# docker compose up
4-
echo "Docker env is temporary disabled on this project";
5-
echo "Run pnpm dev for development";
1+
build:
2+
docker compose --env-file ./envs/ports.env build
63

7-
down:
8-
docker compose down
4+
start:
5+
docker compose --env-file ./envs/ports.env up -d --build
96

10-
restart:
11-
docker compose restart
7+
stop:
8+
docker compose stop
129

1310
clean:
14-
docker compose down --rmi local -v --remove-orphans
11+
docker compose down --rmi local -v
1512

1613
logs:
1714
docker compose logs -f
15+

0 commit comments

Comments
 (0)