Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/siddheshk02/portfolio-management
https://github.com/siddheshk02/portfolio-management
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/siddheshk02/portfolio-management
- Owner: Siddheshk02
- License: mit
- Created: 2024-07-28T06:53:51.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-30T08:32:32.000Z (5 months ago)
- Last Synced: 2024-07-31T10:48:57.836Z (5 months ago)
- Language: Go
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Portfolio Management Service
## Description
A simplified portfolio management service to manage user portfolios, track asset values, and provide basic analytics.## Setup and Run
1. Clone the repository:
```sh
git clone https://github.com/yourusername/portfolio-management.git
cd portfolio-management
```3. Add and Update `.env` with your database credentials.
```
User:
Password:
```5. Run the application:
```sh
go run cmd/main.go
```## API Endpoints
### User Management
- `POST /register`: Register a new user.
- `POST /login`: Login a user.### Portfolio Management
- `POST /portfolios`: Create a new portfolio.
- `GET /portfolios/{id}`: Get a portfolio by ID.
- `PUT /portfolios/{id}`: Update a portfolio by ID.
- `DELETE /portfolios/{id}`: Delete a portfolio by ID.- `GET /portfolios/{id}/totalvalue`: Get Total Value of your Portfolio Assets
- `GET /portfolios/{id}/averagereturn`: Get Average Return on your Portfolio Assets### Asset Management
- `POST /portfolios/{id}/assets`: Add an asset to a portfolio.
- `GET /portfolios/{id}/assets/{asset_id}`: Get an asset by ID.
- `PUT /portfolios/{id}/assets/{asset_id}`: Update an asset by ID.
- `DELETE /portfolios/{id}/assets/{asset_id}`: Delete an asset by ID.## Example
- `POST /register` or `POST /login` : ```{ "username": "Example", "password": 12345678 }```
- `POST /portfolios` : ```{ "userid": 2, "name": "MyPortfolio" }```
- `POST /portfolios/{id}/assets` : ```{ "portfolioid": 2, "name": "Mutual-Fund", "value": 1600 }```