# solidity-web

> A simple framework for developing web applications with smart contracts written in solidity.

Latest version **0.1.0** (published 2019-04-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install solidity-web
pnpm add solidity-web
yarn add solidity-web
bun add solidity-web
```

Provides the command `solidity-web`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2019-04-01 |
| First published | 2019-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Merve Sahin |
| Maintainers | mervesahin |
| Keywords | dapp, blockchain, ethereum, distributed app, solidity, apps, truffle |

## Links

- npm: https://www.npmjs.com/package/solidity-web
- Repository: https://github.com/Merve40/solidity-web
- Homepage: https://github.com/Merve40/solidity-web#readme
- Issues: https://github.com/Merve40/solidity-web/issues
- npm.io page: https://npm.io/package/solidity-web

## Dependencies (2)

- [express](https://npm.io/package/express.md) ^4.16.4
- [ganache-cli](https://npm.io/package/ganache-cli.md) ^6.3.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2019-04-01
- 0.1.1 (beta) — 2019-04-01

## README

# Solidity Web Automation Tool 

This tool is built on top of [truffle-suite](https://github.com/trufflesuite/ganache-cli) &
[express.js](https://github.com/expressjs/express) and is meant for deploying server-side code. The client-side is implemented using  [web3.js](https://github.com/ethereum/web3.js).
It automatically and dynamically generates client-side code for accessing your smart-contracts. This tool simplifies the implementation of distributed apps (dapp), by taking care of configurations and auto-generating client api's.

## How to get started:
**1. Initialize truffle**    
It will generate `contracts` and `migrations` folders.
```
truffle init
```   
**2. Uncomment network configurations in `truffle-config.js`**
```
networks: {
     development: {
      host: "127.0.0.1",     // Localhost (default: none)
      port: 8545,            // Standard Ethereum port (default: none)
      network_id: "*",       // Any network (default: none)
     },
...
}
```
**3. Run the Ethereum Node**    
```
ganache-cli
```
**4. Implement your solidity smart contracts in the `contracts` folder**   
The migration files are autogenerated. They can be customized after deployment (step 5) and be redeployed again to update changes.

**5. Initialize your contracts in another terminal**
```
solidity-web init
```
    
**6. Deploy your contracts**    
The command below will deploy contracts and use the default configurations as defined in `truffle-config.js` (step 2).   
```
solidity-web deploy
```    
Custom port and host for the webserver can be set as follows:
```
solidity-web deploy web-host=<host> web-port=<port-number>
```

This command calls truffle's `truffle migrate` command underneath, which compiles the `.sol` files and creates a `build` folder with json files.
On top of this, the `solidity-web` tool will generate an `app` folder, which contains the server- and client-side implementation. The `app.js` file is the server-side code, which launches the container. 
It can be changed to add rest functionality or or frontend code (HTML/Javascript/CSS). The `contracts.js` file creates a reference for each smart-contract.
For demonstration purposes, an `index.html` is already present and references all smart-contract instances defined in `contract.js`.

**7. Start the express webserver**   
```
node app/web/app.js
```     
The default url is http://localhost:8181

---
_Source: https://npm.io/package/solidity-web · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
