stanriders / circleforms Goto Github PK
View Code? Open in Web Editor NEWFor all your circle-clicking related questions
Home Page: https://circleforms.net/
For all your circle-clicking related questions
Home Page: https://circleforms.net/
Maybe add some other actions only for mods?
Use interfaces generated from swagger
https://github.com/drwpow/openapi-typescript#readme
Open page with wysiwyg editor, press enter a bunch of times -> the area expands.
Press preview twice, it doesnt expand anymore and is stuck at its initial size.
Way to quickly export players for tournament screening?
Will need some kind of invite system - "captain" responds with a list of players, other players have to confirm that respond for it to go through
Crowdin?
Don't think this should be editable? We should replace this with DateTime? ActivePeriodStart
and DateTime? ActivePeriodEnd
later
Originally posted by @stanriders in #130 (comment)
Do we even need to populate posts here? Seems to be a waste of time (/me is being called quite often) and traffic. We can expose a separate endpoint for getting posts of the signed user for when we need them
Originally posted by @stanriders in #118 (comment)
There should be possible to assign additional authors to each post
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)
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.
Upon further research i stumbled upon this great article. Some of the best scoring generators in their opinion are Nswag and 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.
Pros:
Cons:
I stumbled upon this thing myself. Its relatively small (only ~700 stars), but i was pleasantly surprised!
Pros:
credentials: "include"
option!)Cons:
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.
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!
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
Originally posted by @stanriders in #52 (comment)
https://osu.ppy.sh/docs/index.html#authorization-code-grant
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.