https://github.com/kunalvirwal/library-management-system-golang
A Go based robust LMS with MariaDB backed book transactions and Admin capabilities built on MVC architecture
https://github.com/kunalvirwal/library-management-system-golang
apache2 go gohtml golang library-management-system mariadb mvc-architecture webapplication
Last synced: 3 months ago
JSON representation
A Go based robust LMS with MariaDB backed book transactions and Admin capabilities built on MVC architecture
- Host: GitHub
- URL: https://github.com/kunalvirwal/library-management-system-golang
- Owner: kunalvirwal
- Created: 2024-07-02T19:10:35.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-08-10T09:43:52.000Z (9 months ago)
- Last Synced: 2025-01-11T18:45:37.579Z (4 months ago)
- Topics: apache2, go, gohtml, golang, library-management-system, mariadb, mvc-architecture, webapplication
- Language: HTML
- Homepage:
- Size: 5.77 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ***Steps to run:***
- Download all the dependencies using
> go mod tidy- Create `.env` using `sample.env` file and add all the environment variables in it.
> cp sample.env .env- In your mysql shell create an new database.
> create database MVCdb;- Instead Virtually host the server using apache and setup database automatically.
> source install.sh- Bulid the program using
> go build -o LabsLibrary ./cmd/main.go- Run the server.
> ./LabsLibrary- Visit `http://mvc.sdslabs.local` (Try https is security error on browser)
- An admin account will always be created with credentials "[email protected]" and password "A" if no other admin account present in database.
- To run for development purposes (Install CompileDaemon) .
> go get github.com/githubnemo/CompileDaemon> CompileDaemon -build="go build -o LabsLibrary ./cmd/main.go" -command="./LabsLibrary"
# ***Steps to run tests***
- Setup `.env` and create a database in mysql
- Make sure the program has be executed and used once (Route `/` should have been hit atleast once, and admin details has not been changed otherwiese test will fail to compare), this will setup the database.
- Run `go test -v`# ***Steps to Virtual Host on Ubuntu linux manually***
- Install apache2 and configure:
> sudo apt install apache2> sudo a2enmod proxy proxy_http
> cd /etc/apache2/sites-available
> sudo nano mvc.sdslabs.local.conf
- Add:
```
ServerName mvc.sdslabs.local
ServerAdmin youremailid
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/
TransferLog /var/log/apache2/mvc_access.log
ErrorLog /var/log/apache2/mvc_error.log
```
> sudo a2ensite mvc.sdslabs.local.conf- Add `127.0.0.1 mvc.sdslabs.local` to `/etc/hosts`
> sudo a2dissite 000-default.conf
> sudo apache2ctl configtest
> sudo systemctl restart apache2
> sudo systemctl status apache2
Check `mvc.sdslabs.local` on your browser
### Login Page
![]()
### Admin Dashboard
![]()
### Books Catalog
![]()
Created by Kunal with ❤️