Coimex Trading Platform

Getting Started

  1. Set up MongoDB URI:

    • Set a valid MongoDB URI as the MONGODB_URI environment variable in the .env file.
  2. Install Npm Dependencies:

    • Run the following command to install all npm packages
    npm i
  3. Seed the Database:

    • Run the following command to generate and insert random transactions into the "transactions" collection:
      npm run seed {number_of_transactions}
      Replace {number_of_transactions} with the desired number of transactions to be generated.
  4. Build and Start the Server:

    • Build the TypeScript code and start the server using the following command:
      npm run start:dev

Using Docker (Optional)

To run the Coimex Trading Platform using Docker, follow these steps:

  1. Set up MongoDB URI:

    • Set a valid MongoDB URI as the MONGODB_URI environment variable in the docker-compose.yml file
  2. Run Docker Compose:

    • Run the following command to start the application and MongoDB using Docker Compose:
      docker-compose up

    This command will start both services defined in the docker-compose.yml file.

  3. Seed the Database:

    • Run the following command to generate and insert random transactions into the "transactions" collection:
    npm run seed {number_of_transactions}

    Replace {number_of_transactions} with the desired number of transactions to be generated.

  4. Stop Docker Containers:

    • To stop the Docker containers, run the following command:
      docker-compose down

Testing the APIs

To test the APIs, use the provided Postman collection.

  1. Test: Get All Symbols Statistics:

  2. Test: Get Symbol Statistics By Symbol Name:

Examples for Success and Failure with Tests

  • The Postman collection includes examples for successful API requests and failure scenarios with corresponding test scripts.

Feel free to customize this README file based on your project's specific requirements and additional details.