Skip to content

Commit d314e47

Browse files
committed
2 parents bb1ef9b + 76e8b69 commit d314e47

File tree

365 files changed

+209031
-7135
lines changed

Some content is hidden

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

365 files changed

+209031
-7135
lines changed

.gitpod.yml

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
11
image:
2-
file: .gitpod.Dockerfile
2+
file: .gitpod.Dockerfile
33
tasks:
4-
- name: tailscaled
5-
command: |
6-
if [ -n "${TS_STATE_TAILSCALE_EXAMPLE}" ]; then
7-
# restore the tailscale state from gitpod user's env vars
8-
sudo mkdir -p /var/lib/tailscale
9-
echo "${TS_STATE_TAILSCALE_EXAMPLE}" | sudo tee /var/lib/tailscale/tailscaled.state > /dev/null
10-
fi
11-
sudo tailscaled
12-
- name: tailscale
13-
command: |
14-
sudo -E tailscale up --hostname "gitpod@nooobcoder-${GITPOD_WORKSPACE_ID}" \
15-
--authkey "${TAILSCALE_AUTHKEY}"
16-
- name: Import GPG
17-
init: >
18-
[[ ! -z $GNUPG_KEY ]] &&
19-
gpg --verbose --batch --import <(echo $GNUPG_KEY|base64 -d) &&
20-
echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf &&
21-
git config commit.gpgsign true
4+
- name: tailscaled
5+
command: |
6+
if [ -n "${TS_STATE_TAILSCALE_EXAMPLE}" ]; then
7+
# restore the tailscale state from gitpod user's env vars
8+
sudo mkdir -p /var/lib/tailscale
9+
echo "${TS_STATE_TAILSCALE_EXAMPLE}" | sudo tee /var/lib/tailscale/tailscaled.state > /dev/null
10+
fi
11+
sudo tailscaled
12+
- name: tailscale
13+
command: |
14+
sudo -E tailscale up --ssh --hostname "gitpod@nooobcoder-${GITPOD_WORKSPACE_ID}" \
15+
--authkey "${TAILSCALE_AUTHKEY}"
16+
- name: Import GPG
17+
init: >
18+
[[ ! -z $GNUPG_KEY ]] &&
19+
gpg --verbose --batch --import <(echo $GNUPG_KEY|base64 -d) &&
20+
echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf &&
21+
git config commit.gpgsign true
2222
vscode:
23-
extensions:
24-
- aaron-bond.better-comments
25-
- ahmadawais.shades-of-purple
26-
- avraammavridis.vsc-react-documentation
27-
- bierner.color-info
28-
- bradlc.vscode-tailwindcss
29-
- bungcip.better-toml
30-
- christian-kohler.npm-intellisense
31-
- christian-kohler.path-intellisense
32-
- CodeSandbox-io.codesandbox-projects-theme
33-
- cweijan.vscode-mysql-client2
34-
- DaltonMenezes.aura-theme
35-
- dbaeumer.vscode-eslint
36-
- DominicVonk.parameter-hints
37-
- dsznajder.es7-react-js-snippets
38-
- eamodio.gitlens
39-
- EditorConfig.EditorConfig
40-
- esbenp.prettier-vscode
41-
- GitHub.copilot
42-
- GitHub.github-vscode-theme
43-
- GitHub.vscode-pull-request-github
44-
- golang.go
45-
- Gruntfuggly.todo-tree
46-
- jsDelivr.jsdelivr
47-
- k--kato.intellij-idea-keybindings
48-
- manuth.eslint-language-service
49-
- markwylde.vscode-filesize
50-
- mechatroner.rainbow-csv
51-
- mikestead.dotenv
52-
- mongodb.mongodb-vscode
53-
- monokai.theme-monokai-pro-vscode
54-
- ms-python.python
55-
- ms-vscode.cpptools
56-
- ms-vsliveshare.vsliveshare-pack
57-
- naumovs.color-highlight
58-
- ngryman.codesandbox-theme
59-
- njzy.stats-bar
60-
- oderwat.indent-rainbow
61-
- pflannery.vscode-versionlens
62-
- PKief.material-icon-theme
63-
- Prisma.prisma-insider
64-
- rangav.vscode-thunder-client
65-
- redhat.java
66-
- redwan-hossain.auto-rename-tag-clone
67-
- sdras.night-owl
68-
- steoates.autoimport
69-
- tombonnike.vscode-status-bar-format-toggle
70-
- usernamehw.errorlens
71-
- vlanguage.vscode-vlang
72-
- vscjava.vscode-java-debug
73-
- vscjava.vscode-java-dependency
74-
- vscjava.vscode-java-pack
75-
- vscjava.vscode-java-test
76-
- vscjava.vscode-maven
77-
- vscjava.vscode-spring-initializr
78-
- wix.vscode-import-cost
79-
- zaaack.markdown-editor
23+
extensions:
24+
- aaron-bond.better-comments
25+
- ahmadawais.shades-of-purple
26+
- avraammavridis.vsc-react-documentation
27+
- bierner.color-info
28+
- bradlc.vscode-tailwindcss
29+
- bungcip.better-toml
30+
- christian-kohler.npm-intellisense
31+
- christian-kohler.path-intellisense
32+
- CodeSandbox-io.codesandbox-projects-theme
33+
- cweijan.vscode-mysql-client2
34+
- DaltonMenezes.aura-theme
35+
- dbaeumer.vscode-eslint
36+
- DominicVonk.parameter-hints
37+
- dsznajder.es7-react-js-snippets
38+
- eamodio.gitlens
39+
- EditorConfig.EditorConfig
40+
- esbenp.prettier-vscode
41+
- GitHub.copilot-nightly
42+
- GitHub.github-vscode-theme
43+
- GitHub.vscode-pull-request-github
44+
- golang.go
45+
- Gruntfuggly.todo-tree
46+
- jsDelivr.jsdelivr
47+
- k--kato.intellij-idea-keybindings
48+
- manuth.eslint-language-service
49+
- markwylde.vscode-filesize
50+
- mechatroner.rainbow-csv
51+
- mikestead.dotenv
52+
- mongodb.mongodb-vscode
53+
- monokai.theme-monokai-pro-vscode
54+
- ms-python.python
55+
- ms-vscode.cpptools
56+
- ms-vsliveshare.vsliveshare-pack
57+
- naumovs.color-highlight
58+
- ngryman.codesandbox-theme
59+
- njzy.stats-bar
60+
- oderwat.indent-rainbow
61+
- pflannery.vscode-versionlens
62+
- PKief.material-icon-theme
63+
- Prisma.prisma-insider
64+
- rangav.vscode-thunder-client
65+
- redhat.java
66+
- redwan-hossain.auto-rename-tag-clone
67+
- sdras.night-owl
68+
- steoates.autoimport
69+
- tombonnike.vscode-status-bar-format-toggle
70+
- usernamehw.errorlens
71+
- vlanguage.vscode-vlang
72+
- vscjava.vscode-java-debug
73+
- vscjava.vscode-java-dependency
74+
- vscjava.vscode-java-pack
75+
- vscjava.vscode-java-test
76+
- vscjava.vscode-maven
77+
- vscjava.vscode-spring-initializr
78+
- wix.vscode-import-cost
79+
- zaaack.markdown-editor

