Skip to content

Commit

Permalink
Merge branch 'main' of github.com:input-output-hk/wsc-poc into amir/d…
Browse files Browse the repository at this point in the history
…eploy-all
  • Loading branch information
amirmrad committed Jan 9, 2025
2 parents 32d12f9 + 7ae90f2 commit 88b78c6
Show file tree
Hide file tree
Showing 54 changed files with 8,650 additions and 42 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-compiled-scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ jobs:
# git diff --quiet implies --exit-code
run: |
cabal run export-smart-tokens
cabal run write-openapi-schema -- generated/openapi/schema.json
git diff --quiet
48 changes: 43 additions & 5 deletions .github/workflows/ci-oci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,48 @@ name: "ci-oci"
on:
pull_request:
push:
branches:
- main
tags:
- "v*"

permissions:
packages: write

env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}

concurrency:
group: "ci-oci-${{ github.ref }}"
cancel-in-progress: true

jobs:
tests:
strategy:
matrix:
image: [wst, wst-poc-mock-server]
runs-on: ubuntu-latest
steps:

- name: Determine image tag for git tag
if: ${{ github.event_name == 'push' }}
run: |
IMAGE_TAG=$(git rev-parse --abbrev-ref "${{ github.event.push.ref }}")
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
- name: Determine image tag for PR
if: ${{ github.event_name == 'pull_request' }}
run: |
IMAGE_TAG=pr-${{ github.event.pull_request.number }}
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
- name: Log in to ghcr.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_REGISTRY }}

- uses: actions/checkout@v4

- name: Install nix
Expand All @@ -44,7 +74,15 @@ jobs:
# except the version with the `primary-key`, if it exists
purge-primary-key: never

- run: nix build --accept-flake-config .#containers.x86_64-linux.wst.copyTo
- run: ./result/bin/copy-to oci-archive:oci.tar
- run: ls -alh oci.tar
# TODO: matrix build for two images (mock server and wst)
- name: Build image with nix
run: nix build --accept-flake-config .#containers.x86_64-linux.${{ matrix.image }}.copyTo
- name: Publish tagged image with podman
run: |
IMAGE_NAME=ghcr.io/${{github.repository_owner}}/${{ matrix.image }}:$IMAGE_TAG
./result/bin/copy-to oci-archive:oci.tar
IMAGE_HASH=$(podman load --quiet -i oci.tar | sed 's/.*sha256://')
podman tag $IMAGE_HASH $IMAGE_NAME
podman push $IMAGE_NAME
55 changes: 55 additions & 0 deletions flake.lock

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

7 changes: 5 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@
url = "github:colll78/plutarch-plutus/b2379767c7f1c70acf28206bf922f128adc02f28";
};

# Must use a version compatible with the pinned `cardano-node` version.
# Check release notes of `cardano-node` version for correct `cardano-cli` version.
cardano-cli = {
url = "github:intersectmbo/cardano-cli?ref=cardano-cli-10.1.0.0";
};

n2c = {
url = "github:nlewo/nix2container";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs: inputs.iogx.lib.mkFlake {
Expand Down
3 changes: 3 additions & 0 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
}
36 changes: 36 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
52 changes: 52 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Front-End Guide

This is a front-end web application for the Cardano Wyoming stable token poc that was built using [Next.js](https://nextjs.org/), TypeScript, MUI, and Zustand.

## Getting Started

### Running the Application

To get the application running, follow these steps:

1. Clone the repository:
```bash
git clone https://github.com/yourusername/yourrepository.git
```

2. Navigate to the `frontend` folder:
```bash
cd yourrepository/frontend
```

3. Install the necessary packages:
```bash
npm install
```

4. First, run the development server:
```bash
npm run dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

### Project Structure

The template is organized as follows:

- **`frontend`**: The main application directory.
- **`public`**: Contains public assets like HTML and images.
- **`src/app`**: Contains the main source code for the application.
- **`components`**: Reusable React components.
- **`styles`**: Global styles and theme configuration.
- **`store`**: Minimal lightweight store for global variables, functions, and types.


### Deploy on Vercel (optional)

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

### Contributing

If you have any suggestions or improvements, feel free to open an issue or create a pull request. Contributions are always welcome!
14 changes: 14 additions & 0 deletions frontend/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @type {import('next').NextConfig} */
const nextConfig =
{ async rewrites() {
return [
{
source: '/api/v1/:path*',
destination: 'http://localhost:8080/:path*' // Proxy to Backend
}
]
},
output: 'export'
};

export default nextConfig;
Loading

0 comments on commit 88b78c6

Please sign in to comment.