A Foreign Exchange Query Language (FXQL) Statement Parser designed to serve as part of a central federation system for Bureau De Change (BDC) operations, enabling the standardization of exchange rate information.
- FXQL Syntax Parsing: Validates FXQL statements for syntax compliance.
- Database Storage: Stores valid statements in a PostgreSQL database using Prisma ORM.
- Comprehensive Error Responses: Returns detailed error messages with line numbers and positions.
- Batch Processing: Handles multiple FXQL statements in a single request.
- Scalable and Secure: Built on NestJS for scalability and secure API development.
- NestJS: Framework for scalable and efficient server-side applications.
- TypeScript: Static typing for JavaScript.
- Prisma: Next-generation ORM for database management.
- PostgreSQL: Relational database system.
- Docker: Containerized deployment.
Ensure you have the following installed:
- Node.js (v18+)
- Docker (for containerized development)
- PostgreSQL
-
Clone the repository:
git clone git@github.com:Timothy-py/FXQL-Parser.git cd FXQL-Parser
-
Install dependencies:
yarn install
-
Set up environment variables:
Create a
.env
file in the root directory:DATABASE_URL=postgresql://username:password@localhost:5432/fxql_db PORT=3000 NODE_ENV=DEVELOPMENT
-
Generate the Prisma client:
npx prisma generate
-
Generate database tables:
npx prisma db push
-
Build and run the containers:
docker-compose up --build
-
Access the application at http://localhost:3000.
-
Start the application:
yarn start:dev
-
The application will run at http://localhost:3000.
yarn test
- POST
/fxql-statements
: Submit FXQL statements for parsing and validation.
Request:
{
"FXQL": "USD-GBP {\\n BUY 0.85\\n SELL 0.90\\n CAP 10000\\n}"
}
Response:
{
"message": "FXQL Statement Parsed Successfully.",
"code": "FXQL-200",
"data": [
{
"EntryId": 1,
"SourceCurrency": "USD",
"DestinationCurrency": "GBP",
"BuyPrice": 0.85,
"SellPrice": 0.90,
"CapAmount": 10000
}
]
}