Files
mission-control/README.md
T
2026-07-27 19:21:52 +01:00

100 lines
4.3 KiB
Markdown

# Mission Control 🚀
Welcome! This is the starter repo for the X-Lab take-home exercise.
Mission Control is a small app for running a (fictional) space programme. It is built the way we build software at X-Lab: a C#/.NET API using FastEndpoints and Entity Framework Core on SQL Server, and a React + TypeScript front end using Vite, TanStack Router/Query, and Mantine.
The app currently does one thing: it tracks **missions**. The full vertical slice for missions — endpoint, validation, data access, UI, and tests work out of the box.
## Your task
Mission Control can plan missions, but nothing ever lifts off. The flight team wants to schedule **launches**.
Build the launches feature end to end. Requirements:
- A launch belongs to a mission and has, at minimum, a scheduled time and a status.
- Launches can be created and viewed in the UI.
- Invalid input is rejected sensibly.
- At least one test, wherever you think it adds the most value.
Everything else is your call: the fields, the routes, the UX, what "sensible validation" means, how launches relate to missions. The missions slice shows you our patterns — follow them, or deliberately diverge and tell us why in DECISIONS.md.
If you finish the core and want to keep going, there is an **optional extension**: take the app in a direction that shows us something you care about. More features, refactor, nicer UX, more tests, infrastructure (see [terraform/](terraform/)), whatever you like. This is genuinely optional.
## Time
We would much rather see a thoughtful, unfinished hour than a polished weekend, we will talk through what you built together at the next stage.
## AI
Use whatever tools you use day to day, **including AI — we do**. We are not testing whether you can code without it. What we care about is the judgement on top: what you chose to build, what you accepted or rejected, and whether you understand what you shipped.
## DECISIONS.md
Before you send your submission back, spend a few extra minutes filling in [DECISIONS.md](DECISIONS.md). We will keep this open and read as we review your submission.
## Getting started
You will need:
- [.NET 10 SDK](https://dotnet.microsoft.com/download)
- [Node 20+](https://nodejs.org/)
- [Docker](https://www.docker.com/products/docker-desktop/)
Then:
```bash
# 1. Start SQL Server
docker compose up -d
# 2. Install front-end dependencies
npm install --prefix src/mission-control-client
# 3. Run the app (starts the API and the Vite dev server together)
dotnet run --project src/MissionControl.Server
```
****
Open http://localhost:5173 — you should see the seeded missions. Database migrations and seed data apply automatically on startup.
Swagger UI is at http://localhost:5010/swagger.
> **Apple Silicon:** the SQL Server image is x64 and runs via Rosetta. If the container fails to start, enable "Use Rosetta for x86_64/amd64 emulation" in Docker Desktop → Settings → General.
## Running the tests
```bash
dotnet test
npm test --prefix src/mission-control-client
```
## The lay of the land
| Path | What it is |
| --- | --- |
| `src/MissionControl.Server` | The API host. Endpoints live in `Endpoints/<Feature>/`, one file per operation with its request, response, and validator alongside. |
| `src/MissionControl.Domain` | Domain entities. |
| `src/MissionControl.Data` | EF Core: DbContext, entity configurations, migrations, dev seed data. |
| `src/mission-control-client` | The React app. File-based routes in `src/routes/`, API calls and types in `src/api/`. |
| `test/MissionControl.Server.Tests` | xUnit + Shouldly + NSubstitute, with example endpoint and validator tests (endpoints test against in-memory SQLite via `TestDatabase`). |
| `terraform/` | A small, optional Azure skeleton. Not needed to run anything locally. |
## Useful commands
Add an EF migration:
```bash
dotnet ef migrations add AddLaunches --project src/MissionControl.Data --startup-project src/MissionControl.Server
```
Reset the database (the container has no volume, so this starts fresh):
```bash
docker compose down && docker compose up -d
```
## Submitting
Send back either a zip of the repo (please leave out `node_modules`, `bin`, and `obj`) or a link to a private repo — whichever is easier. If you use git as you go, keep the history; we enjoy reading it.
If anything in the starter is broken or confusing, please let us know.