apioo / fusio

Open source API management platform
https://www.fusio-project.org
Apache License 2.0
1.87k stars 223 forks source link

getting started #438

Open test2a opened 2 years ago

test2a commented 2 years ago

hi. call me completly clueless about this but i wanted to use fusio as a backend for my application(browser application). i have 2 major steps.

  1. user registration/login
  2. api proxy and gateway whereby browser extension sends api to my server which proxies to a third party server. the response is sent back to the user with our server doing rate limiting, api calls
  3. monetizing user registration and api calls being made. i have tried to get a hang of the documentation but i am perplexed.

i checked the cms demo but i dont understand how it works... my questions are these.

  1. is there a basic demo data that i can import into a server, change the monetization endpoints and get started? do i have to do everything from scratch.?
  2. i am having trouble with docker as well, the documentation says change docker-compose.yml and i did. the login is refusing citing cors
Source map error: Error: request failed with status 404
Resource URL: http://api.browser.website.in:8080/apps/fusio/dist/fusio.min.css
Source Map URL: bootstrap-theme.min.css.map

XHROPTIONShttp://api.fusio.cloud:8080/authorization/token
CORS Failed

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://api.fusio.cloud:8080/authorization/token. (Reason: CORS request did not succeed). Status code: (null).
2
XHRPOSThttp://api.fusio.cloud:8080/authorization/token

basically https://github.com/apioo/fusio-docker/issues/12

anyways, i followed the steps and i have a new error

POSThttp://api.browser.website.in:8080/authorization/token
[[HTTP/1.1 401 Unauthorized 428ms]]()

any ideas? i am using docker so i don't think i should be facing this error but i am.

chriskapp commented 2 years ago

Hi, no worries, so the CMS demo is basically more an example if you want to use Fusio as an API framework, but I would guess that this is not needed in your case since you only want to use basic features which are already available. Regarding the question about demo data, so in general if you install Fusio i.e. through docker everything should be available, in your case you would need to use the HTTP-Processor action to proxy an request to you internal API like described in s. https://docs.fusio-project.org/docs/bootstrap So we have no demo data but in our latest docker version we have also already included stripe as payment provider so you basically only need to create a "stripe" connection using you key/secret and then you can create a plan which can be purchased at the developer portal by 3rd party developers to access your internal API.

That being said we have just migrated all of our documentation to a new website which also contains a documentation page about the monetization setup s. https://docs.fusio-project.org/docs/use_cases/setup_monetization This also not perfect yet so feel free to provide some feedback where we can improve the documentation.

Regarding the docker login problem, I will respond then at the issue at the docker repo.

test2a commented 2 years ago

@chriskapp i managed to solve the docker issue so now i am logged into to fusio. i still have a bug that i am unable to download the "developer" in marketplace. "The server encountered an internal error and was unable to complete your request.". i don't know what to do with that so i am leaving it for now.

my question is this. the documentation is "only" explaining what a setting is, maybe that is helpful for people who understand it but i am unable to.

my problem was simple. build an api that registers and logs in users. i have checked the google groups and i found https://groups.google.com/g/fusio/c/LzJvCN88pvU/m/ClmfiyIcBAAJ

which mentions to check consumer/register https://demo.fusio-project.org/apps/documentation/#!/api/consumer/register https://demo.fusio-project.org/system/export/spec-typeschema/*/consumer/register i put this into a schema tab but now what?

how do i transform this schema into an api that allows to register a user? there are tabs like action,connection, event, routes. where do they play into this schema?

i suppose if we had simple demos of things that can start people with specific stuff, like lets say a simple account registration as well as a login one, then a registration+payment, or for a spa, how to set up a demo website.

i may not need all of these things but i am sure new users would appreciate it

chriskapp commented 2 years ago

Hey @test2a, great that the login issue is solved. We have just recently migrated all our docs to the https://docs.fusio-project.org/ domain which should now contain all documentation regarding Fusio. We are also planing to create more videos explaining use cases of Fusio.

Regarding your specific problem, you basically need to install the developer app s. https://demo.fusio-project.org/apps/developer/#!/

which then allows external developers to login and register. Then you can create a plan at the backend which then can be purchased at the developer app by external developers. For this you then also need to setup a payment provider like stripe. Through this a developer receives points which then can be spend on calling protected routes.

Besides the developer app you can of course also use the /consumer/register and /consumer/login endpoints to build your custom app. Regarding the tabs, our documentation basically has a page for every panel s. https://docs.fusio-project.org/docs/backend/api/

which should explain each panel. But this is of course also still a work in progress.