airbnb-clone/.idea/.gitignore

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbnb-clone/.idea/airbnb-clone.iml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbnb-clone/.idea/inspectionProfiles/Project_Default.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbnb-clone/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbnb-clone/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

blockchain-nft-app/.env.development

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// NEXT_PUBLIC_TARGET_CHAIN_ID=1337
2+
// NEXT_PUBLIC_NETWORK_ID=5777
3+
// NEXT_PUBLIC_TARGET_CHAIN_ID=80001
4+
// NEXT_PUBLIC_NETWORK_ID=80001
5+
NEXT_PUBLIC_TARGET_CHAIN_ID=5
6+
NEXT_PUBLIC_NETWORK_ID=5
7+
// polygon 137

blockchain-nft-app/.env.production

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
NEXT_PUBLIC_TARGET_CHAIN_ID=5
2+
NEXT_PUBLIC_NETWORK_ID=5
3+
// polygon 137

blockchain-nft-app/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

blockchain-nft-app/.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel

blockchain-nft-app/README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
2+
# ![favicon-32x32](https://user-images.githubusercontent.com/19762585/174510071-6758e22d-76c8-493e-a5fe-7f9aa8ae0648.png) This is a **8Chiq**, a 9gag clone using blockchain & NFT as a backend
3+
4+
5+
## <a href="https://8chiq.vercel.app/"> LIVE DEMO</a>
6+
7+
![Library _ Loom - 10 July 2022](https://user-images.githubusercontent.com/19762585/178131746-db744feb-5bcf-4636-a27e-b7ed94a71534.gif)
8+
9+
10+
11+
12+
## Getting Started
13+
14+
First, configure the network, in _truffle-config.js_ :
15+
16+
```bash
17+
# if you are using local Ganache, adjust port accordingly
18+
networks: {
19+
development: {
20+
host: "127.0.0.1", // Localhost (default: none)
21+
port: 7545, // Standard Ethereum port (default: none)
22+
network_id: "*", // Any network (default: none)
23+
}
24+
}
25+
```
26+
27+
if you are using test network, for example, you can adjust to the right setting, in this case Goerli Test Network is used. define _infuraProjectId_ and _mnemonic_ in _.env_ :
28+
29+
```bash
30+
//Goerli
31+
goerli_infura_testnet: {
32+
provider: () => new HDWalletProvider({
33+
mnemonic: {
34+
phrase: mnemonic
35+
},
36+
providerOrUrl:
37+
"wss://goerli.infura.io/ws/v3/" + infuraProjectId
38+
}),
39+
network_id: 5,
40+
confirmations: 2,
41+
timeoutBlocks: 800,
42+
skipDryRun: true,
43+
chainId: 5,
44+
gasPrice: 30000000000
45+
},
46+
```
47+
48+
then, migrate the contract using truffle:
49+
50+
```bash
51+
truffle migrate
52+
# or do this if previously alredy run and do some modification to contract, just in case
53+
truffle migrate --reset
54+
#or migrate with spesific network configuration
55+
truffle migrate --network=<network_name> --reset
56+
```
57+
58+
Install all dependencies:
59+
60+
```bash
61+
npm install
62+
```
63+
64+
then, run the development server:
65+
66+
```bash
67+
npm run dev
68+
# or
69+
yarn dev
70+
```
71+
72+
## Details Features
73+
74+
| Features | Status |
75+
| --- | :---: |
76+
| Minting Meme NFT | DONE |
77+
| Sell the Meme on the Marketplace | DONE |
78+
| Buy the Meme on the Marketplace | DONE |
79+
| Cancel listing on the Marketplace | DONE |
80+
| Activate likes and dislikes button function | DONE |
81+
| Activate comment function | DONE |
82+
| Contract use Testnet | DONE |
83+
84+
## Tools
85+
86+
- Truffle
87+
- Ganache
88+
- Next JS
89+
- Tailwind
90+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import useSWR from "swr"
2+
3+
const URL = "https://api.coingecko.com/api/v3/coins/ethereum?localization=false&tickers=false&community_data=false&developer_data=false&sparkline=false"
4+
export const MEME_PRICE = 15
5+
6+
7+
const fetcher = async url => {
8+
const res = await fetch(url)
9+
const json = await res.json()
10+
return json.market_data.current_price.usd ?? null
11+
}
12+
13+
export const useEthPrice = () => {
14+
const {data, ...swrRes} = useSWR(
15+
URL,
16+
fetcher,
17+
{ refreshInterval: 10000 }
18+
)
19+
const pricePerItem = (data && (MEME_PRICE / Number(data)).toFixed(5)) ?? null
20+
21+
return { eth: {data, pricePerItem, ...swrRes}}
22+
}

0 commit comments

Comments
 (0)