Skip to content

Commit

Permalink
Merge branch 'main' into milkomeda-c1-testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Zahnentferner committed Nov 22, 2023
2 parents 9bd38f1 + 577ef71 commit b02a430
Show file tree
Hide file tree
Showing 27 changed files with 8,446 additions and 26,692 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/codepreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Create preview environment

on:
pull_request:
branches: [ main, milkomeda-c1-testnet ]
branches: [main, milkomeda-c1-testnet]
push:
branches: [ main, milkomeda-c1-testnet ]
branches: [main, milkomeda-c1-testnet]

concurrency:
# The preview script can't handle concurrent deploys
Expand All @@ -18,7 +18,6 @@ concurrency:

jobs:
preview:

runs-on: ubuntu-latest

steps:
Expand All @@ -31,7 +30,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache: "npm"

- name: Install dependencies
run: npm ci
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
.env.development.local
.env.test.local
.env.production.local

.idea
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.yalc
.yalc.lock
98 changes: 46 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,83 +1,77 @@
# Getting Started with Create React App
# Djed-Solidity-WebDashboard

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
Djed is a formally verified crypto-backed autonomous stablecoin protocol. To learn more, please check our **[gitbook docs](https://docs.djed.one/alliance/the-djed-alliance)**.

This repository contains the complete source code for a frontend application designed to facilitate user interaction with deployments of a [Solidity implementation](https://github.com/DjedAlliance/Djed-Solidity) of the Djed protocol.

## Pre-requisites
Known deployments of this frontend can be used at:

We handle environment variables in `.env` files with default values in [env/](./env/) folder, i.e. [env/](./env/) contains `*.env` files for specific environments. If the repo is freshly cloned, you can copy one of those files to the root folder as `.env`, `cp ./env/milkomeda-c1-testnet.env .env` is good enough for most cases.
* [https://milkomeda-c1.djed.one](https://milkomeda-c1.djed.one)
* [https://milkomeda-c1-testnet.djed.one](https://milkomeda-c1-testnet.djed.one)

We use [nvm](https://github.com/nvm-sh/nvm) to handle the Node version, if you don't use `nvm`, the Node version can take from the [.nvmrc](./.nvmrc) file.
By utilizing this frontend application, users can conveniently engage with Djed deployments and explore the functionalities provided by the smart contracts.

Run `npm install` to download the project dependencies.
To run this frontend locally, follow the [Installation](#installation) and [Usage](#usage) instructions below.

## Available Scripts
And, please, feel welcome to [contribute](#contributing).

In the project directory, you can run:
## Installation

### `npm start`
We use [nvm](https://github.com/nvm-sh/nvm) to handle the Node version, if you don't use `nvm`, the Node version can be taken from the [.nvmrc](./.nvmrc) file.

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run format`
To download the project dependencies, run:
```
npm install
```

Formats the code to comply with the `prettier` style.
## Usage

### `npm run build`
In the project directory, run:

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
```
npm start
```

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
This will run the app in development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
The page will automatically reload when you make changes in the code.
You may also see any lint errors in the console.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More
To launch the test runner in interactive watch mode, run:

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
```
npm test
```

To learn React, check out the [React documentation](https://reactjs.org/).
See React's documentation section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### Code Splitting
To format the code to comply with the `prettier` style, run:

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
```
npm run format
```

### Analyzing the Bundle Size
To build the app for production to the `build` folder, run:

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
```
npm run build
```

### Making a Progressive Web App
This will correctly bundle React in production mode and optimize the build for the best performance.
The build is minified and the filenames include the hashes.
The app is ready to be deployed!

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
See React's documentation section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
## Contributing

### Deployment
Contributions are always welcome!

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
If you would like to contribute, please join our [Discord channel](https://discord.gg/vXQ86XGSbQ) and reach out to us.

### `npm run build` fails to minify
---

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
Thanks for reading 😊
58 changes: 31 additions & 27 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
const webpack = require('webpack');
const webpack = require("webpack");

module.exports = {
webpack: {
configure: (webpackConfig) => {
const wasmExtensionRegExp = /\.wasm$/;
webpackConfig.resolve.extensions.push('.wasm');
webpackConfig.experiments = {
asyncWebAssembly: true,
topLevelAwait: true,
layers: true,
};
webpackConfig.resolve.fallback = {
buffer: require.resolve('buffer/'),
stream: require.resolve('stream-browserify'),
}
webpackConfig.module.rules.forEach((rule) => {
(rule.oneOf || []).forEach((oneOf) => {
if (oneOf.type === "asset/resource") {
oneOf.exclude.push(wasmExtensionRegExp);
}
});
});
webpackConfig.plugins.push(new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}));
webpack: {
configure: (webpackConfig) => {
const wasmExtensionRegExp = /\.wasm$/;
webpackConfig.resolve.extensions.push(".wasm");
webpackConfig.experiments = {
asyncWebAssembly: true,
topLevelAwait: true,
layers: true
};

return webpackConfig;
}
webpackConfig.resolve.fallback = {
buffer: require.resolve("buffer/"),
stream: require.resolve("stream-browserify")
};
webpackConfig.module.rules.forEach((rule) => {
(rule.oneOf || []).forEach((oneOf) => {
if (oneOf.type === "asset/resource") {
oneOf.exclude.push(wasmExtensionRegExp);
}
});
});

webpackConfig.plugins.push(
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"]
})
);

return webpackConfig;
}
}
}
};
8 changes: 7 additions & 1 deletion env/milkomeda-c1-testnet.env
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@ REACT_APP_SC_NAME=Milkomeda-C1 Djed Osiris Dollar
REACT_APP_SC_SYMBOL=MOD
REACT_APP_RC_NAME=Milkomeda-C1 Djed Osiris Reservecoin
REACT_APP_RC_SYMBOL=MOR
REACT_APP_WSC_ORACLE=https://wsc-server-devnet.c1.milkomeda.com
REACT_APP_LIMIT_PER_TXN=10000
REACT_APP_WSC_ORACLE_URL=https://wsc-server-devnet.c1.milkomeda.com
#REACT_APP_WSC_BLOCKFROST_ID=
REACT_APP_WSC_MILKOMEDA_NETWORK_NAME=Cardano C1 Devnet
REACT_APP_CARDANO_RESERVECOIN_ADDRESS=cc53696f7d40c96f2bca9e2e8fe31905d8207c4106f326f417ec36727452657365727665436f696e
REACT_APP_EVM_RESERVECOIN_ADDRESS=0x66c34c454f8089820c44e0785ee9635c425c9128
REACT_APP_CARDANO_STABLECOIN_ADDRESS=27f2e501c0fa1f9b7b79ae0f7faeb5ecbe4897d984406602a1afd8a874537461626c65436f696e
REACT_APP_EVM_STABLECOIN_ADDRESS=0xcbA90fB1003b9D1bc6a2b66257D2585011b004e9
10 changes: 9 additions & 1 deletion env/milkomeda-c1.env
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,12 @@ REACT_APP_SC_NAME=Milkomeda-C1 Djed Osiris Dollar
REACT_APP_SC_SYMBOL=MOD
REACT_APP_RC_NAME=Milkomeda-C1 Djed Osiris Reservecoin
REACT_APP_RC_SYMBOL=MOR
REACT_APP_LIMIT_PER_TXN=10000
REACT_APP_LIMIT_PER_TXN=10000
REACT_APP_WSC_ORACLE_URL=https://wsc-oracle-c1-mainnet.milkomeda.com
#REACT_APP_WSC_BLOCKFROST_ID=
REACT_APP_WSC_MILKOMEDA_NETWORK_NAME=Cardano C1 Mainnet
REACT_APP_CARDANO_RESERVECOIN_ADDRESS=f073e7396802cadc7f9e644f251d3bce11ad44f938d11d875098ddd04d4f52
REACT_APP_EVM_RESERVECOIN_ADDRESS=0xd90f0f3332d8fccd5f74f0830f05cfca46c31ddf
REACT_APP_CARDANO_STABLECOIN_ADDRESS=f4da952809ee5db368fc8ff6de939ac55543b97524614bac98a393964d4f44
REACT_APP_EVM_STABLECOIN_ADDRESS=0xbfb54440448e6b702fa2a1d7033cd5fb0d9c5a27

Loading

1 comment on commit b02a430

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preview ready at https://milkomeda-c1-testnet.djed.codepreview.io

Powered by https://codepreview.io community edition.

Please sign in to comment.