Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for Setting up the Project #120

Closed
sumitra19jha opened this issue Mar 11, 2021 · 13 comments
Closed

Documentation for Setting up the Project #120

sumitra19jha opened this issue Mar 11, 2021 · 13 comments

Comments

@sumitra19jha
Copy link
Contributor

The documentation will explain how to integrate backend, to make sure app runs.

@yasharth291
Copy link
Contributor

its already done #18 see this please close it as it is duplicate

@sumitra19jha
Copy link
Contributor Author

Actually, it's more sort of configuring backend and app together. Rather than app only.

@sumitra19jha
Copy link
Contributor Author

sumitra19jha commented Mar 11, 2021

Documentation for Setting up the Project

  • Backend Setup
  • Frontend Setup
  • Url Entry

Backend Setup

Go to Talawa-Api Backend and follow the procedure to configure it on your system.
If you are running MongoDB locally on your system then only MONGO_DB env variable is necessary. You can also use the hosted instamce of mongodb using atlas by
following the given steps.

  • Visit Monngodb Website and signup or create your account
  • Configure a cluster and click connect to connect your application
  • Configuration string will appear something like this:
mongodb+srv://<username>:<password>@cluster0.fyihs.mongodb.net/<dbName>?retryWrites=true&w=majority
  • In Talawa-Api Backend, go to db.js file and replace the const mongoUrl with the configuration string
const mongoURL = `mongodb+srv://<username>:<password>@cluster0.fyihs.mongodb.net/<dbName>?retryWrites=true&w=majority`
  • Do not forget to create .env file to set ACCESS_TOKEN_SECRET and REFRESH_TOKEN_SECRET. The .env file will appear like:
ACCESS_TOKEN_SECRET = mysupersecureaccesstoken
REFRESH_TOKEN_SECRET = mysupersecurerefreshtoken

On the successfull execution, your local server will start running on port 4000. Following output will be shown in terminal:

[nodemon] 2.0.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,graphql,json
[nodemon] starting `node index.js`
🚀 Server ready at http://localhost:4000/graphql
🚀 Subscriptions ready at ws://localhost:4000/graphql

You can now open the graphql playground to check the schema design and start playing with graph api's.

App Setup

Go to Talawa and follow the procedure to configure project on your system.
Once the project is configured go to login_page.dart
and perform the following change:

orgUrl = "${dropdownValue.toLowerCase()}://${urlController.text}/";

Now Run the app.

App Url Entry

As the app opens, enter the url:

  • Remeber you only need to enter local host and Port Number.
    The Graphql Client
    is itself configured with graphql string at the end to form the uri.
  • If you are running app on emulator use 10.0.2.2 inplace of localhost. This is done because the local host of the emulator is within the device itself.
    To know more refer this.
10.0.2.2:4000
  • If you are running app on real smartphone then use Network IP instead of localhost
<IP>:4000

@yasharth291
Copy link
Contributor

see the #17 and #18

@yasharth291
Copy link
Contributor

its both done

@yasharth291
Copy link
Contributor

and if you are telling about the backend then this is not the right repo for this may be you can raise this issue in the api repo of talwa

@sumitra19jha
Copy link
Contributor Author

sumitra19jha commented Mar 11, 2021

No i am saying that inorder for the app to communicate to the backend, the configuration doc is missing and most of our fellow contributors is actually facing this issue. Through this documentation, I just want to make sure their hurdle is removed so that they can contribute as much as possible.

@yasharth291
Copy link
Contributor

yeah it is better to raise this issue in second repo of the talwa. As it is main concern of the backend. Things related to the frontend should be here. I guess.

@yasharth291
Copy link
Contributor

https://github.com/PalisadoesFoundation/talawa-api

you can raise the same issue here it will be more important there

@sumitra19jha
Copy link
Contributor Author

sumitra19jha commented Mar 11, 2021

Ok, i will raise one issue there too. But let the admin decide, last part of the documentation contains frontend part.

@yasharth291
Copy link
Contributor

Letting it here is your choice. I was just giving advice.

@adithyaakrishna
Copy link
Contributor

@sumitra19jha This is a great one, but can you create a discussion regarding the same if its okay with you?

@sumitra19jha
Copy link
Contributor Author

Hi @adithyaakrishna
The documentation has been added to talawa-api.So, we will not be using it here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants