Skip to content

Commit

Permalink
readme & encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
killroy192 committed Aug 12, 2024
1 parent db757d6 commit b151b4a
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 24 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SHELL := /bin/bash

-include .env

.PHONY: init build clear lint typecheck test pre-commit pre-push migrate up up-all list funding fuel report profiles recover decrypt encrypt
.PHONY: init typecheck clean lint test test.watch test.cov test.debug test.e2e pre-commit pre-push build lint-stg start start.dev start.debug start.debug.open start.prod up.dev build.prod up.prod clear.prod encrypt.prod

all: init clean typecheck

Expand Down Expand Up @@ -56,4 +56,8 @@ up.prod:
clear.prod:
@docker compose -f docker-compose.prod.yml down

# encryption setup
encrypt.prod:
@npx dotenvx encrypt -f conf/.production.secrets.env

-include ${FCT_PLUGIN_PATH}/makefile-external
98 changes: 78 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,97 @@
# web3-glue
# nestjs-web3-starter

Development starter kit for web3 node.js apps with nestjs & viem

## Technologies

- [Nestjs](https://nestjs.com/) with [Typescript](https://www.typescriptlang.org/) and [SWC](https://swc.rs/)
- [Jest](https://jestjs.io/) for unit and e2e testing
- [Docker](https://www.docker.com/) & [Docker-compose](https://docs.docker.com/compose/) for dev & prod.
- linters, code formatter, pre-commit and pre-push hooks
- Custom github action and quality gate workflow for fast CI strategy implementation
- Flexible env configuration with encryption, thanks to [dotenvx](https://dotenvx.com/)

## Requirements

- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- You'll know you've done it right if you can run `git --version`
- [Node.js](https://nodejs.org/en) v20+
- [Make](https://www.gnu.org/software/make/manual/make.html)
- Optional. [Docker](https://www.docker.com/)
- You'll need to run docker if you want to use run production container builds locally

## Installation

```bash
```sh
make
```

## Running the app
## Configuration

```bash
# development
$ make start
### Local development

# watch mode
$ make start.dev
1. Create and modify .env and .local.secrets.env files:

# production mode
$ make start.prod
```sh
cp conf/.example.env conf/.env \
&& cp conf/.example.secrets.env conf/.local.secrets.env
```

### Production

1. Create and modify .env and .production.secrets.env files:

```sh
rm conf/.production.secrets.env \
&& cp conf/.example.env conf/.env \
&& cp conf/.example.secrets.env conf/.production.secrets.env
```

**note**: you can commit .production.secrets.env after encryption

2. Encrypt prod secrets:

```sh
make encrypt.prod
```

3. Keep generated .env.keys safe and do not commit it into repo

## Running

Without docker:

```sh
# development mode
make start.dev
```

## Test
```sh
# development mode, watch & debug
make start.debug
```

```bash
# unit tests
$ make test
```sh
# production mode
make start.prod
```

# e2e tests
$ make test.e2e
With docker

# test coverage
$ make test.cov
```sh
# development mode, watch mode & debug
docker compose up
```

## License
```sh
# production mode
make up.prod
```

## Contributing

Contributions are always welcome! Open a PR or an issue!

## Notes

[MIT licensed](LICENSE).
And you probably already have `make` installed... but if not [try looking here.](https://askubuntu.com/questions/161104/how-do-i-install-make)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nestjs-web3-starter",
"version": "0.0.1",
"version": "0.0.2",
"description": "Development starter kit for web3 node.js apps with nestjs & viem",
"keywords": [
"web3",
Expand Down

0 comments on commit b151b4a

Please sign in to comment.