Giter VIP home page Giter VIP logo

b3's Introduction

B3 Playground System

The B3 Playground System is a robust platform designed to interact with financial data from the B3 Stock Exchange.

I divided the project into two fronts, very inspired by CQRS.

1- data population.

a) Option 1: - use the ORM used in the framework.

  • Blocking was that it does not accept bulk.

b) Option 2 (chosen):

  • use direct connection to Mongo.

b.1) read file and send. (Very slow)

b.2) Play in a queue and process (Very slow).

b.3) Use batch operation, calibrating the machine's memory. (chosen)

b.4) Batch merge with queue (unnecessary complexity for POC)

b.5) parallel processing (greater complexity and machine requirement)

2- Data Acquisition:

To query data, I used the ORM available in the framework used. Could have inserted into another table during the data loading process, optimizing the query and following CQRS

Development

Follow these steps to set up the project locally:

Initial Setup

  1. Clone the Repository:

  2. Navigate to your project directory:

  3. In the assets folder, we have the files in .zip format, which will need to be extracted.

  4. Environment Variables:

  • Copy the example environment file:
    cp .env.example .env
    
  • Set the DATABASE_URI in the .env file to your MongoDB URI.
  1. Docker Compose (Optional):
  • If you're using local MongoDB, start the service:
    docker-compose up -d
    
    in .env exemple set
    
    DATABASE_URI=mongodb://root:test@localhost:27017/?authSource=admin&readPreference=primary&appname=MongoDB%20Compass&ssl=false
    

Project Dependencies

  1. Install Dependencies:
yarn
  1. Seed the Database:
  • Run the following command to seed initial data into the database:
    yarn seed
    
  • The seed script creates your first admin user with the following credentials:
  1. Start the Development Server:

  2. Access the Admin Panel:

  • Open your browser and navigate to:
    http://localhost:3000/admin
    

Testing

Run the following command to execute tests:

 yarn test

Endpoints

The system provides two endpoints to access stock information:

  1. Get Maximum Range Value:

    • URL: http://localhost:3000/api/stocks/:stock/max-range-value
    • Method: GET
  2. Get Maximum Daily Volume:

    • URL: http://localhost:3000/api/stocks/:stock/max-daily-volume
    • Method: GET

Additional Notes

  • Yarn Seed: The yarn seed command is used to populate the database with initial data. It's essential for setting up the first admin user and basic data structures.

Doc API

The system also includes a Doc API that provides detailed documentation for various functionalities. To access the Doc API, follow these steps:

Start the Development Server:

  • **Access the Doc API:

  • **Open your browser and navigate to:

http://localhost:3000/api-docs

b3's People

Watchers

Danilo Silva dos Santos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.