Skip to content

Latest commit

 

History

History
101 lines (74 loc) · 3.82 KB

README.md

File metadata and controls

101 lines (74 loc) · 3.82 KB

Inventory Management System API

Endpoints

All the following endpoints are prefixed by the API url, in this case it is http://localhost:5000 or https://localhost:5001

User Endpoints


Users Endpoints


Item Endpoints


Items Endpoints


To learn more about the Endpoints follow the Setup and Running the server below, then navigate to http://localhost:5000/swagger

Setup


Windows:

- Open the command line with administrator privileges.
- use the following commands (make sure to add the "quotes"):

command effect
setx IMS__DB__MONGO_STRING "<YOUR-MONGO-CONNECTION-STRING>" /m Creates a machine wide environment variable called IMS__DB__MONGO_STRING that contains the mongodb connection string that the API will use for storage.
setx IMS__JWT__PRIVATE_KEY "<YOUR-JWT-PRIVATE-KEY>" /m Creates a machine wide environment variable called IMS__JWT__PRIVATE_KEY that contains the JSON Web Token private key used to manage and sign the keys created by the API
setx IMS__JWT__EXPIRES_IN "<JWT_EXPIRES_IN>" /m Creates a machine wide environment variable called IMS__JWT__EXPIRES_IN that contains the amount in hours that a JWT Bearer token will be valid for.


MacOS:

- Open a terminal window.
- Navigate to ~/Library/LaunchAgents using the command cd ~/Library/LaunchAgents
- Create or edit the file environment.plist using any editor, and add the following into the file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>my.startup</string>
  <key>ProgramArguments</key>
  <array>
    <string>sh</string>
    <string>-c</string>
    <string>
    launchctl setenv IMS__DB__MONGO_STRING "[YOUR MONGO STRING HERE]"
    launchctl setenv IMS__JWT__PRIVATE_KEY "[YOUR PRIVATE KEY HERE]"
    launchctl setenv IMS__JWT__EXPIRES_IN "[YOUR EXPIRY TIME HERE]"
    </string>
  </array>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>

- Replace the bracketed text with your values, remove the brackets, keep the quotes - Save the file and reboot, or run launchctl load ~/Library/LaunchAgents/environment.plist

Linux:

- Open a terminal window.
- Navigate to /etc using the command cd /etc
- Create or edit the file environment using any editor, and add the following into the file:

IMS__DB__MONGO_STRING="[YOUR MONGO STRING HERE]"
IMS__JWT__PRIVATE_KEY="[YOUR PRIVATE KEY HERE]"
IMS__JWT__EXPIRES_IN="[YOUR EXPIRY TIME HERE]"

- Replace the bracketed text with your values, remove the brackets, keep the quotes - Save the file and reboot

Running the xUnit tests

- Open the IMS.sln file in visual studio 2022 or newer with .net sdk 6.0 support.
- In visual studio, right click on the API.xUnitTests project then click Run Tests


Running the Server

- Open the IMS.sln file in visual studio 2022 or newer with .net sdk 6.0 support.
- In visual studio, click on the run dropdown, then select API