{"id":21363554,"url":"https://github.com/gitericsson/fxql_parser","last_synced_at":"2026-04-12T14:39:26.531Z","repository":{"id":263984964,"uuid":"891965463","full_name":"gitEricsson/FXQL_Parser","owner":"gitEricsson","description":"A NestJS-based Foreign Exchange Query Language (FXQL) Statement Parser that processes and stores currency exchange rate information.","archived":false,"fork":false,"pushed_at":"2024-11-21T10:47:01.000Z","size":105,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T19:36:33.082Z","etag":null,"topics":["docker","mongodb","nestjs","postgresql"],"latest_commit_sha":null,"homepage":"https://fxql-backend-y1a0.onrender.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitEricsson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-21T09:22:36.000Z","updated_at":"2024-11-29T09:17:09.000Z","dependencies_parsed_at":"2024-11-21T11:45:06.897Z","dependency_job_id":null,"html_url":"https://github.com/gitEricsson/FXQL_Parser","commit_stats":null,"previous_names":["gitericsson/fxql_parser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitEricsson%2FFXQL_Parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitEricsson%2FFXQL_Parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitEricsson%2FFXQL_Parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitEricsson%2FFXQL_Parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitEricsson","download_url":"https://codeload.github.com/gitEricsson/FXQL_Parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243836028,"owners_count":20355616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","mongodb","nestjs","postgresql"],"created_at":"2024-11-22T06:19:55.415Z","updated_at":"2025-12-31T00:20:41.046Z","avatar_url":"https://github.com/gitEricsson.png","language":"TypeScript","readme":"# FXQL Parser\n\nA NestJS-based Foreign Exchange Query Language (FXQL) Statement Parser that processes and stores currency exchange rate information.\n\n## Features\n\n- FXQL statement parsing and validation\n- Singleton Design\n- Response compression\n- PostgreSQL database integration\n- Rate limiting\n- Comprehensive logging\n- Docker support\n- API documentation (Swagger)\n- Unit tests\n\n## Prerequisites\n\n- Node.js (v18 or later)\n- Docker and Docker Compose\n- PostgreSQL (if running locally)\n\n## Installation\n\n### Using Docker\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/yourusername/fxql-parser.git\ncd fxql-parser\n```\n\n2. Create a `.env` file based on the example:\n\n```bash\ncp .env.example .env\n```\n\n3. Start the application using Docker Compose:\n\n```bash\ndocker-compose -f docker-compose.yml up --build -d\n```\n\nThe application will be available at `http://127.0.0.1:3000`.\n\n### Local Development\n\n1. Install dependencies:\n\n```bash\nnpm install\n```\n\n2. Configure environment variables:\n\n```bash\ncp .env.example .env\n# Edit .env with your local database credentials\n```\n\n3. Start the development server:\n\n```bash\nnpm run start:dev\n```\n\n## API Documentation\n\n### Base URL\n\n`http://localhost:3000/api`\n\n### Endpoints\n\n#### 1. Parse FXQL Statement\n\n- **Endpoint**: `http://localhost:3000/`\n- **Method**: `POST`\n- **Description**: Parses, validates, and saves FXQL statements to the database.\n\n##### Request\n\n- **Content-Type**: `application/json`\n- **Body**:\n\n### POST\n\nParses and stores FXQL statements.\n\n#### Request Body\n\n```json\n{\n  \"FXQL\": \"USD-GBP {\\n BUY 100\\n SELL 200\\n CAP 93800\\n}\"\n}\n```\n\n#### Success Response (200 OK)\n\n```json\n{\n  \"message\": \"FXQL Statement Parsed Successfully.\",\n  \"code\": \"FXQL-200\",\n  \"data\": [\n    {\n      \"EntryId\": 1,\n      \"SourceCurrency\": \"USD\",\n      \"DestinationCurrency\": \"GBP\",\n      \"SellPrice\": 200,\n      \"BuyPrice\": 100,\n      \"CapAmount\": 93800\n    }\n  ]\n}\n```\n\n#### Error Responses\n\n- **Status Code**: `400 Bad Request`\n\n  - **Response Body**:\n\n  ```json\n  {\n    \"message\": \"Invalid FXQL Statement.\",\n    \"code\": \"FXQL-400\"\n  }\n  ```\n\n- **Status Code**: `429 Too Many Requests`\n  - **Response Body**:\n  ```json\n  {\n    \"message\": \"Rate limit exceeded.\",\n    \"code\": \"FXQL-429\"\n  }\n  ```\n\n## Testing\n\nRun the test suite:\n\n```bash\nnpm run test\n```\n\nRun the end-to-end test:\n\n```bash\nnpm run test:e2e\n```\n\nRun tests with coverage:\n\n```bash\nnpm run test:cov\n```\n\n## Rate Limiting\n\nThe API implements rate limiting with the following default settings:\n\n- 100 requests per minute per IP\n- Configurable via environment variables:\n  - `RATE_LIMIT_TTL`: Time window in seconds\n  - `RATE_LIMIT_LIMIT`: Maximum number of requests per window\n\n## Logging\n\nThe application logs HTTP requests with the following information:\n\n- Method\n- URL\n- Status code\n- Response size\n- Response time\n- User agent\n- IP address\n\n## Environment Variables\n\n```\nDATABASE_HOST=localhost\nDATABASE_PORT=5432\nDATABASE_USERNAME=postgres\nDATABASE_PASSWORD=postgres\nDATABASE_NAME=fxql_db\nRATE_LIMIT_TTL=60\nRATE_LIMIT_LIMIT=100\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitericsson%2Ffxql_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitericsson%2Ffxql_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitericsson%2Ffxql_parser/lists"}