Giter VIP home page Giter VIP logo

circleforms's People

Contributors

apollo-dw avatar b0und avatar dependabot[bot] avatar justroxy avatar keziahmoselle avatar stanriders avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

b0und roansong

circleforms's Issues

User hovercard

image

With user data in it to complement the Player data present in a form submission:
image

User should be able to see results of a poll

  • Sorting by different data points
  • Selectable representation of answers (by poll creator?)
  • Hiding unnecessary data (by poll creator?)
  • Exporting (#7)
  • Different result accessibility (#6)
  • Backend
  • Frontend
  • Design

Pages

Currently working on

  • Single form
  • Create form

Waiting for design

  • Edit form
  • Filling a form

Done

  • Homepage
  • Forms List
  • Dashboard
  • Settings
  • Our Team

Different accessibility of polls

  • Poll types
    • Public poll (can be accessed directly)
    • Link-only poll (poll link should have a key for accessing it)
    • (low-prio) Poll limited to a set of users (won't be accessible unless user is in the set, pretty much invites)
    • (low-prio) Friends-only poll? (friend list can be taken from API)
  • Poll results accessibility
    • Always public
    • Public after completion
    • Link only
    • Invites
    • Host only
  • Rank/pp/gamemode limited polls
    • Rank/pp
    • Gamemode only
  • (low-prio) User blacklisting

User should be able to create new polls

Multiple pages of answers for when there are too many of them?

  • Backend
    • Adding questions
      • Freeform answers
      • Choice answers
    • Accessibility (#6)
    • Publishing (#55)
  • Frontend
    • BBCode
  • Design

User should be able to lock the post

For example, a tournament registration form should only be available until a certain date. Currently, there's no way to stop people from adding additional answers to the form.

  • When they want to
  • Timed
  • Frontend
  • Design

Improve TS codegen

Currently we are only generating types from swagger schema, but it`s possible to generate full api client as well. With the current workflow, after the backend changed some of the api types it proved to be quite difficult to adjust to all of the changes.

The new workflow of interacting with api would ideally look something like this:
[requirement 1]

// we would also get autocomplete on all possible backend actions with type safety
apiClient.postsPOST(myjson)

[requirement 2]
Another important requirement is to be able to set credentials: include (and custom headers in general) on the fetch api call. Because otherwise the auth cookie is not sent and the request fails with CORS errors. (shivers)

openapi-typescript

Currently we are using openapi-typescript package, which only generates types, but recommends to use openapi-typescript-fetch for generating the client.

openapi-typescript-fetch supports custom headers config, but the api client workflow looks like this:

// declare fetcher for paths
const fetcher = Fetcher.for<paths>();

// create fetch operations
export const apiClient = {
  postsPOST: fetcher.path("/posts").method("post").create(),
  postsIdGET: fetcher.path("/posts/{id}").method("get").create()
};

So we end up creating every single method by hand, which in my opinion is too much of an overhead.

Other options

Upon further research i stumbled upon this great article. Some of the best scoring generators in their opinion are Nswag and Typewriter.

Typewriter

So first things first, Typewriter while scoring extremely high, requires modifying c# backend code, which sounds quite questionable. I wasn`t really able to test this solution. No comments here.

Nswag

Pros:

  • Well maintained (5k stars)
  • One of the few tools which can not only generate api client/types from swagger.json, but from c# code itself! (Could be used to generate types on backend build)
  • Cool thing is that they actually have a GUI for this tool. There are like a dozen options on how you want to generate your TS code.

Cons:

  • I briefly tested the code that it generates and I actually wasnt able to figure out how to modify the request options easily
  • Docs while massive are not the best imo
  • Generates one huge 3k LOC file.
  • Code quality is kinda meh.

openapi-typescript-codegen

I stumbled upon this thing myself. Its relatively small (only ~700 stars), but i was pleasantly surprised!

Pros:

  • Very easy to customize the headers/options
  • Docs are nice. I was able to get up and running in no time. (In fact default config options already include credentials: "include" option!)
  • Generated code is nicely split and looks clean

Cons:

  • Small user base

I was ready to end my searches here, as it seemed like a suitable solution, but i ended up not noticing an elephant in the room.

Openapi Generator

This one is something else. Really massive (12k stars). Supports almost every language in existance. But lets focus on typescript. First of all it generates a bunch of files, with good structure: models & services. Here comes the mind blowing part. So our original type generator uses strings for dates, and while that technically correct (since that is what the api response returns), we would have to convert dates to strings manually everytime. Openapi Generator actually includes conversion code. So you need to pass a Date object into the PostsService.postPosts({... , activeTo: new Date()}) it will then convert it to iso string internally! Also out of the box it allows us to use camelCase for client-side state and it automatically transforms it into snake_case for backend to consume.
Have i mentioned that the code quality is just next level? To be completely honest i didnt even think about code quality much before looking at this (since its all just generated stuff, who cares), but this is just incredible. It meets both of the requirements and imo it looks like one of the best solutions we could use, but i`d love to hear your thoughts as well!

Moderation

  • Backend
    • User roles
    • Polls removal
    • Answer removal
    • Bans (time based or permanent until manual unban?)
  • Frontend
  • Design

Post publishing

Posts should be only accessible to the user that created it until they "publish" it which will lock post from editing and make it visible according to it's visibility settings

  • API
  • Design
  • Frontend

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.