{"id":45646849,"url":"https://github.com/bhavanvir/nightrader","last_synced_at":"2026-02-24T04:18:12.625Z","repository":{"id":224460403,"uuid":"744144199","full_name":"bhavanvir/nightrader","owner":"bhavanvir","description":"SPRING 2024","archived":false,"fork":false,"pushed_at":"2025-01-05T23:28:46.000Z","size":5187,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-22T04:28:24.373Z","etag":null,"topics":["docker","gin-gonic","golang","keydb","nginx","postgresql","rabbitmq","react"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bhavanvir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-16T17:54:06.000Z","updated_at":"2025-01-05T23:28:50.000Z","dependencies_parsed_at":"2024-04-03T01:26:39.514Z","dependency_job_id":"8fdf989b-7206-4ea4-bebe-04da91aa9288","html_url":"https://github.com/bhavanvir/nightrader","commit_stats":null,"previous_names":["bhavanvir/day-trader","bhavanvir/nightrader"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bhavanvir/nightrader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhavanvir%2Fnightrader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhavanvir%2Fnightrader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhavanvir%2Fnightrader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhavanvir%2Fnightrader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhavanvir","download_url":"https://codeload.github.com/bhavanvir/nightrader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhavanvir%2Fnightrader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29771290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T04:01:02.180Z","status":"ssl_error","status_checked_at":"2026-02-24T03:59:49.901Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","gin-gonic","golang","keydb","nginx","postgresql","rabbitmq","react"],"created_at":"2026-02-24T04:18:11.974Z","updated_at":"2026-02-24T04:18:12.615Z","avatar_url":"https://github.com/bhavanvir.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nightrader [![test](https://github.com/bhavanvir/day-trader/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/bhavanvir/day-trader/actions/workflows/main.yml)\n\nNightrader is a robust stock trading platform built on microservices architecture. We leverage Docker for orchestration, Go and Gin-Gonic for the backend API, PostgreSQL for our database, and React with Daisy UI and TailwindCSS for the frontend.\n\nReport: https://docs.google.com/document/d/1oVEG4dLL3xDYKPcaBWg5wAPF0FnfVdA73cYewMwVkJk/edit?usp=sharing\n\n## Services\n\n- **Engine** (Port `8585`): Implements the matching engine, which processes buy and sell orders using a Pro Rata algorithm.\n- **Setup** (Port `8080`): Initializes Nightrader by adding and creating stocks for market use.\n- **Database** (Port `5432`): Handles table creation and data preprocessing, including password encryption.\n- **Authentication** (Port `8888`): Verifies user credentials against the database and generates session tokens that expire after a fixed time.\n- **Transaction** (Port `5433`): Manages client-exchange interactions, such as fetching current market prices and funding user balances.\n- **Frontend** (Port `3000`): The user-facing application that facilitates interactions with the exchange.\n\n## Endpoints\n\n| Category       | Method | Endpoint                  | Parameters                                         |\n|----------------|--------|---------------------------|----------------------------------------------------|\n| Authentication | POST   | /register                 | { \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"username\": string, \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"password\": string, \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"name\": string \u003cbr/\u003e } |\n|                | POST   | /login                    | { \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"user_name\": string, \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"password\": string \u003cbr/\u003e } |\n| Transaction    | GET    | /getStockPrices           | -                                                  |\n|                | GET    | /getWalletBalance         | -                                                  |\n|                | GET    | /getStockPortfolio        | -                                                  |\n|                | GET    | /getWalletTransactions    | -                                                  |\n|                | GET    | /getStockTransactions     | -                                                  |\n|                | POST   | /addMoneyToWallet         | { \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"amount\": number \u003cbr/\u003e } |\n|                | POST   | /placeStockOrder          | { \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"stock_id\": number, \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"is_buy\": boolean, \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"order_type\": string, \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"quantity\": number, \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"price\": number \u003cbr/\u003e } |\n|                | POST   | /cancelStockTransaction   | { \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"stock_tx_id\": string \u003cbr/\u003e } |\n| Setup          | POST   | /createStock              | { \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"stock_name\": string \u003cbr/\u003e } |\n|                | POST   | /addStockToUser           | { \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"stock_id\": string, \u003cbr/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"quantity\": number \u003cbr/\u003e } |\n\n## Installation\n\n1. **Prerequisites**: Ensure Docker is installed and configured on your system.\n   \n2. **Clone the repository**:\n   ```bash\n   git clone https://github.com/bhavanvir/day-trader.git\n   ```\n\n3. **Navigate to the project directory**:\n   ```bash\n   cd day-trader\n   ```\n\n4. **Start up all microservices**:\n   ```bash\n   docker compose up --build -d\n   ```\n\n5. **Access the frontend**:\n   Open a web browser and go to `localhost:3000` to start trading.\n\nFeel free to reach out if you have any questions or need further assistance. Happy trading!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhavanvir%2Fnightrader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhavanvir%2Fnightrader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhavanvir%2Fnightrader/lists"}