bitcoin-sv / bsv-faucet

https://bsvfaucet.org
MIT License
1 stars 12 forks source link

A06 Admin: Admin page #13

Closed mo-jaber closed 1 month ago

mo-jaber commented 1 month ago

Description: For admins (role = 2) there will be a dedicated section /admin to allow them to see and manage the overall treasury.

Related to: https://github.com/bitcoin-sv/bsv-faucet/issues/17

Acceptance Criteria:

  1. Ensure the database schema structure is created and migration scripts run.
raizo07 commented 1 month ago

Hello @mo-jaber can I be assigned to work on this?

SudiptaPaul-31 commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, I’m Sudipta Paul, a full-stack developer with 1.5 years of experience in blockchain development. I would like to contribute by implementing the admin page functionality for managing the treasury.

How I plan on tackling this issue

Approach to tackle this issue:

I will create a secure /admin route that is only accessible by users with the role = 2 (admin). This will ensure that only admins can access the treasury management features.

I will retrieve the total reserves from the master wallet using the backend API and display the total in both Bsv and satoshis. I will ensure proper formatting for readability .

I will implement a balance check to trigger an alert if the total reserves drop below 10 BSV. This alert will notify admins to take appropriate action to top up the treasury. The alert will be displayed prominently on the page. Testing and Security:

Will thoroughly test the functionality, ensuring that the balance is accurately displayed and that the low balance alert is triggered correctly. Additionally, I will ensure that only admins can access the /admin page, using proper auth techniques.

0xdevcollins commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, I'm Collins a frontend and blockchain developer, and an active contributor on OnlyDust. You can check out my profile here: https://app.onlydust.com/u/0xdevcollins. This is my first time contributing to this repository, and I’m excited about the opportunity to contribute. Looking forward to collaborating!

How I plan on tackling this issue

To tackle this issue, I would first create a dedicated /admin section that only admins (role = 2) can access. In this section, I’ll display the total treasury reserves from the master wallet in both BSV and Satoshis for clarity.

I’ll implement a real-time check on the wallet balance, and if the reserves drop below 10 BSV, an alert will be triggered to notify the admin. This alert could be displayed prominently at the top of the page or as a pop-up to ensure the admin is aware of the low balance.

melnikga commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, my name is Georgiy, I'm a frontend 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

How I plan on tackling this issue

I would create a dedicated section that displays treasury information, showing the total balance in both BSV and Satoshis. I'd add a simple alert component that appears when the balance drops below 10 BSV. To make it look clean and professional, I would use shadcn components for the balance display and the alert. For the server side, I'd add the necessary API endpoint to fetch wallet data, making sure only users with admin role can access it.

Benjtalkshow 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 specializing in Next.js, TypeScript, Node.js, Cairo and Rust . With over 31 contributions across projects in the OnlyDust ecosystem, I’ve developed strong proficiency in delivering high-quality solutions and resolving complex issues within tight deadlines. My experience spans frontend, backend, smart contracts, and the optimization and maintenance of scalable codebases.

How I plan on tackling this issue

I will develop a dedicated section for admins (role = 2) at /admin, where they can easily monitor and manage the overall treasury. The total treasury reserves will be fetched from the master wallet and displayed prominently, with the balance shown in both BSV and Satoshis for clarity. Also I will implement an alert system that triggers a warning if the balance drops below 10 BSV, ensuring that admins are promptly notified when the reserves are running low. This will help prevent potential issues with insufficient funds. The admin interface will be user-friendly, offering clear visuals and intuitive navigation to streamline treasury management.

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'm Dprof-in-tech, a seasoned Full Stack Blockchain Developer, and I'm excited to be part of ODHACK 9! I have a strong foundation in technologies such as Next.js, TypeScript, JavaScript, React, Node.js, Rust, and Cairo, I've built extensive experience across the blockchain development landscape.

