red-gold / social-firebase

Firebase server-less backend for React Social
MIT License
9 stars 7 forks source link

Documentation requires upadation #1

Open ipragmatechadmin opened 5 years ago

ipragmatechadmin commented 5 years ago

Hi @Qolzam,

I guess you forgot to checkin the secureKey.json. Can you please do it so that we can run the project?

Kapil

Qolzam commented 5 years ago

Hello Kapil,

Sorry for that. Indeed I forgot to describe this part. You can create your own private and public key for this part of course. I have ignored this file to avoid publishing private and public key for developer who is using public repository.

For new projects developer should create a new file name secureKey.json following path functions/src/config/secureKey.json. This file including two fields. Private key (privateKey) to create token and Public key (publicKey) for token validation.

You can generate by your own (Safe/Recommended) or use following example (Unsafe/Not Recommended).

{
    "privateKey": "-----BEGIN RSA PRIVATE KEY-----\r\nMIICXgIBAAKBgQC1mye1hgKSUqXFfFcqn4lD4KS8da+BvWKTyQl4Z+g4rDNqwKnd\r\nzGDxCJjkmgxjA1UEM3SSx8L9/JazGraXZcXtonN7jewlgxMwtq2aWC2AtUCZkhSC\r\ncYTuHlhqQJzeMMlxUBTWJ+Z18ium/sCetd8QJlURp3gAxnxY4Llj+7yvXwIDAQAB\r\nAoGBAI6bOtBhXk2WltQAMtamlnx1wAa5h0si83DHcidZuNIf7vRKPFmOLyW3MZB5\r\no3Zw3GbDHSxRrz4RBim4tV8nrQb5sMzG3tjCocyCUV/IHOMCBTng2G2BFxbPbzh3\r\nNALknGZ85w2aj5itvsVA/GFnuoLRE54oanWBDMPjr+0ACUpxAkEA/qOvZ6SWDewm\r\n3LsCTunjCNmzD0K1QKlLgiqJTLcgjj5a8DJCRKeMZnRlTlbEvovmlTREA6S+WJgH\r\npqAa6ZMLmQJBALaTkcp7on4Ro0C3H7Y6MZbPysm+Ym/G24AO+lrpMATuc5WRDc2p\r\nHtrvyUYcgbvZzE2T9KJsoc6KAGPSBKCxrbcCQQCe0CPTtjjIEiLiw9fas9CfcndU\r\n6zv0SiIH2tOq/wPU81rwN8hQ3VaZh7qvMzqdxM9Y+zH4O8Vjp94NtAlU6BrxAkEA\r\nrnvJUOFnIWRpyGc5/0UOLzrWaodwO7KoA3JNAKTqJ0xbWg0OTAXcXw/aIw8LTSOQ\r\nhHNpz/BRkrmANeV4Vrp3cQJAHAjMhn/Vn6fLyPzScNZjKWRz+2C6mHNVolnUm/g3\r\n3MUvDeG67d27GO3t532KsUO+kxeJfzGu/QQF1MHsAQj6Sg==\r\n-----END RSA PRIVATE KEY-----\r\n",
    "publicKey": "-----BEGIN PUBLIC KEY-----\r\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC1mye1hgKSUqXFfFcqn4lD4KS8\r\nda+BvWKTyQl4Z+g4rDNqwKndzGDxCJjkmgxjA1UEM3SSx8L9/JazGraXZcXtonN7\r\njewlgxMwtq2aWC2AtUCZkhSCcYTuHlhqQJzeMMlxUBTWJ+Z18ium/sCetd8QJlUR\r\np3gAxnxY4Llj+7yvXwIDAQAB\r\n-----END PUBLIC KEY-----\r\n"
}

Also there is another file name serviceAccountKey.json following path functions/src/config/serviceAccountKey.json which will be generated by firebase admin

I will let this issue open to describe in document. If any other issue please let me know.

I appreciate your support as always. Amir

