Our app is a platform for students to find and offer services to their peers. Think of existing online marketplaces for tasks like Fiverr, but this is only offered to JHU students, and students use cryptocurrency to pay each other, eliminating the need for a middle man in terms of payments. Additionally, our app will use advanced searching algorithms to help users find tasks that match their past interests.
The flask
framework is used for the server, which interacts with the database using SQLAlchemy
.
Make sure to run 'pip3 install -r requirements.txt' before running the backend. To run the backend:
A MySQL
database is the database of choice for this application. To start:
backend/setup_mysql.sh
bash script. This script creates:
docker-compose.yml
file and stores it in the backend
directoryMySQL
instanceJobs
and Users
tables which are defined in the script.If this script has been run already from a previous session, there is no need to run it again. To spin up the database in subsequent sessions:
docker-compose up -d
To shut down the database at the end of a session:
docker-compose down
. Optionally add -v
flag to clear database memory, but the setup script will need to be run again to recreate the database schema.From Team-GYAT directory
The contract
directory holds the smart contract, which is also compiled and stored in contract/artifacts
. The Remix online IDE has a testing framework, which will be used to ensure all functionality of the contract is working properly. From there, the web3.py
framework will be used to create a contract from the backend, and ether.js
will be used to interact with the contract for any following contract interactions.
Since we do not have login functionality setup we are creating a user through POSTMAN.
Creating a User POST URL:http://127.0.0.1:5000/users Headers: Content-Type: application/json Body(JSON): { "username": "johndoe", "fullname": "John Doe", "year": "2024", "email": "johndoe@example.com", "password": "securepassword123" }
Fetching all Users GET URL: http://127.0.0.1:5000/users
Fetching Single User by ID *note make sure you have the right user id should be users/userID GET URL: http://127.0.0.1:5000/users/1
Updating a User PUT URL: http://127.0.0.1:5000/users/1 Headers: Content-Type: application/json Body(JSON):{ "fullname": "Johnathan Doe", "email": "johnathan.doe@example.com", "year": "2025" }
Deleting a User DELETE URL: http://127.0.0.1:5000/users/1
User profile page can be viewed right now by clicking the button 'Profile'. Dummy information currently until we have login setup, which we are working on for next iteration. Currently have it setup so you can update username, fullname, year, and email, but might to choose to remove updating feature later. Will connect everything to backend after login setup.
frontend
, run npm install hardhat
, then npx hardhat node
. This command will start the testnet, and provide 20 mock accounts with 10000 ETH loaded into each one. Take note of the url present at the top of the printed text block when hardhat is run: http://127.0.0.1:8545
.31337
as the chain ID and ETH
as the currency`.invalid block number
or invalid nonce number
: stop the hardhat network, run rm -rf cache/ artifacts/
. Redo the testnet setup outlined above, and use a private key corresponding to a different account number than used previously.Since this API doesn't currently require login, we’ll demonstrate creating and managing conversations and messages directly through Postman. NOTE: Make sure to replace the ids with the ids you generate.
Creating a Conversation POST URL: http://127.0.0.1:5000/conversations Headers: Content-Type: application/json Body (JSON): { "participant_ids": [1, 2] }
Fetching All Conversations for a User GET URL: http://127.0.0.1:5000/users/1/conversations
Creating Messages POST URL: http://127.0.0.1:5000/messages Headers: Content-Type: application/json Body (JSON): { "text": "Hello, everyone!", "sender_id": 1, "conversation_id": 1 }
Fetching All Messages in a Conversation Method: GET URL: http://127.0.0.1:5000/conversations/1/messages
Fetching a Single Message by ID GET URL: http://127.0.0.1:5000/messages/1
Adding a Participant to an Existing Conversation POST URL: http://127.0.0.1:5000/conversations/1/participants Headers: Content-Type: application/json Body (JSON): { "user_id": 3 }
Removing a Participant from a Conversation DELETE URL: http://127.0.0.1:5000/conversations/1/participants/2
Fetching Participants in a Conversation GET URL: http://127.0.0.1:5000/conversations/1/participants
On the Navigation Bar of our app, there is a "Become a Seller" button Click on it, and fill out the fields there to post your job/service, and it should be displayed on the job feed now when clicking navigating back to the main page.
The frontend of the app is deployed at https://scintillating-llama-2cea82.netlify.app and the backend of the app is deployed at https://task-market-7ba3283496a7.herokuapp.com/
User login/register is still in the process of being implemented. We have spent a total of 15 hours on it this iteration, with Andrew mostly putting in the work trying to implement it. He has contacted IT to get it working with the JHU SSO option, and is still running into bugs since the provided code on the course website is not easily transferable to Flask. Once we get this working, we will be able to implement the rest of our features easily in our next iteration. The smart search feature started in iteration four is also not completed fully as of right now as it relies on having a userID to keep track of interactions/requests a user makes. Once the login problems are sorted, this will not be blocked.