Skip to content

Commit

Permalink
[skip ci] contribution guide and readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Jul 26, 2023
1 parent 29d0613 commit 1bbdd6a
Show file tree
Hide file tree
Showing 15 changed files with 300 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
"poa_core",
"eth_goerli",
"eth",
"local",
"localhost",
],
"default": ""
},
Expand Down
73 changes: 73 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race,
religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at andrew@poa.network. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
57 changes: 19 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,36 @@
<h1 align="center">Blockscout frontend app</h1>
<h1 align="center">Blockscout frontend</h1>

<p align="center">
<span>Frontend application for </span>
<a href="https://github.com/blockscout/blockscout/blob/master/README.md">Blockscout</a>
<span> blockchain explorer</span>
</p>
[![](https://dcbadge.vercel.app/api/server/blockscout?style=flat)](https://discord.gg/blockscout)
docker pull blockscout/blockscout:latest

## Running and configuring the app

## App running and configuration
App is distributed as a docker image. Here you can find information about the [package](https://github.com/blockscout/frontend/pkgs/container/frontend) and its recent [releases](https://github.com/blockscout/frontend/releases).

App is distributed as a docker image. Info about the package and its recent releases you can find [here](https://github.com/blockscout/frontend/pkgs/container/frontend).
You can configure your app by passing necessary environment variables when stating the container. See full list of ENVs and their description [here](./docs/ENVS.md).

You can configure your app by passing necessary environment variables when stating a container. See full list of envs and their description [here](./docs/ENVS.md).
```sh
docker run -p 3000:3000 --env-file <path-to-your-env-file> ghcr.io/blockscout/frontend:latest
```

## Development
Alternatively, you can build your own docker image and run your app from that. Please follow this [guide](./docs/CUSTOM_BUILD.md).

### Technology stack
## Contributing

Core technologies what used in the project are
- [yarn](https://yarnpkg.com/) as package manager
- [React](https://reactjs.org/) as UI library
- [Next.js](https://nextjs.org/) as application framework
- [Chakra](https://chakra-ui.com/) as component library; our theme customization could be found in `/theme` folder
- [jest]() as JavaScript testing framework
- [playwright](https://playwright.dev/) as a tool for components visual testing
See our [Contribution guide](./docs/CONTRIBUTING.md) for pull request protocol. We expect contributors to follow our [code of conduct](./CODE_OF_CONDUCT.md) when submitting code or comments.

And of course our premier language is [Typescript](https://www.typescriptlang.org/)
## Resources
- [App ENVs list](./docs/ENVS.md)
- [Contribution guide](./docs/CONTRIBUTING.md)
- [Making custom build](./docs/CUSTOM_BUILD.md)

-----
### Local Development
## License

**Pre-requisites** You should have installed Node.js v16. The best way to manage your local Node.js version is [nvm](https://github.com/nvm-sh/nvm)
[![License: GPL v3.0](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

For local development please follow next steps:
- clone repo
- install dependencies with `yarn`
- clone `.env.example` into `configs/envs/.env.secrets` and fill it with necessary secret values (see description [below](#environment-variables))
- to spin up local dev server
- for predefined networks configs (see full available list in `package.json`) you can just run `yarn dev:<app_name>`
- for custom network setup create `.env.local` file with all required environment variables from the [list](#environment-variables) and run `yarn dev`
- navigate to the host from logs output

### Components visual testing

We use [playwright experimental components testing](https://playwright.dev/docs/test-components) for visual (screenshots) CI check. Test renders a single component in headless browser in docker, generates screenshots and then compares this screenshot with a reference one.
To perform testing locally you need to install docker and run `yarn test:pw:docker`

### Building and running your own docker image

For building a docker image simply run `yarn build:docker` or alternatively run `docker build` and pass your own args.

For running app container from freshly built image with your local env config at `./.end.local` use `yarn start:docker:local` command or run `docker run` manually.

*Disclaimer* Do no try to generate production build of the app on your local machine (outside the docker), it will fail.
This project is licensed under the GNU General Public License v3.0. See the [LICENSE](LICENSE) file for details.
3 changes: 3 additions & 0 deletions configs/envs/.env.eth
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Set of ENVs for Ethereum network explorer
# https://eth.blockscout.com/

# app config
NEXT_PUBLIC_APP_PROTOCOL=http
NEXT_PUBLIC_APP_HOST=localhost
Expand Down
3 changes: 3 additions & 0 deletions configs/envs/.env.eth_goerli
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Set of ENVs for Goerli testnet network explorer
# https://eth-goerli.blockscout.com/

# app config
NEXT_PUBLIC_APP_PROTOCOL=http
NEXT_PUBLIC_APP_HOST=localhost
Expand Down
2 changes: 2 additions & 0 deletions configs/envs/.env.jest
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Set of ENVs for Jest unit tests

# app config
NEXT_PUBLIC_APP_PROTOCOL=http
NEXT_PUBLIC_APP_HOST=localhost
Expand Down
8 changes: 6 additions & 2 deletions configs/envs/.env.localhost
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Set of ENVs for local network explorer
# frontend app URL - https://localhost:3000/
# API URL - https://localhost:3001/

# app config
NEXT_PUBLIC_APP_PROTOCOL=http
NEXT_PUBLIC_APP_HOST=localhost
NEXT_PUBLIC_APP_PORT=3333
NEXT_PUBLIC_APP_PORT=3000
NEXT_PUBLIC_APP_INSTANCE=local
NEXT_PUBLIC_APP_ENV=development

Expand All @@ -26,7 +30,7 @@ NEXT_PUBLIC_MARKETPLACE_SUBMIT_FORM=https://airtable.com/shrqUAcjgGJ4jU88C
NEXT_PUBLIC_NETWORK_RPC_URL=https://core.poa.network

# api config
NEXT_PUBLIC_API_BASE_PATH=/poa/core
NEXT_PUBLIC_API_BASE_PATH=/
NEXT_PUBLIC_API_HOST=localhost
NEXT_PUBLIC_API_PROTOCOL=http
NEXT_PUBLIC_API_PORT=3001
3 changes: 3 additions & 0 deletions configs/envs/.env.main
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Set of ENVs for Develompent network explorer
# https://blockscout-main.k8s-dev.blockscout.com/

# app config
NEXT_PUBLIC_APP_PROTOCOL=http
NEXT_PUBLIC_APP_HOST=localhost
Expand Down
3 changes: 3 additions & 0 deletions configs/envs/.env.main.L2
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Set of ENVs for Develompent L2 network explorer
# https://blockscout-optimism-goerli.k8s-dev.blockscout.com/

# app config
NEXT_PUBLIC_APP_PROTOCOL=http
NEXT_PUBLIC_APP_HOST=localhost
Expand Down
3 changes: 3 additions & 0 deletions configs/envs/.env.poa_core
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Set of ENVs for POA network explorer
# https://blockscout.com/poa/core/

# app config
NEXT_PUBLIC_APP_PROTOCOL=http
NEXT_PUBLIC_APP_HOST=localhost
Expand Down
2 changes: 2 additions & 0 deletions configs/envs/.env.pw
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Set of ENVs for Playwright components tests

# app config
NEXT_PUBLIC_APP_PROTOCOL=http
NEXT_PUBLIC_APP_HOST=localhost
Expand Down
Loading

0 comments on commit 1bbdd6a

Please sign in to comment.