avatar

Le Do Nghiem

Software Engineer

  • About me
  • Books
  • Snippets
  • Blog

© 2026 Le Do Nghiem. All rights reserved.

Contact |

Back to Blog

How I Build Scalable Web Apps

avatar
Le Do NghiemSoftware Engineer
2025-09-10 2 min read

Introduction

In this blog post, I’ll show you how I structure large applications using a combination of .NET 8 for the backend and React.js for the frontend, with PostgreSQL and Redis for data management and caching.

Technologies I Use

  • .NET 8
  • React.js
  • PostgreSQL
  • Redis

Example: Building a Scalable API with .NET 8

To demonstrate, here's a simple .NET 8 API endpoint for fetching user data, using dependency injection and async/await for scalability:

using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

[ApiController]
[Route("api/[controller]")]
public class UsersController : ControllerBase
{
    private readonly IUserService _userService;

    public UsersController(IUserService userService)
    {
        _userService = userService;
    }

    [HttpGet("{id}")]
    public async Task<IActionResult> GetUser(int id)
    {
        var user = await _userService.GetUserByIdAsync(id);
        if (user == null)
        {
            return NotFound();
        }
        return Ok(user);
    }
}

public interface IUserService
{
    Task<User> GetUserByIdAsync(int id);
}

public class UserService : IUserService
{
    public async Task<User> GetUserByIdAsync(int id)
    {
        // Simulate database call
        await Task.Delay(100);
        return new User { Id = id, Name = "John Doe" };
    }
}

public class User
{
    public int Id { get; set; }
    public string Name { get; set; }
}

This code sets up a RESTful endpoint that retrieves a user by ID, with dependency injection for testability and async operations for better performance under load.

Previous Post

Mastering TypeScript: Tips and Tricks

Next Post

Deploying Apps with Docker and DigitalOcean