-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
67 changed files
with
14,991 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
{ | ||
"version": 1, | ||
"canisters": { | ||
"actor_test" : { | ||
"main": "tests/MemoryBuffer.ActorTest.mo", | ||
"type": "motoko" | ||
} | ||
"version": 1, | ||
"canisters": { | ||
"actor_test": { | ||
"main": "tests/MemoryBuffer.ActorTest.mo", | ||
"type": "motoko" | ||
}, | ||
"defaults": { | ||
"build": { | ||
"packtool": "mops sources", | ||
"args": "--incremental-gc" | ||
} | ||
}, | ||
"networks": { | ||
"local": { | ||
"bind": "127.0.0.1:8000", | ||
"type": "ephemeral" | ||
} | ||
"stress_test": { | ||
"main": "tests/MemoryBTree/MemoryBTree.StressTest.Replica.mo", | ||
"type": "motoko", | ||
"args": "--max-stable-pages 1638400" | ||
} | ||
}, | ||
"defaults": { | ||
"build": { | ||
"packtool": "mops sources", | ||
"args": "--incremental-gc" | ||
} | ||
}, | ||
"networks": { | ||
"local": { | ||
"bind": "127.0.0.1:4943", | ||
"type": "ephemeral" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Tests | ||
|
||
on: | ||
# push: | ||
# branches: [ "main" ] | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- name: Install dfx | ||
uses: dfinity/setup-dfx@main | ||
- name: Start dfx | ||
run: | | ||
dfx cache install | ||
dfx start --background | ||
- run: npm run setup | ||
- run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
!.vscode/settings.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
# Canisters | ||
/src/declarations | ||
.dfx | ||
.vessel | ||
.mops | ||
|
||
# Environment variables | ||
.env | ||
.env.local | ||
.env.development | ||
.env.test | ||
.env.production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Online IDE configuration (safe to delete) | ||
|
||
tasks: | ||
- before: | | ||
npm install & | ||
export MO_DEV_HIDE_URLS=1 # hide Candid UI links | ||
export PATH="$HOME/bin:$PATH" | ||
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc | ||
sudo apt-get install -q -y libunwind-dev | ||
DFXVM_INIT_YES=1 sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)" | ||
source "$HOME/.local/share/dfx/env" | ||
dfx start --background --clean | ||
npm run setup | ||
init: | | ||
npm start | ||
command: | | ||
npm start | ||
vscode: | ||
extensions: | ||
- dfinity-foundation.vscode-motoko | ||
|
||
ports: | ||
- name: Replica | ||
port: 4943 | ||
visibility: public | ||
onOpen: ignore | ||
- name: Dev Server | ||
port: 3000 | ||
visibility: public | ||
onOpen: open-browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/src/declarations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"singleQuote": true, | ||
"semi": true, | ||
"tabWidth": 4, | ||
"bracketSpacing": true, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Vite + React + Motoko | ||
|
||
### Get started directly in your browser: | ||
|
||
[](https://gitpod.io/#https://github.com/rvanasa/vite-react-motoko) | ||
|
||
This template gives you everything you need to build a full-stack Web3 application on the [Internet Computer](https://internetcomputer.org/). | ||
|
||
For an example of a real-world dapp built using this starter project, check out the [source code](https://github.com/dfinity/feedback) for DFINITY's [Developer Experience Feedback Board](https://dx.internetcomputer.org/). | ||
|
||
## 📦 Create a New Project | ||
|
||
Make sure that [Node.js](https://nodejs.org/en/) `>= 16` and [`dfx`](https://internetcomputer.org/docs/current/developer-docs/build/install-upgrade-remove) `>= 0.14` are installed on your system. | ||
|
||
Run the following commands in a new, empty project directory: | ||
|
||
```sh | ||
npx degit rvanasa/vite-react-motoko # Download this starter project | ||
dfx start --clean --background # Run dfx in the background | ||
npm run setup # Install packages, deploy canisters, and generate type bindings | ||
|
||
npm start # Start the development server | ||
``` | ||
|
||
When ready, run `dfx deploy --network ic` to deploy your application to the Internet Computer. | ||
|
||
## 🛠️ Technology Stack | ||
|
||
- [Vite](https://vitejs.dev/): high-performance tooling for front-end web development | ||
- [React](https://reactjs.org/): a component-based UI library | ||
- [TypeScript](https://www.typescriptlang.org/): JavaScript extended with syntax for types | ||
- [Sass](https://sass-lang.com/): an extended syntax for CSS stylesheets | ||
- [Prettier](https://prettier.io/): code formatting for a wide range of supported languages | ||
- [Motoko](https://github.com/dfinity/motoko#readme): a safe and simple programming language for the Internet Computer | ||
- [Mops](https://mops.one): an on-chain community package manager for Motoko | ||
- [mo-dev](https://github.com/dfinity/motoko-dev-server#readme): a live reload development server for Motoko | ||
- [@ic-reactor](https://github.com/B3Pay/ic-reactor): A suite of JavaScript libraries for seamless frontend development on the Internet Computer | ||
|
||
## 📚 Documentation | ||
|
||
- [Vite developer docs](https://vitejs.dev/guide/) | ||
- [React quick start guide](https://react.dev/learn) | ||
- [Internet Computer docs](https://internetcomputer.org/docs/current/developer-docs/ic-overview) | ||
- [`dfx.json` reference schema](https://internetcomputer.org/docs/current/references/dfx-json-reference/) | ||
- [Motoko developer docs](https://internetcomputer.org/docs/current/developer-docs/build/cdks/motoko-dfinity/motoko/) | ||
- [Mops usage instructions](https://j4mwm-bqaaa-aaaam-qajbq-cai.ic0.app/#/docs/install) | ||
- [@ic-reactor/react](https://b3pay.github.io/ic-reactor/modules/react.html) | ||
|
||
## 💡 Tips and Tricks | ||
|
||
- Customize your project's code style by editing the `.prettierrc` file and then running `npm run format`. | ||
- Reduce the latency of update calls by passing the `--emulator` flag to `dfx start`. | ||
- Install a Motoko package by running `npx ic-mops add <package-name>`. Here is a [list of available packages](https://mops.one/). | ||
- Split your frontend and backend console output by running `npm run frontend` and `npm run backend` in separate terminals. |
Oops, something went wrong.