ipragmatechadmin commented 5 years ago

@Qolzam Thanks a lot. We are able to deploy the functions now. We are now going to test the react app now :)

ipragmatechadmin commented 5 years ago

@Qolzam We are able to run the app but looks like the documentation need improvements. We are planning to write a blog to set up this platform so if you agree then we can do this. Also, there are some hardcoding in the code (e.g. ReCaptcha Key in the components) and looks like API path isn't working e.g. when we deploy the functions, we have different URL for publicAuth, users, search, Screenshot 2019-05-15 at 3 47 59 PM etc. so I think we would need to change the logic to fix this. We would be happy to fix these issues so can you suggest how should we go ahead with it? Should we create a fork for this and pull a request? or you want us to be a contributor for this project?

Screenshot 2019-05-15 at 3 41 51 PM

Qolzam commented 5 years ago

Hi Kapil,

We are able to run the app

That's great!

but looks like the documentation need improvements.

Because this repository is under development, we have changes frequently. After we have a stable repository we can complete the document according to new changes.

We are planning to write a blog to set up this platform so if you agree then we can do this.

I would appreciate that if you could get more audience. 👍

Also, there are some hardcoding in the code (e.g. ReCaptcha Key in the components) .

Sure there are more even ;). Seems we need a todo list and milestone because I couldn't manage time to create issue for some parts .

looks like API path isn't working e.g. when we deploy the functions, we have different URL for publicAuth, users, search, etc. so I think we would need to change the logic to fix this.

Not sure if I understand you well but the API url is based on Firebase Hosting firebase.json. I defined all URL routing in this file. When you deploy it on Firebase Hosting you are able to refer to your host URL. For development environment (on local) you have to add your firebase hosting address which I have added a key named api in src/config/environment.dev.ts config file. However if you are in production and you deployed on Firebase hosting you don't have to add your Firebase Host address.

We would be happy to fix these issues so can you suggest how should we go ahead with it? Should we create a fork for this and pull a request? or you want us to be a contributor for this project?

I appreciate your suggestion. If you are willing a long term contribution which I do appreciate, and we are on same target to build a production open source social network, you should be a contributor so. By that I can focus on providing stand alone platform for this project. My vision is an open social network can support huge number of active users and production ready with new technologies. Including K8S, AI, Blockchain. I have experience with these all but I need help to make it happen fast. What is your idea?

ipragmatechadmin commented 5 years ago

@Qolzam I am ready to be long term contributor and my vision is that this community is used by real users (Yes, I would be happy to use new technologies and use AI/ML, etc). So I feel we should also try to get the real users so that they can use it and keep this community active. The community can be for developers or musician or players or any specific community of the close group. A good example can be 'Spectrum' which is community exclusive for developers.

I agree with you that we should create milestones to launch the beta version for real users (You can decide which community can be on this platform). I feel if there are uses on the community then we shall get feedback and we shall be building solutions based on their requirements.

What do you think about this?

ipragmatechadmin commented 5 years ago

@Qolzam Thanks for inviting me to the Front-end project. Can you invite me on this project as well?

ipragmatechadmin commented 5 years ago

@Qolzam Looks like you also forgot to add hosting rewrite rules for functions. I had to use publicAuth/api/* for login/signup

Qolzam commented 5 years ago

@ipragmatechadmin as I said already you only need to deploy the react-social-frontend to your host then routing will be applied on your Firebase app. You do not need add publicAuth as part of your route. It is function name.

https://github.com/red-gold/react-social-network/blob/b5e69f6d26a6f99af1a0d5e28928e23ed7d5988c/firebase.json#L48-L49

ipragmatechadmin commented 5 years ago

@Qolzam Thanks a lot. Well, I was using localhost for the react-social-frontend so that was causing the issue. Let me try to host the front-end and let you know how it works :-)

nk-gears commented 4 years ago

@Qolzam, Do you still recommend this repo or should i look for telar social?