Skip to content

leftmove/wallstreetlocal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wallstreetlocal

A website that allows you to view the investments of America's largest investors.

The Securities and Exchange Commission (SEC) keeps record of every company in the United States. Companies whose holdings surpass $100 million though, are required to file a special type of form: the 13F form. This form, filed quarterly, discloses the filer's holdings, providing transparency into their investment activities and allowing the public and other market participants to monitor them.

The problem though, is that these holdings are often cumbersome to access, and valuable analysis is often hidden behind a paywall. Through wallstreetlocal, the SEC's 13F filers become more accessible and open.

  • Large: With over 850,000 companies archived, any filer registered with the SEC can be queried. Download the database here.
  • Recent: View thousands of cached stocks in the database, with accurate and recent data.
  • Historical: View filer holdings going back 30+ years in the explorer, or visit the SEC directly.
  • On-Demand: Data is queried and stored on user request, and is progressively available for download.

Getting Started

This repository holds the backend and frontend for wallstreetlocal.

To visit the wallstreetlocal, you can go to wallstreetlocal.com.

You can also see important resources used to create the site at the resources page, or view the OpenAPI documentation at the API page.

For more information, see the documentation for wallstreetlocal's development stack below.

Self-Hosting

A production version of the site is hosted at wallstreetlocal.com, but it is also possible to self-host.

Frontend

  1. Navigate to the frontend folder.

    cd frontend
  2. Install dependencies.

    npm install
  3. Deploy.

    npm run dev

    Or for a production build, run

    npm run build
    npm run start

Once the above steps are completed, the frontend should be hosted at localhost:3000, with the backend automatically configured to content.wallstreetlocal.com.

Hosting the frontend alone is the reccomended way to self-host, but if you want to self-host the backend too, see below.

Backend

Third Party APIs

To run both the development and production builds, you will need to have environment variables for third party APIs. Most of the environment variables in the provided example files you can keep as is, but for the API keys you will need to visit the following services.

These three different services allow for the most up-to-date and accurate data, while also avoiding rate-limiting.

Telemetry

Although it is reccomended that you turn off telemetry for self-hosting, you can enable telemetry through the TELEMETRY environment variable.

For telemetry/tracing/logs, wallstreetlocal uses Sentry. You can sign up here, or self-host that too.

Development

The development build is mainly made for testing, so it is ideal for self-hosting.

To run the full app, you need the microservices running through Docker, and the main application running seperately.

You can find the developement compose file here. You will also need a .env file that can be found here.

Once you have all the configuration files ready, to start the app, run the following.

  1. Navigate to the backend directory.

    cd backend
  2. Run the microservices by calling the development compose file.

    docker compose -f docker-compose.dev.yaml up -d

    Note: You should stop these microservices after you're done using them (otherwise they will waste resources indefinitely). To stop them, run the following.

    docker compose -f docker-compose.dev.yaml down # Run after you've finished
    
  3. Install dependencies with Poetry.

    pip install poetry
    poetry install
  4. Create and edit the .env file using .env.example.

  5. Run the main application.

    poetry run python main.py

Production

The production build is made for deploying at scale, so running it will be more cumbersome.

You can find the compose file here. There is no .env file though, as all the environment variables are included in the compose file.

Unless you are runnng the production build for many people, you should change the following settings.

  • Run on a single worker
  • Disable telemetry
  • Map all Docker ports to localhost

Once you have all the configuration files ready, to start the app, run the following.

  1. Navigate to the backend directory.

    cd backend
  2. Run the entire application with one command.

    docker compose -f docker-compose.prod.yaml up

Contributing

If you feel you can contribute to this project, or you've found a bug, create an issue or pull request.

This project is soley mantained so it is prone to bugs and anti-patterns, please call them out where you see them. All contributions are highly appreciated!

License

MIT License

Code of Conduct