This is a diary project developed using C# and .NET Core. It consists of an api server, and a client application.
The lauch settings of the server are written in
DiaryProject.Api/Properties/launchSettings.json
The client registers the url in DiaryProject/App.xaml.cs by
containerRegistry.RegisterInstance("/*url*/", "webUrl");
which is accessed via dependency injection.
In my usage the api server is hosted on IIS Express on localhost.
When the users start the client application, they arrive at the login page. If connected to server the user can register or log in, then can choose between using local data or cloud data. Or in any case user can choose offline mode which uses local data.
After the above process is done, the user arrives at the main page. The leftmost column concists of four bunttons transition between pages:
This is the page where the user can log out or choose between local and cloud data. If the user uses offline mode then this page is not accessable.
This displays the calendar of a month, active records in a day will be displayed in the corresponding unit.
When a unit of day is selected, the user can click the Editor tab on the left or double-click the unit to edit its records.
The editor lists all records in the day, where the user can add/delete and enable/disable records. The user can also edit their title, category and time. By clicking the expand button the user can edit the content of the record.
This provides hover settings, as well as explanation for how hover works.
The solution consists of three projects:
This project consists of the shared classes used in both the client and the server, as well as some utils.
This is the api server, the entry point is at Program.cs, where services are injected building the web application.
This consists of a generic base interface IBaseService which provides async methods operating the database on the server, then return an api response.
The generic types are implemented in IMemoService and IUserService providing services of the corresponding kind, and the methods' implementation are given in MemoService and UserService.
This provides repositories consisting of DB contexts providing access to database, they are organized in a Unit of Work.
This provides api controllers in a RESTful style.
This is the client, the entry point is at App.xaml.cs which also uses DI. This is written in an MVC structure.
The idea is the same as that on the server side, but here there are local services and web services. The local one operates on the local database and the web one sends requests to the server.
Local operations are implemented with accessing a local database in SQLite. Web request are written in a RESTful style using RestSharp.
Views consists of user pages written in .xaml, bound to their view models.


