Portfolio Risk Management API:
- Portfolio & Risk/Return API
- Mobile Portfolio Management Application
This monolithic API is meant to combine the user system, portfolio storage, and risk management system into a single API. This backend will provide data to serve the frontend as well as other web components in the future.
This API is designed to be run in a Docker Container with a few helper tools.
The API follows standard RESTful API designs.
- GET
- POST (create)
- PUT (replace)
- PATCH (update)
- DELETE
There are a few ways to use this... the preferred is using a Containerd deployment (see the Docker File). However, you can also run this locally.
To run locally, you'll need to setup a MySQL instance.
- Download the desired release from github
- Create a database, user and password in MySQL for the API to utilize
- Rename .env.example and edit filling in the values as appropriate
- Run main.go
-
How do I start the API automatically on boot?
- Use a systemd service file, or utilize Docker/Containerd/Kubernetes.
- For systemd, see the
systemd
directory for an example service file or visit this link for more information.
- For systemd, see the
- Use a systemd service file, or utilize Docker/Containerd/Kubernetes.
-
How do I update the API?
- Download the latest release, stop the API, replace the binary, and start the API.
- If using Docker/Containerd/Kubernetes, follow the standard procedure for updating a container. The container is ephemeral, so data will not be lost.
-
How do I update the API without downtime?
- Use a load balancer that supports zero downtime deployments. This is not a requirement, but is recommended.
- Use Kubernetes and utilize the rolling update strategy.