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
pnmp
package manager is installed - see instructions eg. https://pnpm.io/installation - Run
pnpm i
to install dependencies - Run
pnpm dev
to runserver
andfrontend
application - You can run apps separately by using
filter
flag eg.pnpm --filter @vandeley/frontend dev
orpnpm --filter @vandeley/frontend dev
- To build project use
pnpm build
command - 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:
count
is number of cities that starts with providedletter
,cities
is the array of cities objects withname
property.
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.