lms-api

command module
v0.0.0-...-b5756a5 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: MIT Imports: 20 Imported by: 0

README

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"
}'

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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