Coder Social home page Coder Social logo

lavinia-api's People

Contributors

log234 avatar simendag avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lavinia-api's Issues

fix: make xml-comments appear in Swagger again

Splitting the original project into Lavinia-api and Lavinia-client likely had the side-effect of XmlDocument.xml not being configured properly. The original project has working comments, whereas the split project does not.

Create CONTRIBUTING.md

Description

To ease onboarding and make sure code reviews only focus on what matters, it is important to have a common standard of contribution (and reviews), conventions relevant for the repository in question.

Set up an actual database that works on multiple OSes

Right now we are using an InMemory database; this is less than ideal as the database has to be re-populated every single time it restarts, and should we want to have some actual "history" of the data (ie, fixes, etc) then InMemory is less than ideal.

I suggest we use PostgreSQL as a database, but other options are also available (PostgreSQL is known to work well on both Windows and Linux, but I am unsure about how well it integrates with say, Azure).

Improve handling of optional parameters in the API

I dislike the usage of "default values" in the constructor, as it messes up Swagger's documentation and gives an indication to the user that all the parameters are necessary. I also think the defaults should be set in constants since they are re-used.

        public IActionResult GetVotes(int year?, string? partyCode, string? district)

Originally posted by @simendag in #11

Ensure the API works on Linux

There has been little to no testing on the API in regards to Linux, and it could very well be that our hosting solution ends up being there, so it should be tested that this is a viable possibility.

Make available election years "visible" to the user

Right now a consumer of the API has to "guess" the election years available. There is no reason not to have a database-entry for which election years are currently accessible, or even an endpoint for that matter.

feat: Add rate limiting to API

There have been problems with development as some kind of scan/Denial of Service attack is executed at 12 hour intervals. In response we need to implement rate limiting to slow down the consumption.

Initially something like 1-2 requests per minute per endpoint seems reasonable.

Add predetermined district seat numbers to the API

The new API should also support returning predetermined district seat numbers for elections before 2005, where these were not calculated based on population and area.
It should be handled in a way so that you always return values for both area factor and predetermined seat numbers. But in the case where the seat numbers are calculated, the predetermined seats should be listed as 0. And when the seat numbers are predetermined area factor should be a big negative number, preferably -inf if possible, otherwise -999. This makes it easy to check for and still allows for plausible but unlikely situations where the area factor might actually be 0.

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.