This app lets users enter a letter and returns the number of cities (from OpenWeatherMap sample data) that start with that letter.
This is pnpm managed monorepo - you need pnpm to run it properly. See "Running the App" section for more details.
- Frontend: React + Vite + TypeScript
- Backend: Node.js + TypeScript
Typescript is used on backend and frontend side for better type handling.
- Make sure pnmppackage manager is installed - see instructions eg. https://pnpm.io/installation
- Run pnpm ito install dependencies
- Run pnpm devto runserverandfrontendapplication
- You can run apps separately by using filterflag eg.pnpm --filter @vandeley/frontend devorpnpm --filter @vandeley/frontend dev
- To build project use pnpm buildcommand - see next section
When running pnpm build command both applications will write the output to:
- backend/bin
- frontend/dist
directories.
Use the output files for deployment.
Backend is using node v. 22.15.0 (see .nvmrc file for specified version). Server is running on port 3000.
GET /api/v1/cities endpoint expects letter param as input.
Response:
- countis number of cities that starts with provided- letter,
- citiesis the array of cities objects with- nameproperty.
example response:
{
    "cities":
        [
            {
                "name": "Al Khums"
            }
        ],
    "count": 1
}Frontend is using React as library and vite as bundler. App is running on port 5173 in dev mode with dev server.
ESlint and Prettier are installed for better code quality management.
Please use pnmp lint and pnmp format commands when contributing.
