1.0 version

This commit is contained in:
jejolare 2024-09-21 03:43:02 +07:00
parent e78a515307
commit 8effec24c9
15 changed files with 743 additions and 2235 deletions

View file

@ -18,10 +18,24 @@ const nextConfig = {
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
use: ["@svgr/webpack"]
use: [
{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: {
removeViewBox: false
}
},
},
},
],
}
);
fileLoaderRule.exclude = /\.svg$/i;
return config;
},
}

794
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -12,18 +12,26 @@
"@types/node": "^16.18.57",
"@types/react": "^18.2.25",
"@types/react-dom": "^18.2.10",
"axios": "^1.7.7",
"bignumber.js": "^9.1.2",
"concurrently": "^8.2.2",
"dotenv": "^16.4.5",
"express": "^4.21.0",
"express-rate-limit": "^7.4.0",
"highcharts": "^11.1.0",
"highcharts-react-official": "^3.2.1",
"http-proxy-middleware": "^2.0.6",
"nanoid": "^5.0.1",
"next": "^14.2.12",
"node-fetch": "^3.3.2",
"pg": "^8.13.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-json-view-lite": "^1.1.0",
"react-scripts": "5.0.1",
"sass": "^1.68.0",
"sequelize": "^6.37.3",
"socket.io": "^4.7.5",
"socket.io-client": "^4.7.5",
"tsx": "^4.19.0",
"typescript": "^4.9.5",
@ -58,6 +66,6 @@
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"nodemon": "^3.0.1"
"nodemon": "^3.1.7"
}
}

View file

@ -1,56 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Block explorer (Zarcanum)"
/>
<meta property="og:type" content="website">
<meta property="og:url" content="https://explorer.zano.org/">
<meta property="og:title" content="Block explorer (Zarcanum)">
<meta property="og:description" content="Zano is an open-source cryptocurrency and ecosystem with enterprise-grade privacy, security, and scalability">
<meta property="og:image" content="social-banner.png">
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://explorer.zano.org/">
<meta property="twitter:title" content="Block explorer (Zarcanum)">
<meta property="twitter:description" content="Zano is an open-source cryptocurrency and ecosystem with enterprise-grade privacy, security, and scalability">
<meta property="twitter:image" content="social-banner.png">
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Zano Block Explorer</title>
</head>
<body class="custom-scroll">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

View file

@ -1,25 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View file

@ -1,3 +0,0 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

2013
server/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,26 +0,0 @@
{
"name": "explorer_server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"wallet": "node ./dev_quick_run/windows_entry.js",
"dev": "nodemon server.js",
"start": "node server.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^1.5.1",
"bignumber.js": "^9.1.2",
"concurrently": "^8.2.2",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"node-fetch": "^2.6.5",
"nodemon": "^3.0.1",
"pg": "^8.11.3",
"sequelize": "^6.37.3",
"socket.io": "^4.7.2"
}
}

View file

@ -46,8 +46,6 @@ const requestsLimiter = rateLimit({
(async () => {
await nextApp.prepare();
await initDB();
await sequelize.authenticate();
await sequelize.sync();
@ -60,9 +58,8 @@ const requestsLimiter = rateLimit({
headers['Access-Control-Allow-Origin'] = config.frontend_api
});
app.all('*', (req, res) => {
return handle(req, res);
});
await nextApp.prepare();
app.use(express.static('dist'));
app.use(function (req, res, next) {
@ -1090,12 +1087,6 @@ const requestsLimiter = rateLimit({
}));
app.get("/*", function (req, res) {
const buildPath = path.resolve(__dirname, "../build/index.html");
res.sendFile(buildPath);
});
io.on('connection', async (socket) => {
socket.on('get-socket-info', () => {
emitSocketInfo(socket);
@ -1105,6 +1096,10 @@ const requestsLimiter = rateLimit({
});
})
app.all('*', (req, res) => {
return handle(req, res);
});
server.listen(config.server_port, () => {
// @ts-ignore
log(`Server listening on port ${server?.address()?.port}`)

View file

@ -7,21 +7,21 @@ function App(data: any) {
return (
<>
<Head>
<title>Zano Trade</title>
<meta name="description" content="Peer-to-Peer Trading App on Zano blockchain" />
<title>Block explorer (Zarcanum)</title>
<meta name="description" content="Zano is an open-source cryptocurrency and ecosystem with enterprise-grade privacy, security, and scalability" />
<meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no" />
<link rel="icon" href="/favicon.ico" />
<meta property="og:type" content="website"/>
<meta property="og:url" content="https://trade.zano.org/"/>
<meta property="og:title" content="Zano Trade"/>
<meta property="og:description" content="Peer-to-Peer Trading App on Zano blockchain"/>
<meta property="og:url" content="https://explorer.zano.org/"/>
<meta property="og:title" content="Block explorer (Zarcanum)"/>
<meta property="og:description" content="Zano is an open-source cryptocurrency and ecosystem with enterprise-grade privacy, security, and scalability"/>
<meta property="og:image" content="social-banner.png"/>
<meta property="twitter:card" content="summary_large_image"/>
<meta property="twitter:url" content="https://trade.zano.org/"/>
<meta property="twitter:title" content="Zano Trade"/>
<meta property="twitter:description" content="Peer-to-Peer Trading App on Zano blockchain"/>
<meta property="twitter:url" content="https://explorer.zano.org/"/>
<meta property="twitter:title" content="Block explorer (Zarcanum)"/>
<meta property="twitter:description" content="Zano is an open-source cryptocurrency and ecosystem with enterprise-grade privacy, security, and scalability"/>
<meta property="twitter:image" content="social-banner.png"/>
</Head>
<Component {...pageProps} />

View file

@ -26,7 +26,7 @@ function Block(props: { alt?: boolean }) {
const [jsonPopupOpened, setJsonPopupOpened] = useState(false);
const router = useRouter();
const { hashQuery } = router.query;
const { hash: hashQuery } = router.query;
const hash = Array.isArray(hashQuery) ? hashQuery[0] : hashQuery;