- ASP.Net Core 3.1
- Code in C#
- JWT Authentication for user registrations and login from client app
- SignalR for fast delivery of image data to client app
- Search by city name or GPS coordinates
- Asynchronous Tasks
- Dependancy Injection
- Clone the repo to your local machine
- Open the solution in Visual Studio
- Create a new database in SQL Server
- Run the database scripts from the 'Database Scrpts' Folder on your new database
- Update the connection string in 'WebAPI/appsettings.json'
- Update the FourSquare app credentials in 'WebAPI/appsettings.json', with your own app credentials. If you don't have a FourSquare app, you can create one here > https://developer.foursquare.com. Or you can use mine :) Note: There is an image request limit for a free FourSquare account. Limited to 50 images per day. So if you do 3 tests of 15 landmarks for a given city, then your limit will be reached.
- Make sure to do a clean and build
- Open a new command terminal in Visual studio
- Make sure your path is pointing to the WebApi project. If you not already in WebApi, then type 'cd WebApi'
- Type 'dotnet run' to host the api
You can test the end points using Postman. You may download Postman here > https://www.postman.com/. Open Postman and test the end points listed below.
-
Fetch landmarks by a given location
End point [Get]: http://localhost:4000/landmarks/search/landmark/{location}/{userid}
Update the parameter {location} with your city of choice eg: Durban or a set of GPS coordinates eg: 29.8587, 31.0218
Update the parameter {userid} with a userId. Supply 0 for anonymous user
Note: Testing this end point via Postman or any other API test software, will return a status code of '200 OK', however, you will not see the results as the reults are sent back to the client side app using SignalR -
Fetch all locations
End point [Get]: http://localhost:4000/landmarks/locations -
Fetch photo details
End point [Get]: http://localhost:4000/landmarks/photo/{id}
Update the parameter with a photo id that relates to FourSquare -
Fetch location by User from local database
End point [Get]: http://localhost:4000/landmarks/user-location/{userid}
Update the parameter {userid} with a userid
Note: This method requires authentication. To test via Postman, you may decorate the method with [AllowAnonymous] and rebuild the solution, else pass a valid auth token in the header -
Fetch saved imnages by location from local database
End point [Get]: http://localhost:4000/landmarks/search-saved-images/{location}
Update the parameter {location} with a location eg: Durban
Note: This method requires authentication. To test via Postman, you may decorate the method with [AllowAnonymous] and rebuild the solution, else pass a valid auth token in the header