Demo .NET 5 API with React static front end that displays a list of pubs in Leeds.
Apps may be run natively or in production mode with Docker.
Run docker-compose up
from the root of the repository. This will run tests and build/run containers for both apps. Browse the web app at http://localhost:8080. The API has a single endpoint at http://localhost:8081/pubs.
Requires .NET 5 SDK. Navigate to the api
directory and run commands as required.
dotnet run -p BeerQuestApi
- run APIdotnet test
- run integration tests
Minimal API with source in a single file. Example integration tests spin up the API in memory. Test data currently coupled to csv file used by the API.
Libraries/tools:
- CsvHelper
Requires NodeJS 16. Navigate to the web
directory and run npm scripts as required.
npm install
- install depsnpm run start
- run app in dev modenpm run test
- run jest testsnpm run build
- build production bundle
Simply fetches list of pubs and renders entire list with text filter. Images are lazy loaded and fetched as they scroll into view. Page is responsive thanks to Bootstrap. Minimal test example includes testing user interaction. Libraries/tools:
- Create React App
- React Bootstrap
- React Lazyload
- Axios
- NGINX - hosts the static site in Docker