Skip to content

Commit

Permalink
feat: init wizard v2 improvements (#19)
Browse files Browse the repository at this point in the history
* chore: wip

* chore: test

* chore: test

* chore: test

* chore: test

* chore: wip

* chore: test

* chore: test

* chore: minor tweaks

* chore: minor tweaks

* chore: minor tweaks

* chore: minor tweaks

* chore: minor tweaks

* chore: minor tweaks

* chore: wip reorg examples; refine tests

* refactor: refine tests; readme

* docs: minor tweaks

* chore: minor tweaks

* chore: tweaking copier

* chore: wip

* chore: wip

* chore: regen examples

* chore: refining preset question

* chore: regen artifacts

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: refinements

* chore: minor refinements

* chore: minor tweaks

* chore: minor tweaks in copier

* chore: regen artifacts

* chore: restoring workflow git tweaks

* chore: remove zendesk actions

* refactor: addressing pr comments

* chore: regen artifacts

* chore: patching tests

* chore: regen artifacts

* chore: fix tests

* fix: patching brackets for str answer params

* chore: refining invocation of base template

* chore: regen docs

* chore: enforce min version from template side

* chore: minor improvements in check_algokit_version script

* chore: fixing compatibility issues with pyyaml and 3.12

* chore: temporary reverting to older cli version
  • Loading branch information
aorumbayev authored Feb 26, 2024
1 parent fc1108d commit 2ccd4cc
Show file tree
Hide file tree
Showing 529 changed files with 9,772 additions and 1,588 deletions.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: "\U0001F41C Bug report"
about: Report a reproducible bug.
title: ''
labels: bug
assignees: ''
---

### Subject of the issue

<!-- Describe your issue here. -->

### Your environment

<!--
* Please provide the output of `algokit doctor` command response,
* This will give us a good idea about your environment
-->

### Steps to reproduce

1.
2.

### Expected behaviour

### Actual behaviour
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: "\U0001F514 Feature Request"
about: Suggestions for how we can improve the algorand platform.
title: ''
labels: enhancement
assignees: ''
---

## Problem

<!-- What is the problem that we’re trying to solve? -->

## Solution

<!-- Do you have a potential/suggested solution? Document more than one if possible. -->

### Proposal

<!-- Describe the solution you’d like in detail. -->

### Pros and Cons

<!-- What are the advantages and disadvantages of this solution? -->

## Dependencies

<!-- Does the solution have any team or design dependencies? -->
12 changes: 6 additions & 6 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ jobs:
uses: ./.github/workflows/check-python.yaml

tag-release:
runs-on: "ubuntu-latest"
runs-on: 'ubuntu-latest'
needs: ci-check-python
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Tag release
id: tag
uses: TriPSs/[email protected]
with:
skip-commit: "true"
tag-prefix: ""
skip-on-empty: "false"
skip-commit: 'true'
tag-prefix: ''
skip-on-empty: 'false'

- name: Create Release
uses: softprops/action-gh-release@v1
if: ${{ steps.tag.outputs.skipped == 'false' }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/check-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ jobs:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Install algokit
run: pipx install algokit
run: pipx install git+https://github.com/algorandfoundation/algokit-cli@feat/init_wizard_v2 --force

- name: Set up Python 3.10
uses: actions/setup-python@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
cache: 'poetry'

- name: Install dependencies
Expand Down Expand Up @@ -51,6 +51,6 @@ jobs:
shell: bash
run: |
# Add untracked files as empty so they come up in diff
git add -N ./tests_generated
git add -N ./examples
# Look for changes in generated templates and error if there are any
git diff --exit-code --minimal ./tests_generated
git diff --exit-code --minimal ./examples
12 changes: 0 additions & 12 deletions .github/workflows/issue_closed.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/issue_commented.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/issue_labelled.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/zendesk_github_add_comment.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/zendesk_github_close_issue.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,9 @@ cython_debug/
node_modules

# Ignore lock files in all directories and subdirectories under tests_generated
tests_generated/*/**/package-lock.json
tests_generated/*/**/poetry.lock
examples/*/**/package-lock.json
examples/*/**/poetry.lock

# playground folder for previewing templates
.playground/*
!.playground/.gitkeep
File renamed without changes.
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# AlgoKit Official Template for contributors

This repository is a template for creating new AlgoKit projects. It includes a basic structure for creating a full-stack project.

## Pre-requisites

`poetry install` - Install the dependencies for the project.

## Testing

```bash
poetry run pytest
```

This will regenerate the tests for default `starter` and `production` presets as well as default tests for `generators` available on the template.

## Development

```bash
poetry run copier copy . .playground/{some_dummy_folder_name} --vcs-ref=HEAD --trust
```

To generate a dummy project into the `.playground` folder. This is useful for testing the template to quickly preview the output of the template before testing via `pytest`.

## Contributing

### Commits

We are using the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) standard for commit messages. This allows us to automatically generate release notes and version numbers. We do this via [Python Semantic Release](https://python-semantic-release.readthedocs.io/en/latest/) and [GitHub actions](.github/workflows/cd.yaml).

### Guiding Principles

AlgoKit development is done within the [AlgoKit Guiding Principles](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/algokit.md#guiding-principles).

### Pull Requests

1. Submit a pull request to the `main` branch. Fork the repo if you are an external contributor.
2. Ensure that the pull request is up to date with the `main` branch.
3. Ensure that the pull request has a clear title and description.
4. Pass PR reviews and wait for approval.
36 changes: 29 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,28 @@
<a target="_blank" href="https://github.com/algorandfoundation/algokit-cli"><img src="https://img.shields.io/badge/docs-repository-00dc94?logo=github&style=flat.svg" /></a>
<a target="_blank" href="https://developer.algorand.org/algokit/"><img src="https://img.shields.io/badge/learn-AlgoKit-00dc94?logo=algorand&mac=flat.svg" /></a>
<a target="_blank" href="https://github.com/algorandfoundation/algokit-fullstack-template"><img src="https://img.shields.io/github/stars/algorandfoundation/algokit-fullstack-template?color=00dc94&logo=star&style=flat" /></a>
<a target="_blank" href="https://developer.algorand.org/algokit/"><img src="https://vbr.wocr.tk/badge?page_id=algorandfoundation%2Falgokit-fullstack-template&color=%2300dc94&style=flat" /></a>
<a target="_blank" href="https://developer.algorand.org/algokit/"><img src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Falgorandfoundation%2Falgokit-fullstack-template&countColor=%2300dc94&style=flat" /></a>
</p>

---

This full-stack template provides both a baseline React web app and a production-ready baseline for developing and deploying [Beaker](https://github.com/algorand-devrel/beaker) smart contracts. It's suitable for developing and integrating with any [ARC32](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0032.md) compliant Algorand smart contracts.
This full-stack template provides both a baseline React web app and a production-ready baseline for developing and deploying `Puya`, `TealScript` and `Beaker` smart contracts. It's suitable for developing and integrating with any [ARC32](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0032.md) compliant Algorand smart contracts.

To use this template, [install AlgoKit](https://github.com/algorandfoundation/algokit-cli#readme) and then either pass in `-t fullstack` to `algokit init` or select the relevant template interactively during `algokit init`.

This is one of the official templates used by AlgoKit to initialize both a frontend React web app and Algorand smart contract project. It's created based on the [Copier templates](https://copier.readthedocs.io/en/stable/).

## Features

This template supports a multitude of features for both frontend and backend:
This template supports a multitude of features for developing full-stack applications using official AlgoKit templates. Using the full-stack template, currently allows you to create a workspace that combines the following frontend template:

- [algokit-react-frontend-template](https://github.com/algorandfoundation/algokit-react-frontend-template) - A React web app with TypeScript, Tailwind CSS, and all Algorand specific integrations pre configured and ready for you to build.

And the following backend templates:

- [algokit-puya-template](https://github.com/algorandfoundation/algokit-puya-template) - An official starter for developing and deploying Puya smart contracts.
- [algokit-tealscript-template](https://github.com/algorand-devrel/tealscript-algokit-template) - An official starter for developing and deploying TealScript smart contracts.
- [algokit-beaker-default-template](https://github.com/algorandfoundation/algokit-beaker-default-template) - A production-ready baseline for developing and deploying Beaker smart contracts. Please note this template option is to be deprecated after `puya` is ready for production use.

### Frontend

Expand All @@ -36,7 +44,7 @@ This template supports a multitude of features for both frontend and backend:
### Backend

- Compilation of multiple Beaker contracts to a predictable folder location and file layout where they can be deployed.
- Compilation of multiple `puya`, `tealscript`, `beaker` contracts to a predictable folder location and file layout where they can be deployed.
- Deploy-time immutability and permanence control.
- [Poetry](https://python-poetry.org/) for Python dependency management and virtual environment management.
- Linting via [Ruff](https://github.com/charliermarsh/ruff) or [Flake8](https://flake8.pycqa.org/en/latest/).
Expand All @@ -47,11 +55,25 @@ This template supports a multitude of features for both frontend and backend:
- VS Code configuration (linting, formatting, breakpoint debugging).
- dotenv (.env) file for configuration.
- Automated testing of the compiled smart contracts.
- [Output stability](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/articles/output_stability.md) tests of the TEAL output.
- [Output stability](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/articles/output_stability.md) tests of the TEAL output. Artifacts folder is also available as standalone `examples` for anyone curious to see default instances of preset projects.
- CI/CD pipeline using GitHub Actions.

> Refer to the official [algokit-beaker-template](https://github.com/algorandfoundation/algokit-beaker-default-template) repository for up-to-date information on the backend template.
> Refer to the respective backend repository mentioned in [features](#features) for up-to-date information.
# Getting started
## Getting started

Once the template is instantiated you can follow the [README.md](template_content/README.md.jinja) file to see instructions for how to use the template.

### Interactive Wizard

**To initialize using the `algokit` CLI**:

- Execute the command `algokit init`. This initiates an interactive wizard that assists in selecting the most appropriate template for your project requirements.

**To initialize within GitHub Codespaces**:

- Follow these steps to leverage GitHub Codespaces for template selection:

1. Go to the [algokit-base-template](https://github.com/algorandfoundation/algokit-base-template) repository.
2. Initiate a new codespace by selecting the `Create codespace on main` option. This can be found by clicking the `Code` button, then navigating to the `Codespaces` tab.
3. Upon codespace preparation, `algokit` will automatically start `LocalNet` and present a prompt with the next steps. Executing `algokit init` will initiate the interactive wizard.
Loading

0 comments on commit 2ccd4cc

Please sign in to comment.