Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
feat: update backend and add just for commands (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman authored Jan 19, 2024
1 parent 0e49c9d commit 7b19762
Show file tree
Hide file tree
Showing 60 changed files with 591 additions and 782 deletions.
4 changes: 0 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
uses: actions/checkout@v3
- name: Init Hermit
uses: cashapp/activate-hermit@v1
with:
cache: true
- name: Get dependencies
working-directory: ./frontend/mobile
run: flutter pub get
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ build/
deploy/
.DS_Store
/logs/
generated_ftl_module.go
*.zip
dist/
go.work
go.work.sum
_ftl/
25 changes: 1 addition & 24 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,24 +1 @@
# This CODEOWNERS file denotes the project leads
# and encodes their responsibilities for code review.

# Instructions: At a minimum, replace the '@GITHUB_USER_NAME_GOES_HERE'
# here with at least one project lead.

# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.
# The format is described: https://github.blog/2017-07-06-introducing-code-owners/

# These owners will be the default owners for everything in the repo.
* @GITHUB_USER_NAME_GOES_HERE


# -----------------------------------------------
# BELOW THIS LINE ARE TEMPLATES, UNUSED
# -----------------------------------------------
# Order is important. The last matching pattern has the most precedence.
# So if a pull request only touches javascript files, only these owners
# will be requested to review.
# *.js @octocat @github/js

# You can also use email addresses if you prefer.
# docs/* [email protected]
* @alecthomas @wesbillman @worstell
164 changes: 2 additions & 162 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ There are many ways to be an open source contributor, and we're here to help you

* Propose ideas in our
[discord](https://discord.gg/tbd)
* Raise an issue or feature request in our [issue tracker](LINK_HERE) ___***FIX LINK AND REMOVE THIS NOTICE***___
* Raise an issue or feature request in [github](https://github.com/TBD54566975/ftl-examples/issues)
* Help another contributor with one of their questions, or a code review
* Suggest improvements to our Getting Started documentation by supplying a Pull Request
* Evangelize our work together in conferences, podcasts, and social media spaces.
Expand All @@ -17,167 +17,7 @@ ___***UPDATE TABLE OF PROJECT DEPS AND INSTALLATION NOTES***___

| Requirement | Tested Version | Installation Instructions |
|-------------|----------------|------------------------------------------------------|
| Go | 1.17.6 |[go.dev](https://go.dev/doc/tutorial/compile-install) |
| Mage | 1.12.1 |[magefile.org](https://magefile.org/) |
| Java | 17.0.2 | Below, recommended via [SDKMan](https://sdkman.io) |

### Go

This project is written in Go, a modern, open source programming language.

You may verify your `go` installation via the terminal:

```
$> go version
go version go1.17.6 darwin/amd64
```

If you do not have go, we recommend installing it by:

#### MacOS

##### Homebrew
```
$> brew install go
```

#### Linux

See the [Go Installation Documentation](https://go.dev/doc/install).

### Mage

The build is run by Mage.

You may verify your `mage` installation via the terminal:

```
$> mage --version
Mage Build Tool 1.12.1
Build Date: 2021-12-15T21:00:02Z
Commit: 2f1ec40
built with: go1.17.6
```

#### MacOS

##### Homebrew

```
$> brew install mage
```

#### Linux

Installation instructions are on the [Magefile home page](https://magefile.org/).

### Java

This project is written in Java, a typesafe, compiled programming language.

You may verify your `java` installation via the terminal by running `java -version`.

If you do not have Java, we recommend installing it
via [SDKMan](https://sdkman.io/install). This is a project which will allow you
to easily install the Java Development Kit (JDK), runtime (JRE), and related frameworks,
build tools, and runtimes.

After you've installed SDKMan, you may install Java:

#### SDKMan (cross-platform instructions)

```shell
$> sdk install java
...
Do you want java 17.0.2-open to be set as default? (Y/n): Y
Setting java 17.0.2-open as default.
```

You may test your installation:

```shell
$> java -version
openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)
```

---
**NOTE**

You may additionally look for other Java versions to install by running `sdk list java`:

...or other installation candidates like Apache Ant, Apache Maven, etc, by running `sdk list`.

Consult the SDKMan documentation for more info.

---

## Build (Mage)

```
$> mage build
```

## Build (Java / Gradle)

### macOS / Linux
```shell
$> ./gradlew build
```

### Windows
```shell
$> gradlew.bat build
```

## Test (Mage)

```
$> mage test
```

## Test (Java / Gradle)

### macOS / Linux
```shell
$> ./gradlew test
```

### Windows
```shell
$> gradlew.bat test
```

---
**NOTE**

You may also combine Gradle build targets in one call, like:

```shell
$> ./gradlew clean build test
```

---

## Communications

### Issues

Anyone from the community is welcome (and encouraged!) to raise issues via
[GitHub Issues](LINK_HERE) ___***FIX LINK AND REMOVE THIS NOTICE***___.

### Discussions

Design discussions and proposals take place in our [discord](https://discord.gg/tbd).

We advocate an asynchronous, written debate model - so write up your thoughts and invite the community to join in!

### Continuous Integration

Build and Test cycles are run on every commit to every branch on [CircleCI](LINK_HERE).

___***FIX LINK ABOVE AND REMOVE THIS NOTICE***___
| Hermit | v0.38.1 |[hermit](https://cashapp.github.io/hermit/usage/get-started/) |

## Contribution

Expand Down
7 changes: 7 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Start the FTL backend with hot-reloading
dev:
watchexec -r -e sql -- goreman -logtime=false -f Procfile.dev start

# Start the example web frontend for online-boutique
web:
cd frontend/web && npm install && npm run dev
4 changes: 4 additions & 0 deletions Procfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ftl: ftl serve --recreate --allow-origins '*'
backend: ftl dev backend/online-boutique/services
mobile_code_gen: ftl schema generate frontend/mobile/templates/ frontend/mobile/lib/api --watch=5s
web_code_gen: ftl schema generate frontend/web/templates/ frontend/web/src/api --watch=5s
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
# $PROJECT_NAME README
# FTL examples

Congrats, project leads! You got a new project to grow!
## Introduction

This stub is meant to help you form a strong community around your work. It's yours to adapt, and may
diverge from this initial structure. Just keep the files seeded in this repo, and the rest is yours to evolve!
This repo is designed to show how to use FTL to build an online boutique backend with a mobile (Flutter) app and React frontend.

## Introduction
## Running

* Install [Hermit](https://cashapp.github.io/hermit/usage/get-started/) and related [shell_hooks]([shell hooks](https://cashapp.github.io/hermit/usage/shell/)).

>[NOTE] This will install [Just](https://github.com/casey/just) for you.
To see a list of commands that can be run, run `just --list` in the root of the project.

### Start FTL, code gen, and backend services with hot-reloading

Orient users to the project here. This is a good place to start with an assumption
that the user knows very little - so start with the Big Picture and show how this
project fits into it. It may be good to reference/link the broader architecture in the
`collaboration` repo or the developer site here.
```bash
just dev
```

Then maybe a dive into what this project does.
### Start the React web app

Diagrams and other visuals are helpful here. Perhaps code snippets showing usage.
```bash
just web
```

Project leads should complete, alongside this `README`:
* [CODEOWNERS](./CODEOWNERS) - set project lead(s)
* [CONTRIBUTING.md](./CONTRIBUTING.md) - Fill out how to: install prereqs, build, test, run, access CI, chat, discuss, file issues
* [Bug-report.md](.github/ISSUE_TEMPLATE/bug-report.md) - Fill out `Assignees` add codeowners @names
* [config.yml](.github/ISSUE_TEMPLATE/config.yml) - remove "(/add your discord channel..)" and replace the url with your Discord channel if applicable
### Flutter app

The other files in this template repo may be used as-is:
* [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)
* [GOVERNANCE.md](./GOVERNANCE.md)
* [LICENSE](./LICENSE)
Flutter is better run via an [IDE](https://docs.flutter.dev/get-started/editor?tab=vscode) like VSCode or Android Studio.

## Project Resources

Expand Down
Loading

0 comments on commit 7b19762

Please sign in to comment.