DEV Community

Cover image for πŸš€ Midnight Challenge | Build & Run a Sample dApp with React, Flask & Docker
Pravesh Sudha
Pravesh Sudha Subscriber

Posted on • Edited on

πŸš€ Midnight Challenge | Build & Run a Sample dApp with React, Flask & Docker

Midnight Network Challenge: Enhance the Ecosystem

This is a submission for the Midnight Network "Privacy First" Challenge - Enhance the Ecosystem prompt

What I Built

I built a beginner-friendly tutorial and sample dApp that demonstrates how developers can interact with a Midnight-like blockchain environment.

The project simulates wallet balances and transactions using lightweight mock services, paired with a React frontend. This allows developers to understand the flow of building a dApp β€” from backend services to UI integration β€” without needing the full complexity of setting up a live Midnight node.

The tutorial lowers the barrier to entry by providing:

  • A step-by-step YouTube video walkthrough
  • A Dockerized setup for easy spin-up
  • Clean and well-documented React + API code
  • A working demo of sending transactions and fetching balances

This way, developers can learn the concepts and workflows of building on Midnight, then extend or replace the mocks with real Midnight tools when ready.


Demo

πŸ”— GitHub Repository (change dir to midnight-challenge):

πŸ—οΈ Dev.to Challenges – by Pravesh Sudha

This repository contains my submissions for various Dev.to Challenges. Each folder in this repo includes a hands-on project built around specific tools, APIs, or themes β€” from infrastructure to frontend and AI voice agents.


πŸ“ Projects

βš™οΈ pulumi-challenge/

An infrastructure-as-code project built using Pulumi.
It automates cloud infrastructure setup using Python and TypeScript across AWS services.

🎨 frontend-challenge/

A UI/UX-focused project that demonstrates creative frontend solutions using HTML, CSS, and JavaScript β€” optimized for responsiveness and accessibility.

πŸ“© postmark-challenge/

A transactional email solution built with the Postmark API, showcasing email templates, delivery tracking, and webhook handling.

🧠 philo-agent/

A voice-based AI Philosopher built with AssemblyAI + Gemini β€” part of the World’s Largest Hackathon.


πŸ—‚οΈ Project Structure

dev-to-challenges/
β”‚
β”œβ”€β”€ pulumi-challenge/
β”œβ”€β”€ frontend-challenge/
β”œβ”€β”€ postmark-challenge/
β”œβ”€β”€ philo-agent/
└── README.md
Enter fullscreen mode Exit fullscreen mode

πŸ™Œ Why This Repo?

This repo is my playground to:

  • …

▢️ YouTube Video Walkthrough:

Application Logs:

Application UI:


How I Used Midnight's Technology

Instead of directly integrating with Midnight (which requires a more advanced setup), I built mock connectors and an indexer that emulate Midnight-like services.

The tutorial introduces developers to:

  • Connector mock β†’ simulates how dApps send transactions
  • Indexer mock β†’ simulates how balances and data can be queried
  • React dApp frontend β†’ provides a wallet + transaction flow for interaction

By following this tutorial, developers learn the patterns of Midnight development β€” transaction flow, balance querying, and UI wiring β€” without worrying about infrastructure overhead. Once familiar, they can swap the mocks for actual Midnight SDKs or APIs, making the transition seamless.


Developer Experience Improvements

One of the biggest hurdles for new developers in blockchain ecosystems is onboarding β€” the process of setting up environments, understanding the transaction flow, and connecting frontend applications to backend services.

This tutorial improves the developer experience by:

  • Reducing setup friction β†’ Everything runs with docker-compose up --build, no manual environment wrangling.
  • Clear learning flow β†’ Explains the connector, indexer, and dApp step by step, so developers understand why each part matters.
  • Practical hands-on example β†’ Developers can immediately send a transaction, fetch balances, and see results in a styled UI.
  • Extendable foundation β†’ While the project uses mocks for simplicity, the structure mirrors how a real Midnight dApp would be built, making it easy to swap in real APIs later.

πŸ‘‰ This means developers can quickly experiment and learn the Midnight development workflow before diving into advanced integrations β€” lowering the barrier to entry and boosting confidence.


Why This Matters

When developers try a new blockchain ecosystem, the biggest hurdle is setup and integration. This project lowers that barrier by providing a ready-to-run starter kit.

With one command, developers can:

  • Experiment with transactions.
  • Query balances.
  • Visualise how a dApp interacts with Midnight components.

This makes it significantly easier for more developers to onboard into the Midnight ecosystem.


Set Up Instructions / Tutorial

  • Clone the repository:
   git clone https://github.com/Pravesh-Sudha/dev-to-challenges.git
   cd dev-to-challenges/midnight-challenge
Enter fullscreen mode Exit fullscreen mode
  • Run the project with Docker Compose:
   docker-compose up --build
Enter fullscreen mode Exit fullscreen mode
  • Access the dApp in your browser at:
   http://localhost:3000
Enter fullscreen mode Exit fullscreen mode
  • Use the UI to:

    • Get balances from the indexer mock.
    • Send mock transactions via the connector mock.

Conclusion

This project is more than just a sample dApp β€” it’s a step-by-step tutorial that makes it easier for developers to get started building on the Midnight ecosystem.

By combining clear documentation, a Dockerized setup, and an easy-to-follow YouTube walkthrough, I’ve created a hands-on learning experience for new developers. It demonstrates how transactions, balances, and UI flow can come together in a Midnight-like application β€” without the complexity of setting up the entire blockchain environment first.

My goal was to lower the barrier to entry and give developers a working reference they can learn from, adapt, and expand into real-world Midnight projects.

🌐 Connect with me:

Top comments (11)

Collapse
 
umang_suthar_9bad6f345a8a profile image
Umang Suthar

This is a great approach to lowering the entry barrier for developers.
Too often, blockchain ecosystems feel overwhelming because of setup complexity. Mocks and Dockerized flows like this give people the confidence to start experimenting right away.

What really stands out here is how it mirrors real-world patterns without the heavy infrastructure load. That balance between simplicity and accuracy is exactly what helps ecosystems grow faster.

Collapse
 
pravesh_sudha_3c2b0c2b5e0 profile image
Pravesh Sudha • Edited

Thanks for the appreciation, I wish the judges see it the same way πŸ˜…πŸ€ž

Collapse
 
minhlong2605 profile image
Long Phan

nice, best tutorial ever!

Collapse
 
pravesh_sudha_3c2b0c2b5e0 profile image
Pravesh Sudha

Thanks Buddy, means a lot!

Collapse
 
prime_1 profile image
Roshan Sharma

Really cool post, bundling a sample dApp with React + Flask inside Docker makes onboarding so much easier.
Any tips on scaling this setup beyond the mock data?

Collapse
 
pravesh_sudha_3c2b0c2b5e0 profile image
Pravesh Sudha

You can check the midnight Docs, Particularly with the Tutorial Demo: docs.midnight.network/develop/tuto...

I am planning on creating a separate video for it afterwards.
Stay Tuned!

Collapse
 
corporateoptics profile image
Corporate Optics

Recommended!

Collapse
 
pravesh_sudha_3c2b0c2b5e0 profile image
Pravesh Sudha

Thanks!

Collapse
 
instasdr profile image
InstaSDR.ai

I like it, very interesting

Collapse
 
pravesh_sudha_3c2b0c2b5e0 profile image
Pravesh Sudha

Thanks!

Some comments may only be visible to logged-in visitors. Sign in to view all comments.