lfglabs-dev / api.starknet.quest

starknet.quest rust backend
7 stars 28 forks source link

Admin routes for custom_api tasks #266

Closed Marchand-Nicolas closed 1 month ago

Marchand-Nicolas commented 1 month ago

Description

Implement the necessary admin routes to create and edit a new custom_api task type.

PROPOSED TODO

    let new_document = QuestTaskDocument {
        name: body.name.clone(),
        desc: body.desc.clone(),
        verify_redirect: None,
        href: body.href.clone(),
        total_amount: None,
        quest_id: body.quest_id,
        id: next_id,
        cta: body.cta.clone(),
        verify_endpoint: "quests/verify_custom_api".to_string(),
        verify_endpoint_type: "default".to_string(),
        task_type: Some("custom_api".to_string()),
        discord_guild_id: None,
        quiz_name: None,
        contracts: None,
        api_url: Some(body.api_url),
        regex: Some(body.regex),
    };
NueloSE commented 1 month ago

hi @Marchand-Nicolas kindly assign this task to me. it would be nice if i can make it my first contribution to this repo

onlydustapp[bot] commented 1 month ago

Hi @NueloSE! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

mubarak23 commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a Experience Cairo smart contract developer with experience working on projects such as Just Art Peace, Dojo, Kart, TBA, and Shinigami. Before transitioning to Cairo development, I was a backend developer specializing in Rust.

My recent work with cairo starknet

My recent work with rust

How I plan on tackling this issue

I have read the description

This issue, am going to create two endpoints

ETH: 16HRS

PabloVillaplana commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a Full Stack developer with 6 years of experience in the industry, I am super excited to be able to contribute to Web 3 projects, this to continue paving my way as an Open Source Contributor. I am from Dojo Coding Community

How I plan on tackling this issue

I would like to contribute again to Starknet Quest with this issue, I have to do a little research, but I would like to be able to contribute to this issue in Cairo, since it would help me a lot to be able to raise my level in Starknet.

Dprof-in-tech commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello, i am Dprof-in-tech, an experienced Full Stack Blockchain Developer and I am excited to contribute my skills to the {project name} project in this ODHACK 8. With a strong background in Next.js, TypeScript, JavaScript, React, Node.js, Rust and Cairo, I've honed my technical skills across the blockchain development landscape. My journey with OnlyDust began at Edition 2, and I've since made 34 contributions across 11 projects. This extensive experience on the platform has allowed me to develop a keen understanding of delivering high-quality solutions under tight deadlines. Due to my web2 experience, i am skilled in writing unit tests and have used Jest and Vitest to do this. I would love to contribute to this project by solving this issue. Below is a link to my OnlyDust public profile. https://app.onlydust.com/u/Dprof-in-tech

How I plan on tackling this issue

To solve this issue, i would :

  1. I’ll create a custom_api folder under the admin directory, with routes for create_custom_api and update_custom_api.

  2. The new task document will be updated to include the api_url and regex fields alongside existing fields like name, description, etc.

  3. I’ll also add these fields to the database schema, ensuring we store them correctly.

  4. The create route will allow creating tasks with the custom_api type, while the update route will handle modifying existing tasks.

  5. Finally, I’ll implement the necessary logic to interact with the database for task creation and updates, making sure the new fields are properly handled.

Once this is done, I’ll run tests to confirm everything is working as expected.

I’ll be sure to follow the guidelines as given and work to tender my solution as soon as possible.

GoSTEAN commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have experience in backend development, specifically in creating and managing API routes using frameworks like Node.js, Rust, and TypeScript. I’ve worked on similar task management systems, where I handled database integration and ensured routes were properly set up to handle custom data. My familiarity with task-based APIs and database schemas will help me effectively implement and extend the custom API task type as required.

How I plan on tackling this issue

I would begin by creating the necessary folder and routes for create_custom_api and update_custom_api. Then, I’d add the api_url and regex fields to the request body and ensure they are correctly stored in the task document within the database. I’d update the QuestTaskDocument type to include these optional fields if they aren't already present. Finally, I would test the endpoints to ensure they function correctly with the new fields and integrate seamlessly with the existing API structure.

GideonBature commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a Software Engineer with experience in building a complete backend in Rust using RESTful API. I also have experience working with JavaScript and TypeScript.

How I plan on tackling this issue

First of all I will look at the code base and understand the structure, next I will look at other tasks type that are already present and implemented in the codebase to see the pattern used and know which kind of database that is used, this will guide me to know how I am going to structure my own code and implementation. Finally, I will add the api_url and the regexstring as fields in the already existing QuestTaskDocument struct.

Adding them as an option means they can either be present as value or None.

onlydustapp[bot] commented 1 month ago

The maintainer Marchand-Nicolas has assigned GideonBature to this issue via OnlyDust Platform. Good luck!

GideonBature commented 1 month ago

Thank you @Marcmehand-Nicolas...

Marchand-Nicolas commented 1 month ago

Done here https://github.com/lfglabs-dev/api.starknet.quest/pull/272