Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hjerpbakk/graphqldotnet
Educational repository showcasing a GraphQL API consumed by a Xamarin Forms app.
https://github.com/hjerpbakk/graphqldotnet
appcenter asp-net-core-web-api csharp graphql openweather xamarin xamarin-android xamarin-forms xamarin-ios xaml
Last synced: 2 months ago
JSON representation
Educational repository showcasing a GraphQL API consumed by a Xamarin Forms app.
- Host: GitHub
- URL: https://github.com/hjerpbakk/graphqldotnet
- Owner: hjerpbakk
- License: mit
- Created: 2019-10-31T08:32:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T09:13:12.000Z (about 2 years ago)
- Last Synced: 2023-11-30T15:20:27.177Z (about 1 year ago)
- Topics: appcenter, asp-net-core-web-api, csharp, graphql, openweather, xamarin, xamarin-android, xamarin-forms, xamarin-ios, xaml
- Language: C#
- Homepage:
- Size: 6.64 MB
- Stars: 8
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Weather--
![Screenshots of the app](screens.PNG)
## An app showcasing GraphQL with ASP.Net Core 3 and Xamarin Forms
This is an educational repository showcasing a GraphQL API consumed by a Xamarin Forms app. This repository can be used as a template for:
- a modern Xamarin Forms 4.3 app with clean and testable architecture consuming a GraphQL endpoint
- an Asp.Net Core 3 GraphQL server in front of the [OpenWeather](https://openweathermap.org) APIsThe API can be explored on [https://graphql-weather.azurewebsites.net/ui/playground](https://graphql-weather.azurewebsites.net/ui/playground).
The code uses some of the new features of C# 8, such as nullable reference types.
I've given a presentation on modern Xamarin Forms and this repo in particular at a local .Net User Group meeting, and you can view the slides below here:
https://speakerdeck.com/sankra/xamarin-forms-from-duplo-to-lego
## Run locally
The apps needs a tiny bit configuration before running locally:
### The server
The server needs an *OpenWeather API key*, which is available for free on [openweather.org](https://openweathermap.org). This key must be set as an environment variable or present in `appsettings.json` for the server to run:
```shell
OpenWeatherConfiguration__ApiKey="[APIKEY]"
```To run the server after configuration is in place, navigate to the `/src/API/GraphQLDotNet.API`-folder, and run:
```shell
dotnet run
```### The apps
The apps need the *address of the server* and optionally an *AppCenter secret*, for iOS and/or Android, to use crash reporting and analytics in AppCenter. These must be specified in a `secrets.json` file present at the root of the `src/Mobile/GraphQLDotNet.Mobile` project. This file is ignored by Git.
If the server is running locally, you can use:
```json
{
"ApiBaseAddress": "localhost",
"AppCenteriOsSecret": "",
"AppCenterAndroidSecret": ""
}
```Then either `GraphQLDotNet.Mobile.Android` or `GraphQLDotNet.Mobile.iOS` can be run from Visual Studio.