Persistent school data
Move core application data into PostgreSQL so it can be stored and retrieved reliably.
Case Study · 02
A Go-based backend system for managing core school operations with PostgreSQL and JWT-protected API routes.
01 · Overview
The School Management System is a backend application built strictly with Go, with PostgreSQL providing persistent data storage.
The system is designed around core school operations including students, admissions, classes, fees, and academic results.
Authentication and protected API routes were implemented with JWT-based authorization, giving the system a clear foundation for controlling access to backend resources.
Technology
02 · The Problem
The project started with the need for a structured backend capable of managing core school data rather than relying on disconnected or temporary application state.
The system needed persistent storage for users, students, and subjects, while also establishing authentication and protected access to backend resources.
The longer-term goal is to expand this foundation into a broader school management platform covering academic results, grading, termly reports, broadsheets, fees, and administrative workflows.
The challenge was therefore to build the backend incrementally while keeping the foundation structured enough to support those future capabilities.
Move core application data into PostgreSQL so it can be stored and retrieved reliably.
Provide registration and login functionality while protecting user credentials with bcrypt.
Use JWT-based authentication to control access to protected API routes.
Establish backend functionality for creating and retrieving student records.
Establish backend functionality for creating and retrieving subjects.
Create a foundation that can later support results, grading, reports, broadsheets, fees, and administrative features.
03 · Architecture
The system is built with Go and uses the standard net/http package for handling HTTP requests. PostgreSQL provides persistent data storage, with lib/pq used to connect the Go application to the database.
Authentication is handled through bcrypt password hashing and JSON Web Tokens (JWT). Protected API resources require a valid authentication token.
Request flow
The backend uses Go's net/http package to handle HTTP requests and expose API functionality.
Persistent application data is stored in PostgreSQL rather than being kept only in application memory.
User passwords are hashed with bcrypt rather than being stored as plain text.
Authenticated users receive JWT-based credentials that are used when accessing protected resources.
04 · Engineering Challenges
Building the system was not a straight line from database design to working API. Several implementation problems appeared along the way, particularly around database access, authentication, routing, and debugging API behavior.
Instead of treating those problems as failures to hide, I used them as part of the development process: identify the failure, trace it back to its source, make the correction, and verify the result.
Connecting the Go application to PostgreSQL exposed configuration and database permission issues that had to be diagnosed before the API could reliably interact with persistent data.
JWT authentication required making decisions around token generation, signing, and protected API access rather than treating authentication as an afterthought.
Authentication middleware had to be integrated with the API so that protected resources could distinguish authenticated requests from unauthenticated ones.
Some endpoints did not work correctly on the first implementation. Debugging involved tracing requests through the Go server, checking the database interaction, and correcting the underlying implementation.
A simple naming mistake in the project affected how a status value was displayed. Finding the typo, correcting it, and refreshing the application reinforced the importance of checking the complete data flow rather than assuming the backend response is correct.
Building the backend taught me that debugging is not separate from engineering. It is part of the process of understanding how the system actually behaves.
05 · Current Implementation
The current implementation focuses on establishing the core backend capabilities required for the larger school management platform. Authentication, database persistence, student management, and subject management are currently implemented.
Users can register through the Go backend, with passwords protected using bcrypt hashing.
The backend authenticates users and generates JWT credentials for authenticated sessions.
Protected API resources require valid authentication credentials before they can be accessed.
The application connects to PostgreSQL and uses persistent database storage for its backend data.
The current API supports creating and retrieving student records.
The current API supports creating and retrieving subject records.
Current API foundation
06 · Roadmap
The current implementation establishes the authentication, persistence, student, and subject foundations. The next stages focus on building the academic and administrative workflows on top of that foundation.
Introduce backend support for recording and managing student academic results.
Build the grading logic required to convert student scores into academic grades.
Organize academic results across first term, second term, and third term within an academic session.
Introduce GPA and cumulative GPA calculations based on the system's academic grading structure.
Generate broader academic reports that allow administrators to review student performance across subjects.
Support importing student scores from Excel files to make large-scale result entry more practical.
Extend the backend to support school fee records and related financial workflows.
Provide an administrative interface for managing students, subjects, results, and other school resources.
Introduce differentiated permissions for administrators, teachers, and students.
Academic workflow
07 · Evidence
This case study documents the engineering direction and current state of the project. The repository contains the actual Go backend, authentication implementation, PostgreSQL integration, student and subject functionality, and the ongoing development work.
Repository
Explore the Go source code, PostgreSQL integration, authentication implementation, and project documentation.
View repository →Stack
The project is intentionally being developed incrementally, with the current backend foundation serving as the base for the larger academic and administrative workflows planned for the system.