duofolio icon indicating copy to clipboard operation
duofolio copied to clipboard

Setup local dev environment

Open OGoodness opened this issue 3 years ago • 10 comments

I was wondering if there was a readme or some documentation on how to set this application up locally so that others can extend upon it.

I've run into several issues due to missing dependencies

OGoodness avatar Sep 15 '20 22:09 OGoodness

Hey @OGoodness, can you please give an example of what kind of issues you're running into?

farshed avatar Sep 17 '20 13:09 farshed

@farshed At the moment it's just simple issues. I npm install, then try and run react-native. Unsure if it's setup to be run in a emulator, direct connect to hardware, using expo, or if it can run via web interface for testing.

Granted, this is kind of a user issue, but I was hoping that you could add something to the readme on how to set up the system locally. Whether that is a simple "Just npm install and run an emulator" But I feel like a guide would go a long way :D

OGoodness avatar Sep 17 '20 14:09 OGoodness

Also, some info on what private.js should be, because that's another issue I had

OGoodness avatar Sep 17 '20 14:09 OGoodness

Also, some info on what private.js should be, because that's another issue I had

Sorry, just realized that was a dumb question But documentation on what the constants should be would be good

OGoodness avatar Sep 17 '20 15:09 OGoodness

@OGoodness It should be able to run in an android emulator/device after a simple npm install. It's not using expo so you won't be able to run it via expo cli and neither on the web. You'll need to have the React Native setup configured in your system to run it. I'll take a look at it tomorrow morning and make sure that it's runnable after pull and npm install.

private.js contains a single function called translateApiUrl that takes three arguments:

  1. ISO 639-1 language code for the source language (string)
  2. ISO 639-1 language code for the target language (string)
  3. Text to translate (string)

It returns a url that can then be pinged to get a translation back. I'm thinking about making it visible in the repo but I'm not sure since it could lead to abuse if everyone found out.

farshed avatar Sep 17 '20 15:09 farshed

@farshed
Much appreciated! If it's using something like an API Key, then you could just make a Global Env Var and hide that

OGoodness avatar Sep 17 '20 15:09 OGoodness

@farshed, out of curiosity, soes this private.js contains the API url/key to the Google Translate API?

@OGoodness, if you haven't set up the dev environment yet, this tutorial from RN's is quite good, I went through it just a week ago: https://reactnative.dev/docs/environment-setup

rafaelsaback avatar Sep 18 '20 17:09 rafaelsaback

@rafaelsaback yes that's right

farshed avatar Sep 18 '20 18:09 farshed

@rafaelsaback Thanks for the link 😄. I already had the Dev Env setup, but I agree it is pretty good. My main issue was with the constants and the fact that I was running everything on windows and trying to use a hardware device. I switched over to Linux and used a VM and got everything working.

OGoodness avatar Sep 18 '20 18:09 OGoodness

I think if we setup a mock rest api , we would develop easily without worry about prod url or api key then i develop a code and i sent a pr #16 . if you accept pr, you could add constant/private to git, then you hide url on .env.prod file. we can use without compile error.

BTW I wish i develop a reader with built-in dictionary feature (with large amount of language support like google translate) so i am happy because i found this repo. there is a lot of pdf reader but i cant found turish dictionary. i hate switct reader to dictionary, over and over

mahmut-gundogdu avatar Dec 03 '20 21:12 mahmut-gundogdu