Skip to content

Commit e463fca

Browse files
committed
adds linter and ts support
1 parent 46adc98 commit e463fca

20 files changed

+6332
-6266
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.eslintrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": [
5+
"@typescript-eslint"
6+
],
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/eslint-recommended",
10+
"plugin:@typescript-eslint/recommended"
11+
]
12+
}

README.md

+78-81
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,23 @@ TODO:
4141
<!-- PROJECT LOGO -->
4242
<br />
4343
<div align="center">
44-
<a href="https://github.com/github_username/repo_name">
45-
<img src="images/logo.png" alt="Logo" width="80" height="80">
44+
<a href="https://github.com/eversmile12/create-web3-dapp">
45+
<img src="images/logo.webp" alt="Logo" width="100" height="100">
4646
</a>
4747

48-
<h3 align="center">project_title</h3>
48+
<h2 align="center">create-web3-dapp</h2>
4949

5050
<p align="center">
51-
project_description
51+
Everything you need to build decentralized applications
5252
<br />
53-
<a href="https://github.com/github_username/repo_name"><strong>Explore the docs »</strong></a>
53+
<a href="https://docs.alchemy.com"><strong>Explore the docs »</strong></a>
5454
<br />
5555
<br />
56-
<a href="https://github.com/github_username/repo_name">View Demo</a>
56+
<a href="https://github.com/eversmile12/create-web3-dapp">Contribute</a>
5757
·
58-
<a href="https://github.com/github_username/repo_name/issues">Report Bug</a>
58+
<a href="https://github.com/eversmile12/create-web3-dapp/issues">Report Bug</a>
5959
·
60-
<a href="https://github.com/github_username/repo_name/issues">Request Feature</a>
60+
<a href="https://github.com/eversmile12/create-web3-dapp/issues">Request Feature</a>
6161
</p>
6262
</div>
6363

@@ -69,9 +69,6 @@ TODO:
6969
<ol>
7070
<li>
7171
<a href="#about-the-project">About The Project</a>
72-
<ul>
73-
<li><a href="#built-with">Built With</a></li>
74-
</ul>
7572
</li>
7673
<li>
7774
<a href="#getting-started">Getting Started</a>
@@ -84,7 +81,7 @@ TODO:
8481
<li><a href="#roadmap">Roadmap</a></li>
8582
<li><a href="#contributing">Contributing</a></li>
8683
<li><a href="#license">License</a></li>
87-
<li><a href="#contact">Contact</a></li>
84+
<li><a href="#contributors">Contributors</a></li>
8885
<li><a href="#acknowledgments">Acknowledgments</a></li>
8986
</ol>
9087
</details>
@@ -94,29 +91,19 @@ TODO:
9491
<!-- ABOUT THE PROJECT -->
9592
## About The Project
9693

