You are right in that in repo, one sells a collateral to another party and agrees to repurchase it at a fixed price in the future, and is essentially a collateralised borrowing. The difference between the fixed repurchase price and the initial sale price is essentially interest (repo rate), and is calculated using money market conventions as repos are usually short dated transactions.
However, the initial cash would be based on the market value of the collateral, and usually the lender would apply a hair cut, say 2% so you get cash of 98% of the market value of the collateral. The repurchase price would be calculated based on this initial cash, so you will pay interest on what you borrowed. The haircut is to protect the lender in case the value of the collateral declines, or to reflect any other risks associated with the collateral such as illiquidity, wrong way risk etc. In exchange cleared transaction, intial margin plays similar role.
In terms of mark to market value, it depends on the perspective but general principles are the same. The value of the collateral is its current market value, including any accrued interest/coupon etc as seller would be receiving any coupons paid during the life of the repo. The value of the cash leg is just initial cash plus accrued repo interest for simple calculations. For more accurate valuation, you can take the terminal value and discount it at the then market repo rate as an alternative. You have locked the interest at the rate agreed at the time of the transaction, but today rate could be different. I ignored counterparty risk etc, though you might need to take these into accounts for full valuation- e.g., the 2% haircut is unsecured lending to the counterparty?
Hope this helps.