# SchoolPassport

A graduation project connecting leave requests and gate checks through a mini program, Go backend, admin UI, and scanner

Source: https://works.im0o.top/en/projects/3f4a6b2c/
Date: 2022-03-01
End date: 2022-05-30
Status: archived
Tags: Full Stack, WeChat mini program, Go, Vue, Rust

## Project links

- [Demo video](https://www.bilibili.com/video/BV15VJhzCEDi/)


During campus restrictions in spring 2022, leaving school required a paper campus card and permit. I used that situation for my graduation project, SchoolPassport: students request leave in a mini program, teachers approve it, and a gate terminal checks a dynamic QR code.

I did most of the interface and software development across the mini program, Go backend, administration site, and scanning terminal, then connected the demonstration to a Raspberry Pi and USB scanner.

[Full system demonstration](https://www.bilibili.com/video/BV15VJhzCEDi/)

## The student and teacher mini program

The frontend uses Uni-app and VantUI. Students bind their identity and student number, view their campus card, submit leave dates and reasons, and review earlier requests. Teachers see the requests awaiting their approval.

The card displays a refreshing QR code, with a background indicating residential or commuting status. Applications and approval records are stored on the server. The frontend was also designed to run as an H5 application.

![The student login entry in the mini program](https://image.im0o.top/2026/20261117104512310.webp "The student login entry in the mini program")

## Backend

Gin registers the routes and GORM handles data access. Student and teacher endpoints are organized separately, with session middleware for authenticated operations. They cover identity binding, current QR codes, leave submissions, request history, approvals, and password changes.

For example, students submit requests through POST /stu/addLrequest, teachers review them through POST /tch/auditLreq, and the card retrieves its code through GET /stu/getLatestQr. Student portraits have a separate image endpoint.

The QR payload contains a student number, issue time, expiry time, and verification string. Generation combines a hash with a random salt. Verification checks the format and expiry before recalculating the value. The codes expire after one minute in this version.

The server then checks student identity and approved leave records. A residential student without the required approved request fails the gate check. Code validity and permission to leave are handled as separate parts of that process.

![Check token validity and approved leave separately before deciding gate access](https://image.im0o.top/2026/20261117104506997.webp "Check token validity and approved leave separately before deciding gate access")

## Administration and the gate terminal

The Vue 3 and Naive UI administration site manages teachers, students, classes, leave records, and approval information. It also presents charts for leave counts and departments. Students and teachers use the mini program for their routine actions.

At the gate, a Rust program on the Raspberry Pi reads input from the USB scanner, calls /stu/vertifyStu, and plays a spoken success or failure result. The demonstration follows the same application from a phone request to the gate response.

I passed my graduation defense with the project and entered it in the introductory innovation category of a Jiangsu vocational-college innovation and entrepreneurship competition. It remained a demonstrated system and video; the school did not deploy it.

