Library Management System
Run lms-api
Clone repo.
git clone https://github.com/kunnoh/lms-api.git
Go to directory.
cd lms-api
Configuration
Change example.env
to .env
at the root folder of project.
Set the information in .env
.
Export variables to environment from .env
file.
. env.sh
Genarate ECDSA keys used to generate jwt
token. Save them in ./keys
folder.
Create private key.
openssl ecparam -genkey -name prime256v1 -noout -out ./keys/ecdsa_private_key.pem
Generate public key
openssl ec -in ./keys/ecdsa_private_key.pem -pubout -out ./keys/ecdsa_public_key.pem
NOTE:
Make sure you have postgres database running.
Run postgres
container using docker
:
make start-db
Start app
make dev
Run tests
Build
Build executable
Build app.
make build
Build docker image
make build-image
Testing
Register.
curl -X POST http://localhost:7755/auth/register -H "Content-Type: application/json" -d '{
"Email": "example@example.com",
"Name": "John Doe",
"Password": "securepassword123",
"Phone": "+1234567890",
"IdNumber": "912345678"
}'
Login.
curl -X POST http://localhost:7755/auth/login -H "Content-Type: application/json" -d '{
"Email": "example@example.com",
"Password": "securepassword123"
}'