An app that displays country data using technology that I like or want to try.
Original data is from https://restcountries.com/v3.1/all, September 2023.
This app isn't production ready:
- it only works on localhost
- security hasn't been considered (eg. cors is enabled for everyone)
- test coverage is low
- UX is almost completely absent in some places
cd frontend
npm install
- Generate new component (eg button) with
npx shadcn-ui@latest add button
npm run dev
npm test
- see also scripts in
package.json
cd backend
cp .env.example .env
npm install
- start db with
docker-compose up -d
npm run db:reset
npm run start:dev
npm test
- see also scripts in
package.json
- interact with db
docker exec --tty --interactive countries-postgres-dev psql --host=localhost --username=postgres --dbname=countries-dev
- react-router-dom@6?
- no. Documentation is overwhelming
- use v5 instead
- deno?
- no. I don't know if it has enough traction to be worth learning yet.
- backend framework
- choice: nestjs
- alternative 1: nextjs instead. No, because I thought it would be too much new at once
- might be worth considering later
- alternative 2: fastify. No, because its motivation is performance that that isn't a priority
- trpc?
- no. I think it's too new
- might be worth considering if switching to nextjs
- Where should the backend live?
- deprecated:
no need to store countries in a DB because because it's only a read operationsorting/filtering/searching can be done in the FE
- store countries in DB otherwise there are multiple data sources
- use
@lukemorales/query-key-factory
?- no. I didn't understand the value
- Should
prisma
be inside src?- no. It is isn't in this example
- use zod for validation at runtime