Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: init wizard v2 improvements #19

Merged
merged 48 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
9de5ac3
chore: wip
aorumbayev Feb 10, 2024
5ae6ae3
chore: test
aorumbayev Feb 10, 2024
5a60abb
chore: test
aorumbayev Feb 10, 2024
cf00396
chore: test
aorumbayev Feb 12, 2024
b2c57ba
chore: test
aorumbayev Feb 12, 2024
e8a4229
chore: wip
aorumbayev Feb 16, 2024
d90f791
chore: test
aorumbayev Feb 19, 2024
17a0334
chore: test
aorumbayev Feb 19, 2024
47956b9
chore: minor tweaks
aorumbayev Feb 19, 2024
0d40aad
chore: minor tweaks
aorumbayev Feb 20, 2024
1e67889
chore: minor tweaks
aorumbayev Feb 20, 2024
7015cc4
chore: minor tweaks
aorumbayev Feb 20, 2024
c5891d5
chore: minor tweaks
aorumbayev Feb 20, 2024
be4ab80
chore: minor tweaks
aorumbayev Feb 20, 2024
9549683
chore: wip reorg examples; refine tests
aorumbayev Feb 20, 2024
28030c0
refactor: refine tests; readme
aorumbayev Feb 20, 2024
8342e0c
docs: minor tweaks
aorumbayev Feb 20, 2024
49bcded
chore: minor tweaks
aorumbayev Feb 20, 2024
34f1518
chore: tweaking copier
aorumbayev Feb 20, 2024
5f88e44
chore: wip
aorumbayev Feb 21, 2024
f6a6784
chore: wip
aorumbayev Feb 21, 2024
3c106df
chore: regen examples
aorumbayev Feb 21, 2024
685a542
chore: refining preset question
aorumbayev Feb 21, 2024
c0c3703
chore: regen artifacts
aorumbayev Feb 21, 2024
2b880a7
chore: testing ci
aorumbayev Feb 21, 2024
a2e8665
chore: testing ci
aorumbayev Feb 21, 2024
7187086
chore: testing ci
aorumbayev Feb 21, 2024
ea54e18
chore: testing ci
aorumbayev Feb 21, 2024
2bc729b
chore: testing ci
aorumbayev Feb 21, 2024
c03c542
chore: refinements
aorumbayev Feb 21, 2024
04013d6
chore: minor refinements
aorumbayev Feb 21, 2024
a8ea4b1
chore: minor tweaks
aorumbayev Feb 21, 2024
bc3e7c9
chore: minor tweaks in copier
aorumbayev Feb 21, 2024
7ee3f14
chore: regen artifacts
aorumbayev Feb 21, 2024
de5a548
chore: restoring workflow git tweaks
aorumbayev Feb 21, 2024
4cacd81
chore: remove zendesk actions
aorumbayev Feb 21, 2024
c0c4863
refactor: addressing pr comments
aorumbayev Feb 21, 2024
69919d1
chore: regen artifacts
aorumbayev Feb 21, 2024
d991506
chore: patching tests
aorumbayev Feb 21, 2024
c097e5a
chore: regen artifacts
aorumbayev Feb 21, 2024
ae3e804
chore: fix tests
aorumbayev Feb 21, 2024
79ddee0
fix: patching brackets for str answer params
aorumbayev Feb 21, 2024
7858f59
chore: refining invocation of base template
aorumbayev Feb 22, 2024
fb0b200
chore: regen docs
aorumbayev Feb 22, 2024
c97e131
chore: enforce min version from template side
aorumbayev Feb 23, 2024
cc36fd9
chore: minor improvements in check_algokit_version script
aorumbayev Feb 26, 2024
d508d04
chore: fixing compatibility issues with pyyaml and 3.12
aorumbayev Feb 26, 2024
d25995e
chore: temporary reverting to older cli version
aorumbayev Feb 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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