-
Set up MongoDB URI:
- Set a valid MongoDB URI as the
MONGODB_URI
environment variable in the.env
file.
- Set a valid MongoDB URI as the
-
Install Npm Dependencies:
- Run the following command to install all npm packages
npm i
-
Seed the Database:
- Run the following command to generate and insert random transactions into the "transactions" collection:
Replace
npm run seed {number_of_transactions}
{number_of_transactions}
with the desired number of transactions to be generated.
- Run the following command to generate and insert random transactions into the "transactions" collection:
-
Build and Start the Server:
- Build the TypeScript code and start the server using the following command:
npm run start:dev
- Build the TypeScript code and start the server using the following command:
To run the Coimex Trading Platform using Docker, follow these steps:
-
Set up MongoDB URI:
- Set a valid MongoDB URI as the
MONGODB_URI
environment variable in the docker-compose.yml file
- Set a valid MongoDB URI as the
-
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. - Run the following command to start the application and MongoDB using Docker Compose:
-
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. -
Stop Docker Containers:
- To stop the Docker containers, run the following command:
docker-compose down
- To stop the Docker containers, run the following command:
To test the APIs, use the provided Postman collection.
-
Test: Get All Symbols Statistics:
- Use the Get All Symbols Statistics request in the Postman collection.
- Ensure you are using the local Postman environment.
-
Test: Get Symbol Statistics By Symbol Name:
- Use the Get Symbol Statistics By Symbol Name request in the Postman collection.
- Ensure you are using the local Postman environment.
- 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.