Coder Social home page Coder Social logo

hospital-his's Introduction

Hospital

Small example using Xamarin Forms 2.5, MVC5 and web api.

Login in Xamarin Forms 2.5 with our API. Get, create, delete and update (CRUD) records from Xamarin Forms from our API. All queries from Xamarin Forms are made with token.

License:MIT

Supported Platforms: iOS and Android

The Hospital app is available for two platforms:

  • iOS
  • Android

Projects

There are 5 different solutions:

Api: Project with ASP.NET Web API 2.

BD: Project where we define our classes through code, and EF is responsible for generating the database and everything necessary to fit the classes in them.

Backoffice: Web with a Cpanel for the administration of the app.

HospitalApp: Main project developed with Xamarin.Forms.

Model The common models of all the projects.

Setup

Download or clone the repository. This is a solution with five projects.

Rebuild the solution to get all neccesary NuGet packages.

Update your connectionStrings

Configure a connection string for SQL Server in the Web.config

  <connectionStrings>
    <add name="DefaultConnection" connectionString="Data 
    Source=YOURTDATABASE; 
    Initial Catalog=YOURNAMEDB; Persist Security     
    Info=True;User ID=YOURUSER;Password=YOURPASSWORD”"
    providerName="System.Data.SqlClient" />
  </connectionStrings>-->

Configure validation logic for passwords

By default, if you don't customise anything, Identity configures a default set of validation rules for new passwords. If you want to change these values, you can change the file called App_Start/IdentityConfig.cs

    manager.PasswordValidator = new PasswordValidator
    {
        RequiredLength = 6, // Passwords must be at least 6 characters
        RequireNonLetterOrDigit = false, // Passwords must have at least one digit ('0'-'9')
        RequireDigit = false, // Passwords must have at least one non alphanumeric character
        RequireLowercase = false, // // Passwords must have at least one lowercase ('a'-'z')
        RequireUppercase = false, // Passwords must have at least one uppercase ('A'-'Z')
    };

PasswordValidator Class

Set the color in the project

In our PCL, the file App.xaml you can change the color

    <Color x:Key="MainColor">#273646</Color>
    <Color x:Key="FontColor">#2d8dd6</Color>
    <Color x:Key="AccentColor1">#2371aa</Color>
    <Color x:Key="AccentColor2">#e44235</Color>
    <Color x:Key="BackgroundColor">#e9eeef</Color>

Resource Dictionaries

Set your API

In our PCL, the file Services/HttpService.cs you must put the url of your api and prefix

   private const string UrlApi = "YOURAPI";
   private const string tokenType = "bearer";
   protected const string FirstVersion = "/api";

Enjoy!

Check your API with postam

Security

OAuth 2.0 protocol and Microsoft Owin Library will help us. Owin is basically creating own pipeline between iis and application to manage requests.

In the file Startup.Auth.cs an OWIN Authorization server is configured to accept login (token) HTTP requests at /Token endpoint and external login requests at /api/Account/ExternalLogin

Requirements

Tools used

The following tools are essential:

  • Genymotion - The Best Android Emulator
  • Postman - Application which is used to fire requests to an API. It is possible to make different kinds of HTTP requests – GET, POST, PUT, PATCH and DELETE.
  • Quicktype - Generate c# classes from json.
  • Color Adobe - To create color schemes for my designs. For this project I have choosen

Licenses

This project uses some third-party assets with a license that requires attribution:

Recommended links

Getting Started with ASP.NET MVC 5

Copyright and license

The MIT License (MIT) see License file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.