Giter Club home page Giter Club logo

michalbialecki.com.odata.search's Introduction

MichalBialecki.com.OData.Search

This project is an example how to use flexibility of OData and combine it with React app. The whole solution is widely explained in my blog post: http://www.michalbialecki.com/2020/03/19/odata-as-a-flexible-data-feed-for-react-search/

Technology stack

In this project I used most up-to-date frameworks and packages available. So this is:

  • Web API project in .Net Core 3.1
  • Entity Framework Core, version 3.1.2
  • OData from package Microsoft.AspNetCore.OData, version 7.4.0-beta
  • React, version 16 with many other front-end packages

Core features of this app

I created it as an example how any kind of search and filtering on the front-end can be easily solved on the back-end side with OData integration.

  • OData is a great technology that is very easy and fast to integrate with Entity Framework Core and gives powerful filtering options. It allows you to define operations in url like: filtering, ordering, getting count and top elements. Without and coding needed, it generates a SQL scripts and run it against MS SQL database.
  • to ease working with the API, I integrated Swagger, an interactive documentation, that is available under /swagger url
  • I used hooks in React to follow the latest standards and implement the greatest coding experience. However, I don't feel very strong in React, so please don't take front-end part as a best solution reference

How to run the project

Note that this project needs to be connected to MS SQL database, so you would need to have one to run it

  1. Copy a connection string to appsettings.json file, as a value for element LocalDB. Mine looks like this: Data Source=localhost;Initial Catalog=aspnetcore;Integrated Security=True
  2. Go to /MichalBialecki.com.OData.Search.Web directory and run command dotnet build
  3. Go to /MichalBialecki.com.OData.Search.Web/ClientApp and run command npm install
  4. Go back to /MichalBialecki.com.OData.Search.Web and run command dotnet run

Note that there is also a Swagger installed, so you can see all endpoints when you go to url /swagger. You can also generate profiles to fill in you DB. To do so just run the POST request on url /api/Profiles/GenerateProfiles.

How it looks in practice

I recorded a short video that shows how it works in practice. Have a look:

Michał Białecki OData + React

michalbialecki.com.odata.search's People

Contributors

mikuam avatar

Stargazers

 avatar Ganeshan Venkataraman avatar

Watchers

 avatar

Forkers

aabiye

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.