server

command module
v0.0.0-...-99d0739 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2025 License: MIT Imports: 9 Imported by: 0

README

MeReMa Server

Tools used

  • docker and docker-compose for PostgreSQL dockerimage (to ensure synchronization between devs)
  • dbmate for database migration. This tool act like Git for database schema
  • swaggo/swag for API documentation. This especially useful for frontend dev as they can test API directly from SwaggerUI generated by swaggo. plot
  • Makefile for simplifying commands running and synchronization of $ENV.

Main structure

  • /api: provides api for clients
  • /services: handles app's core business logics
  • /repo: handles communication with database
  • /models: describes DTOs, errors and permissions, share betwwen 3 layers of server

Required envs (setup a .env, see .env.example)

  • GMAIL_USERNAME (ex: haha@gmail.com, ...)
  • GMAIL_PASSWORD (google app password, 12 char long)
  • JWT_SECRET (a non-empty string)
  • JWT_SESSION_EXPIRATION (an integer, measured in minutes)
  • JWT_RECOVERY_EXPIRATION (an integer, measured in minutes)
  • JWT_REGISTRATION_EXPIRATION (an integer, measured in minutes)
  • FILE_STORAGE_PATH (an absolute path or relative path, where files, images will be stored)

Server setup (for Linux devs only)

  • Clone this repo: git clone https://github.com/MeReMa-UIT/server
  • Install docker, docker-compose and dbmate
  • Run make setup to install golang's dependecies and tools (this doesn't include docker, docker-compose and dbmate)
  • Run make migrate-up for database schema update.
  • Run make or make run
  • Swagger UI is available at http://localhost:8080/swagger/index.html

Server testing

  • Admin 1:
  • Admin 2:
  • Receptionist 1:
    • ID: 000000001111
    • Password: 123456
  • Doctor 1:
    • ID: 000000001112
    • Password: 123456
  • Patient 1:
    • ID: 000000001113
    • Password: 123456

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
services

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL