Skip to content

luyenhaidangit/flex-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flex Microservice - Securities Management System

Overview

Flex Microservice is a scalable microservice architecture built with .NET 8 for a comprehensive securities management system. It is designed to handle real-time securities transactions, portfolio management, market data streaming, and reporting for brokerage firms and financial institutions.

Features

  • Real-time Trade Processing: Handle securities trades in real-time, ensuring fast and secure transaction recording.
  • Portfolio Management: Manage investor portfolios with detailed analytics and asset tracking.
  • Market Data Streaming: Integrate with market data providers to provide up-to-date quotes and market insights.
  • Reporting and Compliance: Generate customizable reports to meet regulatory requirements and provide transparency.
  • Scalable Microservice Architecture: Deploy as independent, scalable services using Docker and Kubernetes.
  • High Availability and Resilience: Built-in support for failover and load balancing to ensure high availability.

Prerequisites

Before you begin, make sure you have the following installed:

Getting Started

These instructions will help you set up and run the Flex Microservice project locally.

Installation

  1. Clone the repository

    git clone https://github.com/username/flex-microservice.git
  2. Navigate to the project directory

    cd flex-microservice
  3. Set up environment variables

    Create a .env file in the root directory and add the necessary environment variables.

    DATABASE_URL=your_database_url
    RABBITMQ_URL=your_rabbitmq_url
    AUTH_SECRET=your_auth_secret
    

Running Locally

  1. Run the database

    Start your SQL Server or PostgreSQL instance locally or in a Docker container.

    docker run -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 postgres
  2. Run RabbitMQ

    docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
  3. Run the microservices

    Each microservice can be started individually. Navigate to the corresponding folder and run:

    dotnet run
  4. Access the application

    The application can be accessed through API endpoints exposed by each microservice. Example:

    http://localhost:5001/api/trades
    

Usage

Here are some examples of how you can use the Flex Microservice:

  • Submit a Trade: Make a POST request to the trades API to submit a new trade.
    curl -X POST "http://localhost:5001/api/trades" -H "Content-Type: application/json" -d '{"symbol": "AAPL", "quantity": 100, "price": 150.25}'
  • Get Portfolio Data: Access an investor's portfolio via the portfolio API.
    curl -X GET "http://localhost:5002/api/portfolios/12345"

Running Tests

To run the unit tests, execute:

dotnet test

Deployment

To deploy the Flex Microservice to a production environment:

  1. Build the Docker images

    docker-compose build
  2. Run the Docker containers

    docker-compose up
  3. Scaling Services

    Use Docker Compose or Kubernetes to scale individual microservices as needed.

Contributing

We welcome contributions from the community! Please read our Contributing Guidelines to get started.

Ways to Contribute

  • Report bugs or suggest features by opening an issue.
  • Submit pull requests to fix bugs or add new features.
  • Improve documentation or examples.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

If you have questions or need help, feel free to open an issue or email the author.

Acknowledgements

  • Thanks to the open-source community for providing the tools and inspiration.
  • Special thanks to MassTransit for simplifying RabbitMQ integration.

Technology

  • IdentityServer

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published