I first got involved with OnlyDust during Edition 2, and since then, I've made 39 contributions across 11 different projects. Working on the platform has really helped me sharpen my skills, especially when it comes to delivering great solutions under tight deadlines. I love combining technical know-how with a user-focused approach, whether it's building immersive 3D experiences or crafting smart contracts that solve real-world problems.

Throughout, I've consistently demonstrated the ability to adapt and contribute effectively to diverse challenges. I'm confident in my ability to tackle new problems and drive innovation within the blockchain space. As we kick off ODHACK 9, I'm eager to apply my previous experience and technical expertise to push the boundaries of what's possible.

You can view my public profile on OnlyDust here: https://app.onlydust.com/u/Dprof-in-tech

How I plan on tackling this issue

Here's my approach to implementing the admin treasury management page:

  1. Admin Panel Setup:

    • I'll create a protected /admin route using role-based authentication (role = 2)
    • Implement a clean, dashboard-style layout
    • Add proper error handling for unauthorized access
  2. Treasury Display Implementation:

    • Connect to BSV blockchain to fetch master wallet balance
    • Set up real-time balance updates using WebSocket
    • Display balance in both BSV and Satoshis formats: The display formula would look something like this: const formatBalance = (balance) => ({ bsv: balance / 100000000, satoshis: balance });

Please note, this is purely conceptual right now

  1. Low Balance Alert System:

    • Set up a threshold check (10 BSV)
    • Create an alert component for low balance warning
    • Add visual indicators (red warning banner)
    • Implement optional push notifications for admins
    • Store alert preferences in admin settings
  2. Security Measures:

    • Implement rate limiting for balance checks
    • Add audit logging for admin access
    • Secure API endpoints with proper authentication
    • Add session timeout for security

Testing Plan:

Expected Timeline: 3-4 days

mexes20 commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello can I be assigned to work on this?

ETA: One day

ShantelPeters commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have extensive experience in full-stack development, with a strong focus on creating administrative interfaces that allow for effective management of system resources and user interactions. My familiarity with financial applications and wallet management gives me the knowledge needed to handle treasury reserves securely. Additionally, I am well-versed in building responsive web interfaces and integrating real-time data updates, ensuring that admins can monitor treasury reserves effectively.

How I plan on tackling this issue

To implement the admin treasury management feature, I will create an /admin section specifically for users with an admin role (role = 2). This section will fetch and display the total treasury reserves from the master wallet, converting the balance into both BSV and Satoshis for clarity.

I will implement an alert system that triggers when the treasury balance falls below 10 BSV, ensuring that admins are promptly notified of low reserves. This alert could be displayed as a visual indicator (e.g., a red warning banner) on the dashboard.

For data accuracy, I will set up a periodic update mechanism to refresh the treasury balance, ensuring that the information is current. Additionally, I will include testing to verify that the treasury balance is correctly displayed and that alerts function as intended. Finally, I will ensure the interface is user-friendly and accessible, with clear instructions on managing the treasury reserves.

aniruddhaaps commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a python dev . A new-comer here, willing and ready to contribute to solve the issue.

LazarusAA commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, I'm Alvaro Lazarus a Blockchain developer from Dojo Coding with a good amount of experience on both TypeScript and JavaScript, I would love to contribute to this project and this seems like a really fun issue to tackle.

How I plan on tackling this issue

Benjtalkshow commented 1 month ago

@mo-jaber Thanks. Will start working on this asap.

Benjtalkshow commented 1 month ago

Hello @mo-jaber I am waiting for #17 to finish up.

Any other available issues I can be working on?

Benjtalkshow commented 1 month ago

@mo-jaber i messaged you on telegram

PoulavBhowmick03 commented 1 month ago

Can I take this up? I will initially add a mock data for now to be shown in place of the master wallet till the time it is implemented. I will work on the UI part to make it look good and professional. I will use the bsv ts sdk and the wallet to show the BSV and Satoshis from the wallet and will add an alert using shadcn UI toast to show when the balance is below 10 BSV, since the project uses shadcn already

ETA- 3 days

mo-jaber commented 1 month ago

Thanks @PoulavBhowmick03