Skip to main content

Project Overview

In this project, we will build a Go API that interacts with the Northwind database hosted in Azure SQL Database. Once the backend is ready, a simple React frontend will be created to display the data.

Connecting dots... REWRITE​

Just like there are many ways to make a sandwich, there are some of the best ways to build one.

Here, we will build from inside out.

lettuce (model) --> meat (service) --> waiter (handler) --> bread (main)

The Handler won't be just serving the API endpoint where there is no call. Yet, the data model will determine how the service will call the database and how the handler will call the service.

Project Final Outcome

Location: Snapshot:

Folder Structure​

dba-northwind/
├── go.mod
├── cmd/
│ └── api/
│ └── main.go
│
├── internal/
│
├──README.md

Tools​

  • Go 1.20+
  • Gin Web Framework
  • Azure SQL Database
  • React (for frontend)
  • Docker (optional, for containerization)
  • Git (for version control)
  • Visual Studio Code (or any code editor of your choice)

Steps​

Prerequisites:

  • Azure SQL Database with Northwind database set up
  • Go installed on your machine
  • Node.js and npm installed (for frontend development)
  1. Set up Go project and folder structure
  2. Connect to Azure SQL Database
  3. Create handlers for API endpoints/build endpoints/test
  4. Build React frontend
  5. Deployment (optional)