Tico4Chain-Coders / POC-Trustless-Work

POC of a decentralized application (dApp) to enhance trust in agency-client relationships using blockchain. It enables trustless payments via smart contracts, securing funds in escrow until milestones are approved by clients. Stablecoins like USDC are used to ensure stability and ease of use.
5 stars 6 forks source link

frontend: Create an instance of axios #23

Open JoelVR17 opened 17 hours ago

JoelVR17 commented 17 hours ago

Issue - Create Axios Instance

You must apply through OnlyDust. If not, you'll be ignored

Description:

Create a custom Axios instance for centralized API calls, enabling easier configuration and usage across the application. The instance should be created in a new file structure: src/core/axios/http.ts. The purpose of this instance is to manage base configurations like the environment variable for the base URL, so that each endpoint call doesn’t require it explicitly. This should allow calls in the format: http.get, http.post, http.put, etc. Additionally, update all existing endpoints to utilize this instance.

Requirements:

  1. Create a folder named core inside src, and within it, a subfolder named axios.
  2. Create a file named http.ts in src/core/axios.
  3. In http.ts, create an Axios instance using axios.create() and configure it to use the environment variable for the base URL.
  4. Replace all existing endpoints in the project to use the new http instance for GET, POST, PUT, etc., calls.

Validations:

  1. Ensure the Axios instance correctly uses the base URL from the environment variable without requiring it in each endpoint call.
  2. Verify that all modified endpoints function correctly with the new http instance.
  3. Confirm that http.get, http.post, http.put, etc., methods are available and work as expected.

Tests:

  1. Test the new Axios instance by making calls to various endpoints and verifying expected responses.
  2. Test the instance with different HTTP methods (GET, POST, PUT, etc.) to ensure each one works as intended.
  3. Verify that each endpoint using the new instance still functions as it did before, ensuring seamless integration.

Recommendation:

Ensure the Axios instance is configured to handle common requirements such as headers and error handling, which will make it easier to maintain and extend in the future.

⚠️ Please follow the guidelines for requesting an issue, launching commits, and describing PRs. Otherwise, they will be ignored. ⚠️

Benjtalkshow commented 6 hours ago

I am a Full Stack Developer with a strong background in blockchain and extensive experience in Next.js/React, TypeScript, and Rust. I’ve made over 45 contributions to over 15 projects in the OnlyDust ecosystem, solving complex issues and delivering efficient, scalable solutions.

Let me work on this issue and deliver in the next 12 hrs

petersdt commented 5 hours ago

Can I be assigned to this?

martinvibes commented 5 hours ago

Can I take care of this issue? i'm a frontend dev, and a blockchain dev kindly assign :)

Michaelkingsdev commented 5 hours ago

Could I take over this issue?

austineblaise commented 4 hours ago

This is my first time contributing to OnlyDust, and I’m a JavaScript + TypeScript blockchain developer. I will create an Axios instance in src/core/axios/http.ts to centralize API calls, using the environment variable for the base URL. I’ll update all existing endpoints to use this instance and test it to ensure all methods (GET, POST, PUT, etc.) work as expected. Additionally, I’ll ensure the instance handles headers and error handling for easier maintenance.

KevinLatino commented 4 hours ago

Hello @JoelVR17 My name is Kevin Latino, and I'm a Frontend Developer and active open-source contributor. I'm a member of Dojo Coding ⛩️, a thriving Web3 community in Costa Rica. I have experience with React, Next.js, and TypeScript, also I have experience in data fetching and API integrations and I recently won the LATAM Hackathon hosted by Base. I've also contributed to projects in ecosystems like Starknet and Stellar.

I will create a custom Axios instance to streamline API calls across the application. This instance will be set up in src/core/axios/http.ts, where it will utilize the environment variable for the base URL to avoid needing it in each endpoint call. This instance will allow for simplified HTTP requests using methods like http.get, http.post, and http.put. I will update all existing API endpoints to use this centralized Axios instance. I will also ensure that the instance is correctly configured, functions with the appropriate HTTP methods, and that all updated endpoints are tested for seamless integration.

melnikga commented 3 hours ago

Can I contribute to this one? Hi, my name is Georgiy, I'm a fullstack blockchain developer. I have extensive experience in developing tools for Starknet, and I've participated in almost all ODHacks, during which I worked on many projects. My OnlyDust profile: https://app.onlydust.com/u/melnikga ETA: 2 days

od-hunter commented 3 hours ago

To solve this issue I'll: 1.I'll create Axios Instance-src/core/axios/http.ts

  1. I'll replace direct calls to axios with the custom http instance.
  2. I'll unit Test Axios Calls.

Kindly assign please

gadgray commented 2 hours ago

Can I contribute to this one?

Amarjeet325 commented 2 hours ago

I'd love to work on this!

mariocodecr commented 1 hour ago

Hii! My name is Mario Araya, I’m a Software Developer with 2+ years of experience. I have worked with backend technologies such as Cairo, Java, and C#, as well as frontend development using React, NextJS, and JavaScript/TypeScript. I’ve made contributions to open-source projects, completed a Starknet Bootcamp, exercises on NodeGuardians, finished Starklings, and participated in multiple hackathons. I’m also a member of the Dojo Coding community here in Costa Rica.

I will create a custom Axios instance to centralize API calls and streamline configuration management. I will create a src/core/axios/http.ts file and use axios.create() to configure the instance with a base URL derived from the environment variable. This will ensure that each API call doesn't need to explicitly include the base URL. I will also update all existing endpoint calls in the project to utilize this new Axios instance (http.get, http.post, http.put, etc.). The instance will be configured to handle common requirements like headers and error handling. I will test the new instance with different HTTP methods to ensure the functionality is intact and that it integrates seamlessly with the existing endpoints.

JoelVR17 commented 1 hour ago

This issue is for you @KevinLatino! 🚀 Remember to follow all the guidelines, both the ones inside the repository and the guideline to perform the PR.

Many thanks to all the other dev's who sent in their application.