97-
[![Product Name Screen Shot][product-screenshot]](https://example.com)
98-
99-
Here's a blank template to get started: To avoid retyping too much info. Do a search and replace with your text editor for the following: `github_username`, `repo_name`, `twitter_handle`, `linkedin_username`, `email_client`, `email`, `project_title`, `project_description`
100-
101-
<p align="right">(<a href="#top">back to top</a>)</p>
94+
**ATTENTION**: This project is under beta and not ready for production - using it in product is highgly discouraged without prior thorough review.
10295

96+
![product-screenshot]
10397

98+
Create and deploy a decentralized application on Ethereum, Polygon, Solana, and all major chains, in a matter of minutes.
10499

105-
### Built With
100+
create-web3-dapp is an utility NPX package built on top of NextJS that allows developers to pick and choose the boilerplates of their decentralized application.
106101

107-
* [![Next][Next.js]][Next-url]
108-
* [![React][React.js]][React-url]
109-
* [![Vue][Vue.js]][Vue-url]
110-
* [![Angular][Angular.io]][Angular-url]
111-
* [![Svelte][Svelte.dev]][Svelte-url]
112-
* [![Laravel][Laravel.com]][Laravel-url]
113-
* [![Bootstrap][Bootstrap.com]][Bootstrap-url]
114-
* [![JQuery][JQuery.com]][JQuery-url]
102+
From the chain to use, through the wallet login system, to the React components to include and the Blockchain development environment, everything developers need to spin up their web3 dapps, bundled in an easy to use command line tool.
115103

116104
<p align="right">(<a href="#top">back to top</a>)</p>
117105

118106

119-
120107
<!-- GETTING STARTED -->
121108
## Getting Started
122109

@@ -125,42 +112,69 @@ To get a local copy up and running follow these simple example steps.
125112

126113
### Prerequisites
127114

128-
This is an example of how to list things you need to use the software and how to install them.
129-
* npm
130-
```sh
131-
npm install npm@latest -g
132-
```
133-
134-
### Installation
115+
* NodeJS
135116

136-
1. Get a free API Key at [https://example.com](https://example.com)
137-
2. Clone the repo
138-
```sh
139-
git clone https://github.com/github_username/repo_name.git
140-
```
141-
3. Install NPM packages
142-
```sh
143-
npm install
144-
```
145-
4. Enter your API in `config.js`
146-
```js
147-
const API_KEY = 'ENTER YOUR API';
148-
```
117+
To install node go on the [official Node website](https://nodejs.org/en/download/), and download the LTS package for your Operating System.
149118

150-
<p align="right">(<a href="#top">back to top</a>)</p>
119+
To verify if NodeJS has been correctly installed on your system, open your terminal and run:
120+
```sh
121+
node -v
122+
```
123+
and
124+
```sh
125+
npm -v
126+
```
151127

152128

129+
### Installation
153130

154-
<!-- USAGE EXAMPLES -->
155-
## Usage
131+
1. In your terminal run
132+
* ```sh
133+
npx create-web3-dapp
134+
```
156135

157-
Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.
136+
2. The first time you'll run this command, it will install the package.
158137

159-
_For more examples, please refer to the [Documentation](https://example.com)_
138+
3. Now the following command again:
139+
* ```sh
140+
npx create-web3-dapp
141+
```
142+
This will start the DApp creation flow.
160143

161144
<p align="right">(<a href="#top">back to top</a>)</p>
162145

163146

147+
## DApp Creation Flow
148+
Once started, the create-web3-dapp wizard will ask you a series of questions to understand what to and what to not include in your dapp boilerplates.
149+
150+
Here's a reference to the creation flow:
151+
152+
1. **Insert new dapp name** *(text)*
153+
2. **select dapp chain** *(options)*:
154+
1. The user can choose between the chains supported by Alchemy including Solana
155+
1. Because our support to Solana is currently limited, the Solana implementation has partial ROI against the EVM one.
156+
3. **select if we want to import the template files** *(true/false)*:
157+
1. The template files contain code showcasing the Alchemy SDK capabilities (NFT API, Transfer API) through a set of NextJs components visual components.
158+
2. If the user doesn’t install the template files, Alchemy will be only used to connect the wallet - the Alchemy SDK won’t be installed (to brainstorm)
159+
4. **Select if we want to import a Blockchain development environment like** *(options)*:
160+
1. Hardhat (partially supported) - EVM
161+
2. Foundry (not yet supported) - EVM
162+
3. Anchor (not yet supported) - Solana
163+
5. **Add Alchemy API Key:**
164+
1. The key will be used:
165+
1. In the front-end to connect:
166+
1. The wallet (Solana, EVM)
167+
2. In the Alchemy SDK if the user has installed the template files[4a](EVM)
168+
2. In the Blockchain development environment [5](Solana, EVM)
169+
6. **The builder will now proceed to create the project, performing the following actions:**
170+
1. download the files from the GitHub repositories:
171+
1.
172+
2. Install the dependencies (Alchemy SDK, Rainbow Kit, Hardhat, etc)
173+
3. Update the dependencies
174+
4. Run the application
175+
6. **The user will now be able to see the following landing page at http://localhost:3000:**
176+
177+
<p align="right">(<a href="#top">back to top</a>)</p>
164178

165179
<!-- ROADMAP -->
166180
## Roadmap
@@ -174,8 +188,6 @@ See the [open issues](https://github.com/github_username/repo_name/issues) for a
174188

175189
<p align="right">(<a href="#top">back to top</a>)</p>
176190

177-
178-
179191
<!-- CONTRIBUTING -->
180192
## Contributing
181193

@@ -227,32 +239,17 @@ Project Link: [https://github.com/github_username/repo_name](https://github.com/
227239

228240
<!-- MARKDOWN LINKS & IMAGES -->
229241
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
230-
[contributors-shield]: https://img.shields.io/github/contributors/github_username/repo_name.svg?style=for-the-badge
231-
[contributors-url]: https://github.com/github_username/repo_name/graphs/contributors
232-
[forks-shield]: https://img.shields.io/github/forks/github_username/repo_name.svg?style=for-the-badge
233-
[forks-url]: https://github.com/github_username/repo_name/network/members
234-
[stars-shield]: https://img.shields.io/github/stars/github_username/repo_name.svg?style=for-the-badge
235-
[stars-url]: https://github.com/github_username/repo_name/stargazers
236-
[issues-shield]: https://img.shields.io/github/issues/github_username/repo_name.svg?style=for-the-badge
237-
[issues-url]: https://github.com/github_username/repo_name/issues
238-
[license-shield]: https://img.shields.io/github/license/github_username/repo_name.svg?style=for-the-badge
239-
[license-url]: https://github.com/github_username/repo_name/blob/master/LICENSE.txt
242+
[contributors-shield]: https://img.shields.io/github/contributors/eversmile12/create-web3-dapp.svg?style=for-the-badge
243+
[contributors-url]: https://github.com/eversmile12/create-web3-dapp/graphs/contributors
244+
[forks-shield]: https://img.shields.io/github/forks/eversmile12/create-web3-dapp.svg?style=for-the-badge
245+
[forks-url]: https://github.com/eversmile12/create-web3-dapp/network/members
246+
[stars-shield]: https://img.shields.io/github/stars/eversmile12/create-web3-dapp.svg?style=for-the-badge
247+
[stars-url]: https://github.com/eversmile12/create-web3-dapp/stargazers
248+
[issues-shield]: https://img.shields.io/github/issues/eversmile12/create-web3-dapp.svg?style=for-the-badge
249+
[issues-url]: https://github.com/eversmile12/create-web3-dapp/issues
250+
[license-shield]: https://img.shields.io/github/license/eversmile12/create-web3-dapp.svg?style=for-the-badge
251+
[license-url]: https://github.com/eversmile12/create-web3-dapp/blob/master/LICENSE.txt
240252
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
241-
[linkedin-url]: https://linkedin.com/in/linkedin_username
253+
254+
242255
[product-screenshot]: images/screenshot.png
243-
[Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white
244-
[Next-url]: https://nextjs.org/
245-
[React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
246-
[React-url]: https://reactjs.org/
247-
[Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D
248-
[Vue-url]: https://vuejs.org/
249-
[Angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white
250-
[Angular-url]: https://angular.io/
251-
[Svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge&logo=svelte&logoColor=FF3E00
252-
[Svelte-url]: https://svelte.dev/
253-
[Laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge&logo=laravel&logoColor=white
254-
[Laravel-url]: https://laravel.com
255-
[Bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge&logo=bootstrap&logoColor=white
256-
[Bootstrap-url]: https://getbootstrap.com
257-
[JQuery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white
258-
[JQuery-url]: https://jquery.com

contributing.md

Whitespace-only changes.
File renamed without changes.

helpers/cloneRepo.js renamed to helpers/cloneRepo.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ export const cloneRepo = (
2626
console.log("\n");
2727
bar1.update(100);
2828

29-
console.log(chalk.yellow("Copying project files..."));
29+
console.log(chalk.yellow("\nCopying project files..."));
30+
3031

31-
console.log("\n");
3232

3333

3434
let template = path.join(
@@ -37,10 +37,7 @@ export const cloneRepo = (
3737
(dappInfo.chain == "ethereum" || dappInfo.chain == "polygon" || dappInfo.chain == "arbitrum"|| dappInfo.chain == "optimism") ? "ethereum" : "solana",
3838
dappInfo.wantsTemplateFiles ? "tutorial" : "vanilla"
3939
);
40-
41-
console.log("Template: ", template);
42-
console.log(dappInfo.chain)
43-
40+
4441
fse.copySync(template, process.cwd());
4542

4643
bar1.update(200);
File renamed without changes.

helpers/createPackage.js renamed to helpers/createPackage.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { execSync } from "child_process";
33
import chalk from "chalk";
44
import cliProgress from "cli-progress";
55

6-
export const createPackageJson = async ( projectName, {isEthereumProject, wantsBackend, type}) => {
6+
export const createPackageJson = async ( projectName: string, {isEVM, useBackend, backendProvider = ""}) => {
77
try {
88
console.log(chalk.yellow("Generating package.json"));
99
const bar1 = new cliProgress.SingleBar(
@@ -34,7 +34,7 @@ export const createPackageJson = async ( projectName, {isEthereumProject, wantsB
3434
};
3535
bar1.update(100);
3636

37-
if (isEthereumProject) {
37+
if (isEVM) {
3838
packageJson["dependencies"]["alchemy-sdk"] = "^2.0.0";
3939
packageJson["dependencies"]["@rainbow-me/rainbowkit"] = "^0.4.5";
4040
} else {
@@ -47,9 +47,9 @@ export const createPackageJson = async ( projectName, {isEthereumProject, wantsB
4747
packageJson["dependencies"]["@solana/web3.js"] = "^1.50.1";
4848
}
4949

50-
if (wantsBackend) {
50+
if (useBackend) {
5151

52-
switch (type) {
52+
switch (backendProvider) {
5353
case "hardhat":
5454
packageJson["devDependencies"]["@nomicfoundation/hardhat-toolbox"] = "^1.0.2";
5555
packageJson["devDependencies"]["hardhat"] = "^2.10.1";
@@ -68,10 +68,7 @@ export const createPackageJson = async ( projectName, {isEthereumProject, wantsB
6868
bar1.update(150);
6969
fs.writeFileSync(
7070
"package.json",
71-
JSON.stringify(packageJson, null, "\t"),
72-
(err) => {
73-
if (err) console.log(err);
74-
}
71+
JSON.stringify(packageJson, null, "\t")
7572
);
7673
bar1.update(200);
7774
bar1.stop();

helpers/mkdir.js

-11
This file was deleted.

helpers/mkdir.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import fs from "fs"
2+
3+
export const mkdir = (projectPath: string) => {
4+
try {
5+
fs.mkdirSync(projectPath)
6+
} catch (e: any) {
7+
console.log(e)
8+
}
9+
}
10+

helpers/selfDestroy.js renamed to helpers/selfDestroy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const selfDestroy = (e) => {
1717
process.exit(1)
1818
}
1919

20-
process.on('exit', selfDestroy.bind(null))
20+
2121
process.on('SIGINT', selfDestroy.bind(null))
2222
process.on('SIGUSR1', selfDestroy.bind(null))
2323
process.on('SIGUSR2', selfDestroy.bind(null))

helpers/setupHardhat.js renamed to helpers/setupHardhat.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
import chalk from "chalk";
2+
import cliProgress from "cli-progress";
3+
import path from "path";
4+
import { createEnv } from "./createEnv.js";
5+
import fse from "fs-extra";
6+
17
export const setUpHardhat = (dappInfo) => {
28
console.log(chalk.yellow(`Copying ${dappInfo.type} files...`));
39
const bar2 = new cliProgress.SingleBar(

images/logo.webp

9.63 KB
Binary file not shown.

images/screenshot.png

270 KB
Loading

0 commit comments

Comments
 (0)