Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anataliocs/stellar-horizon-demo-app
https://github.com/anataliocs/stellar-horizon-demo-app
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/anataliocs/stellar-horizon-demo-app
- Owner: anataliocs
- Created: 2024-05-30T17:22:17.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-06-03T07:07:24.000Z (6 months ago)
- Last Synced: 2024-06-03T08:57:22.911Z (6 months ago)
- Language: TypeScript
- Size: 3.63 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stellar Horizon SDK Demonstration
__Goal:__ Get account details using Stellar Horizon API Javascript SDK
Uses the Stellar Horizon SDK
## Tech Stack
- [Next.js](https://nextjs.org/docs)
- [Tailwind CSS](https://tailwindcss.com/)
- Zustand## Run Locally
Install dependencies
```bash
yarn
```### Run the Project
```bash
yarn dev
```
Go to http://localhost:3000### 2. Environment Variables
Create environment variables file
```bash
touch .env
```## Components
`pages/index.tsx`
- Home page Component
- imports Message.tsx and Button.tsx components`pages/api/auth.ts`
- Next.js API file
- Making a `POST` request to `http://localhost:3000/api/account` using the Stellar SDK to get account details`helpers/store.ts`
- This file sets up our zustand store. [Zustand](https://github.com/pmndrs/zustand) is a "small, fast and scalable bearbones state-management solution using simplified flux principles."`components/Button.tsx`
- Button component that changes depending on the users actions
- Button onClick functions for each state of the button`components/Message.tsx`
- Message component displays the primary text to the user, which changes depending on the users actions