Giter VIP home page Giter VIP logo

lms-backend's Introduction

Library Management System Backend

Welcome to the backend of our Library Management System (LMS). Designed for efficiency and scalability, this system forms the backbone of a simple digital library management solution. Leveraging cutting-edge technologies and robust architectures, our LMS backend efficiently handles complex library operations, ensuring reliability and high performance.

Key Features

  • Robust Digital Library Management: Manages digital assets with advanced backend functionalities.
  • Full CRUD Operations: Supports Create, Read, Update, and Delete (CRUD) operations for books, loans, reservations, fines, and user accounts.
  • Advanced Admin Capabilities: Provides administrative tools for efficient and effective library management.
  • Role-Based Access Control (RBAC): Implements fine-grained access control for secure and efficient management of library resources.
  • Session-Based Authentication: Ensures secure user authentication and management.
  • Dockerized Deployment: Offers a convenient way to deploy the backend with Docker.
  • Scalable Data Storage with Postgres: Utilizes PostgreSQL for robust and scalable data storage.
  • Redis for Performance: Leverages Redis for high-speed caching and session storage, ensuring a responsive and efficient system.

Core Technologies

The LMS backend is built using a range of powerful technologies:

  • Language: Go (Golang) - Renowned for its efficiency and scalability in backend development.
  • ORM: GORM - Offers a developer-friendly ORM library for Go.
  • Framework: Fiber - An Express-inspired, high-performance web framework for Go.
  • Databases:
    • Postgres: A versatile and reliable relational database system.
    • Redis: A fast key-value store, excellent for caching and session storage.
  • Deployment: Docker - A containerization platform for easy deployment.

Accessing a Deployed Version

For those interested in exploring a deployed version of this setup, it is available for viewing and interaction:

  • Deployed on Railway:
    • Visit the deployed version on Railway at this link.

This deployed instance provides a convenient way to see the PostgreSQL and Redis services in action without the need for local installation.

Setup Instructions

1. Install Go

Download and install Go from here.

2. Update Environment Variables

  • Copy .env.example to .env.development.
  • Modify the variables in .env.development to suit your environment.

3. Running the Server

Start the server with:

make dockerup

4. Setting up Database

Run the docker-compose file to start the database:

# Keep the container running in a separate terminal
make dockerup

Run the database migrations:

# Execute a Shell Inside the Container
make dockershell
  • Run the following commands inside the container:
  • Create the database: go run cmd/createdb/main.go
  • Migrate the database: go run cmd/migratedb/main.go -dir=up
  • Rollback the database (specify the number of steps to roll back): go run cmd/migratedb/main.go -dir=down -step= #$(step)
  • Seed the database: go run cmd/seeddb/main.go
  • Drop all tables (if necessary): go run cmd/flushdb/main.go
  • Drop the database (if necessary): go run cmd/dropdb/main.go
  • Exit the container: exit

5. Persisting File Storage

  • Create a docker volume for file storage and mount it at /app/file_storage in the container.

6. Making Changes to Frontend

The current is a single-page application (SPA) built using React. You can find the source code here.

The backend is designed to serve the frontend as static files. If you wish to make changes to the frontend, you will need to set up the frontend locally and build the frontend files by running the following commands:

# cd into the frontend folder
bun run build

Once the frontend files have been built, copy the files from the dist folder to the frontend folder in the backend.

mv path_to_frontend/dist/* path_to_backend/frontend/

Great! You are now ready to serve the updated frontend from the backend.

7. Additional Development Setup

Install necessary Go packages and initialize Git hooks:

go get -u github.com/swellaby/captain-githook
captain-githook init

Our Library Management System Backend is designed to meet the needs of simple libraries, offering a perfect blend of performance, security, and ease of maintenance. Whether for academic, public, or private libraries, it provides the essential infrastructure to manage library operations effectively and efficiently.

lms-backend's People

Contributors

wxiaoyun avatar

Stargazers

Rowen avatar  avatar

Watchers

 avatar

lms-backend's Issues

feat(file-upload): disk storage and http request

Database

  • Create migration for file upload table, book file join table

Model

  • create model for the tables above

Dataaccess

  • create crd functions that modify records in db

File upload

  • create pkg for file upload that handlers reading and writing to disk

http file

  • function that extracts file from http form requests
  • perform validation: file size, file type, extension match file type

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.