Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Node.js
node_modules/

# Build output
/dist
70 changes: 70 additions & 0 deletions SOLUTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Solution Overview

This document describes the design, implementation, and assumptions for the Investment Performance Web API solution s

---

## Technology Stack

- Node.js (ESM)
- TypeScript
- Express
- Jest (unit testing)
- tsx (local development)

> This solution is implemented in TypeScript/Node.js to showcase familiarity with modern API design, asynchronous workflows, and testable service-oriented architecture. The overall structure maps cleanly to patterns commonly used in ASP.NET Core (controllers, services, repositories, middleware).

---

## Running the Application

### Prerequisites
- Node.js 25

### Install dependencies
```
npm install
```

### Run tests
```
npm test
```

### Run locally
```
npm run dev
```

The API will be available at
```
http://localhost:3000
```

## API Endpoints
### Get a list of current investments for the user
```
GET /api/users/:userId/investments
```
> Sample UserId:
>>
```
user1
user2
```
### Get details for a user's investment:
```
GET /api/users/:userId/investments/:investmentId
```
> Sample details:
```
userId: user1
investmentId: EQ-001
```
## Assumptions & Scope Decisions

* Data is stored in memory for simplicity
* Current prices are provided by a mocked pricing provider
* Authentication and authorization are out of scope
* No persistent database is included
* User context is provided via route parameters
6 changes: 6 additions & 0 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
testMatch: ["**/*.test.ts"],
clearMocks: true
};
Loading