Universal HEX API is a backend service for the Hybrid Exchange for Universal Assets. It provides a robust API infrastructure to manage and track cross-chain assets, their relationships, and associated metadata.
- Get indexed Universal Assets data from The Graph Aerodrome Base Subgraph
- Process the data and return it in a structured format to be consumed by the Universal Hex Frontend
- Deploy API to a cloud provider (maybe render free tier or something similar) to make it easier check out
- Add quotes feature
- Add chain info to the assets, its currently on db but not propagated to through the services
- The subgraph we are using seems not to be tracking all the assets. Switching the indexing solution or perhaps implementing a custom indexing solution would be good.
- Implement a caching layer to reduce the number of requests to the subgraph
- Stop relying on coingecko images, upload token images somewhere
To run the project using Docker Compose, follow these steps:
- Clone the repository
- Navigate to the project directory
- Run the following command:
$ docker-compose up -dThis will start the PostgreSQL database, run the migrations, seed the database, and start the backend and frontend services.
- Visit
http://localhost:8000/apito access the API. - Visit
http://localhost:3000to access the frontend.
-
Clone the repository
-
Install dependencies:
$ pnpm install-
Set up environment variables:
- Copy
.env.exampleto.env - Update the variables according to your environment:
NODE_ENV=development PORT=3000 DATABASE_URL=postgresql://postgres:postgres@localhost:5433/universal-hex THE_GRAPH_API_KEY=your_api_key
- Copy
-
Start the database:
$ docker-compose up postgres -d- Generate Prisma client:
$ pnpm prisma generate- Run database migrations:
$ pnpm prisma migrate dev- Seed the database:
$ pnpm run seed# development
$ pnpm run start
# watch mode
$ pnpm run start:dev
# production mode
$ pnpm run start:prodOnce the application is running, you can access the Swagger API documentation at:
http://localhost:8000/api
