This is a backend-based Mutual Fund manager which allows users to add and view mutual funds of their choice written in Go.
Note: If you are a contributer, please read CONTRIBUTING.md
For Windows
-
If MongoDB is installed, find the directory where it is installed. The default installation path for MongoDB on Windows is typically:
C:\Program Files\MongoDB\Server\<version>\bin
. Replace with the version number you installed (e.g., 5.0). -
Make sure the MongoDB Server is runnning. To check, go to Start and type
Services
. Look for the MongoDB server and make sure its running. If not, right click and selectStart
. -
For setting up MongoDB Compass, after connecting to
localhost:27017
, create a new Databasemutual_funds
with Collection name asfunds
.
Postman is a tool for testing and interacting with APIs. To set up Postman for interacting with the APIs, create a new Collection named "mutual fund manager" and add Requests within it. Right-click on the collection to add a request, then choose the HTTP request method (GET, POST, PUT, DELETE)
and paste the corresponding URL for the desired API endpoint. The methods and URLs for this project are provided below.
URL: http://localhost:8080/getAllFunds
Description: Lists all the mutual funds available in the database
URL: http://localhost:8080/addFund/
Description: Allows creation of a new mutual fund data
URL: http://localhost:8080/user/:userID
Description: Retrieves user information by user ID
URL: http://localhost:8080/addUser
Description: Creates a new user account
URL: http://localhost:8080/deleteFund/:id
Description: Deletes a specific mutual fund from the database by its id
URL: http://localhost:8080/fund/:fundID
Description: Updates a specific mutual fund's data in the database using its ID
URL: http://localhost:8080/user/:userID
Description: Updates a specific user's details in the database using their user ID
Run the application using go run .
.
Input data can be entered by selecting Body
tab, then choosing raw and JSON
format, and pasting the data accordingly. Ensure to follow the provided example for input data structure.
{
"name": "Motilal Oswal ",
"category": "Equity",
"cagr": [
{
"1_year": 10.5,
"3_year": 8.7,
"5_year": 9.2
}
],
"rating": 5
}
{
"username": "johndoe",
"email": "[email protected]",
"password": "securepassword",
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01T00:00:00Z",
"phone_number": "+1234567890"
}
{
"fund_id": 1,
"name": "Updated Motilal Oswal Fund",
"category": "Equity",
"cagr": [
{
"1_year": 11.5,
"3_year": 9.7,
"5_year": 10.2
}
],
"rating": 4
}
{
"user_id": "20230501123456",
"username": "johndoe_updated",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01T00:00:00Z",
"phone_number": "+1987654321"
}