Skip to content

ShaneM123/hism-server-v2

Repository files navigation

HISM

An Inventory management system for neighbourhoods during a crisis: hism.

Hism is a way to connect people with their neighbours to allow them to trade items, ie a hammer for a screwdriver. Users can see their neighbours inventory and what they have in excess and request to trade or borrow items at will. Hism will use location tracking to ensure the user is trading with nearby neighbours

This is the backend server and database for Hism

! Hism is still in development. location tracking and frontend design are still in progress !

There are two ways to run this server, either build it yourself or use the docker container to do the lifting for you

Via Docker:

Make sure Docker is installed. Then go to the project folder and type the follow command:

docker build . --tag hism:v01

sudo privileges may be required if you are using linux

once the container is built (this may take 10 minutes on the first attempt) type the following command:

docker run -p 8443:8443 hism:v01

Your Hism server should now be running from a docker container, congratulations! to stop the container use the command:

docker stop "Container Name"

to get the container name (id) type:

docker ps -a

below is the manual build if you're feeling adventurous

Manual build:

firstly, you will need redis server installed for session caching, sqlite (and its library file) for the backend. Along with Rust and Diesel ORM for rust framework

possible API Requests

until the frontend is complete, API requests are the best way to communicate with the backend currently.

firstly, you can create a user with the following curl request:

curl --insecure -H 'Content-Type: application/json' -X POST https://0.0.0.0:8443/createusers -d '{"username":"Tommy","password":"pass123"}'

once a user is created, you can login:

curl --insecure -c mycookie.txt -H 'Content-Type: application/json' -X POST https://0.0.0.0:8443/login -d '{"username":"Tommy","password":"pass123"}'

a quick text to check that youre still logged in:

curl --insecure -b mycookie.txt -H 'Content-Type: application/json' -X GET https://0.0.0.0:8443/whoami

Finally, to log out:

curl --insecure -b mycookie.txt -H 'Content-Type: application/json' -X POST https://0.0.0.0:8443/logout

there are many other possible requests, that I won't list here, but feel free to look at the 'routes' in the source code to see what requests are possible

Development Progress

a screenshot of the current draft of the database is listed as Database_design.png

a screenshot fo the Trello page is listed as Project_Management_Trello.png

UI design on

Figma

About

hism server v2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published