Skip to content

Commit

Permalink
Merge pull request #1 from Jehosephat/no-backend
Browse files Browse the repository at this point in the history
Removing the backend and making this just a vue/vite app
  • Loading branch information
Jehosephat authored Sep 13, 2024
2 parents 1bdf47e + 0d46035 commit a0ea005
Show file tree
Hide file tree
Showing 52 changed files with 1,576 additions and 13,805 deletions.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@ nest-cli.json
.env
dist

# Gala Chain specific (if needed)
# Add any Gala Chain specific files or directories to ignore
# Dependency directories
node_modules/

# Other
TODO.md
88 changes: 30 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,23 @@
# gala-faucet
Lightweight app that allows users to burn GALA tokens on mainnet in order to get GALA tokens on testnet
# Gala Faucet

## Setup and Installation

### Prerequisites
- Node.js (v14 or later)
- npm or yarn
- Git
A lightweight application that allows users to burn GALA tokens on mainnet in order to receive GALA tokens on testnet.

### Clone the repository
```bash
git clone https://github.com/your-username/gala-faucet.git
cd gala-faucet
```
## Project Structure

### Backend Setup
1. Navigate to the backend directory:
```bash
cd gala-faucet-backend
```
This project consists of a single frontend application built with Vue.js and Vite.

2. Install dependencies:
```bash
npm install
```
## Prerequisites

3. Create a `.env` file in the `gala-faucet-backend` directory with the following content:
```
CHAIN_TESTNET_API_BASE_URL=https://int-galachain-gateway-chain-platform-stage-chain-platform-eks.stage.galachain.com
CHAIN_MAINNET_API_BASE_URL=https://int-galachain-gateway-chain-platform-stage-chain-platform-eks.stage.galachain.com
FAUCET_MULTIPLIER=100
FRONTEND_URL=http://localhost:3000
FAUCET_ADMIN_PRIVATE_KEY=0x...
```
Replace the placeholders with your actual values.
- Node.js (v14 or later)
- npm or yarn
- Git

4. Start the backend server:
```bash
npm run start:dev
```
## Setup and Installation

### Frontend Setup
1. Navigate to the frontend directory:
1. Clone the repository:
```bash
cd gala-faucet-frontend
git clone https://github.com/jehosephat/gala-faucet.git
cd gala-faucet
```

2. Install dependencies:
Expand All @@ -53,36 +27,34 @@ Lightweight app that allows users to burn GALA tokens on mainnet in order to get

3. Create a `.env` file in the `gala-faucet-frontend` directory with the following content:
```
VITE_APP_API_URL=http://localhost:3001
VITE_MAINNET_API=(TBD, can use TESTNET api for now)
VITE_TESTNET_API=https://galachain-gateway-chain-platform-stage-chain-platform-eks.stage.galachain.com
VITE_FAUCET_MULTIPLIER=100
VITE_FAUCET_ADMIN_PRIVATE_KEY=0x...
```
Replace the placeholders with your actual values.

4. Start the frontend development server:
```bash
npm run dev
```

## Usage
1. Open your browser and navigate to `http://localhost:3001` (or the port specified by Vite).

1. Open your browser and navigate to `http://localhost:3000` (or the port specified by Vite).
2. Connect your wallet using the "Connect Wallet" button.
3. Enter the amount of GALA tokens you want to burn on mainnet.
4. Click "Burn GALA" to initiate the transaction.
5. Once the transaction is confirmed, you'll receive an amount of GALA tokens on the testnet equal to the amount of GALA tokens you burned on mainnet times the multiplier set in the .env file.
3. Once connected, you'll see your GALA balance on both mainnet and testnet.
4. Enter the amount of GALA tokens you want to burn on mainnet.
5. Click "Burn GALA" to initiate the transaction.
6. Once the transaction is confirmed, you'll receive an amount of GALA tokens on the testnet equal to the amount of GALA tokens you burned on mainnet times the multiplier set in the .env file.

## Modifying the Application

### Backend
- The main service logic is located in `gala-faucet-backend/src/app.service.ts`.
- To modify the API endpoints, edit `gala-faucet-backend/src/app.controller.ts`.
- Add new dependencies in `gala-faucet-backend/package.json`.

### Frontend
- The main application component is in `gala-faucet-frontend/src/App.vue`.
- Individual components are located in `gala-faucet-frontend/src/components/`.
- To modify the Wallet interactions, edit `BurnGala.vue` and `WalletConnect.vue`.
- Styling can be adjusted in the `<style>` sections of the Vue components or in separate CSS files.

## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- The main application component is in `src/App.vue`.
- Individual components are located in `src/components/`:
- `WalletConnect.vue`: Handles wallet connection
- `Balance.vue`: Displays GALA balance for mainnet and testnet
- `BurnGala.vue`: Handles the burning and minting process
- Environment variables are defined in the `.env` file and typed in `src/env.d.ts`.
- The Vite configuration is in `vite.config.js`.

## License
[MIT License](LICENSE)
File renamed without changes.
25 changes: 0 additions & 25 deletions gala-faucet-backend/.eslintrc.js

This file was deleted.

4 changes: 0 additions & 4 deletions gala-faucet-backend/.prettierrc

This file was deleted.

73 changes: 0 additions & 73 deletions gala-faucet-backend/README.md

This file was deleted.

Loading

0 comments on commit a0ea005

Please sign in to comment.