This application is designed into two de-coupled projects.
-
- This project is a .Net core Web API using SQL server localDb as its persistence storage. It provides RESTFul API to front-end application.
It is using .Net Core entity framework to perform CRUD operations.
It is divided into different folders structure for maintain-ability purposes
- Data : It is Entity Framework Database context class. This class is injected as depednecy into API's repository
- Entities : This folder contains data model's classes. This Application has two data entity classes :
Note
&Position
- Repository : It is repository layer of the API that performs CRUD operation on local database. It has dependency on
DbConext
class and is injected as dependency into WebApi controller.The repository's methods is designed as InterfaceINoteRepository
andNoteRepository
implements that interface. - Migrations : This folder contains the auto-generated Db operation performed by entity framework
- Dependencies : This folder contains external dll that is used in the application.
LinqKit
is .Net search predicate builder utility. - Controller : This folder contains API controller class :
NoteController
. It provides RESTFull API end points to front end application. End points are as follow :POST /api/note
It post a new note to the backend and return201
http status codeGET /api/note?lat='{<user position's latitude'}&lng='{user's position longitude}'
.It returns all the notes which are posted in that particular position.GET /api/note/{user}?lat='{<user position's latitude'}&lng='{user's position longitude}'
.It returns all the notes which are posted in that particular position for a particular user.GET /api/note/search?query='{search query}'
.It searches all the notes in its user and content based on the query.
- Program.cs & Startup.cs : These are .Net core standard classes.
Startup.cs
resolves the dependencies, get the connection string and enables CORS for APIs.Program.cs
creates an empty database if it does not exist and initiate the secure pipeline.
- This project is a .Net core Web API using SQL server localDb as its persistence storage. It provides RESTFul API to front-end application.
It is using .Net Core entity framework to perform CRUD operations.
It is divided into different folders structure for maintain-ability purposes
-
- This project is front end of the application. It is implemented as single page application using
AngularJS
. It consumes the backend APIs using angular js http and perform data binding to view.The project structure is as follow.app\ core
: This folder contains custom javascript of application- app.js : This JS file initializes the angular app module and register different angular route
- LandMarkController.js : This JS file calls API endpoint via Angular $http cobject and binds it to angular view
- searchController.js This JS file calls search API and binds the result to search view
- map.js This JS file provider map-related functionalities like drawing on map, closing map info window etc.
app\views
: This folder contains html templates which loads via angular route into index.htmlapp\lib
: Contains Javascript libraries like angular & bootstrap. They are copied as part of NPM build process.
- This project is front end of the application. It is implemented as single page application using
- First run the backend API project from LandMark.API folder
- from visual studio, run LandMark.API project
- Then build front-end packages and run the front-end by following below steps
- From root folder, go to LandMark.Front folder
- run
npm install
from command line to install node packages - run
npm start
to start http server - browse
localhost:8000\index.html
for the application main page - For the first time , application asks to enable browser geo-location and enter the name. It saves the name to cookies for new notes.
Time spent on each part of application
- Backend : 7 hours including database creation
- Frontend : 12 hour : AngularJS + HTML+ CSS markup
- Documentation : 2 hours : Write README file and comment source code
- I ran out of time and could not implement test coverage
- It uses SQL server local db
- It is relying on browser cookie for user session / name
- When loaded show all the notes
- Filter note based on location or user
- Search : By default Notes are not displayed when search page is viwed. user can show a specific note on Map from table of result.