This project is a solution to the Crossmint challenge, which involves interacting with the Megaverse API to create and manage entities on a map. The project is divided into multiple phases, each with specific tasks to accomplish.
I would like to express my sincere gratitude to Crossmint for considering my candidacy. This challenge was fun. I appreciate the opportunity to showcase my skills and look forward to the possibility of contributing to your team. Thank you for your time and consideration.
bin/
: Contains the executable scripts for different phases of the challenge.megaverse.ts
: Script for Phase 1 and Phase 2 of the challenge.
src/
: Contains the core logic and services for interacting with the Megaverse API.client.ts
: Defines theMegaverseClient
class for making API requests.megaverse-service.ts
: Defines theMegaverseService
class for higher-level operations.types.ts
: Defines TypeScript types used throughout the project.
- Node.js (version 14 or higher)
- npm (version 6 or higher)
-
Clone the repository:
git clone https://github.com/AlonzoRicardo/crossmint-challenge.git cd crossmint-challenge
-
Install dependencies:
npm install
The candidateId
is passed as a command-line argument when running the script. This approach avoids hardcoding sensitive information.
To build and run the binary, you can use the following command:
-
Build the TypeScript code:
npm run build
-
Run the script with your candidate ID:
npm run start -- --candidate-id c8c6a11c-3fda-4dd7-b0a5-cae630b2c613
This will compile the TypeScript code and run the script with the specified candidate ID.
If you prefer to run the project in a Docker container, follow these steps:
-
Build the Docker image:
docker build -t crossmint-challenge .
-
Run the Docker container with your candidate ID as an argument:
docker run crossmint-challenge --candidate-id c8c6a11c-3fda-4dd7-b0a5-cae630b2c613
This will build the Docker image and run the container. Make sure to pass the candidate ID as an argument.
To run the test suite for this project, follow these steps:
-
Ensure you have installed all dependencies as described in the Installation section above.
-
Run the following command in the project root directory:
npm test