This project is a NestJS application developed for a task as part of an interview process. It includes features for parsing XML data, transforming it into JSON format, storing it in MongoDB, and exposing a GraphQL endpoint to access the transformed data.
- Parse XML data from external APIs.
- Transform XML data into JSON format.
- Store transformed data in MongoDB.
- Expose a GraphQL endpoint to query the transformed data.
Before you begin, ensure you have the following installed:
- Node.js (recommended version: 14.x)
- MongoDB (Make sure MongoDB is installed and running locally or accessible remotely)
- Docker (optional, for Dockerizing the application)
To get a local copy up and running follow these steps:
-
Clone the repository:
git clone https://github.com/your_username/your_project.git cd your_project
-
Install dependencies: npm install
-
Set up environment variables: MONGODB_URI=mongodb://localhost:27017/vehicle_db PORT=3000
To run the application locally: npm run start The application will be accessible at http://localhost:3000.
-
Build the Docker image: docker build -t nestjs-app .
-
Run the Docker container: docker run -d -p 3000:3000 nestjs-app The application will be accessible at http://localhost:3000.
npm run test
http://localhost:3000/graphql Use this interface to interact with the GraphQL API and explore available queries.