-
Notifications
You must be signed in to change notification settings - Fork 1
Standard workflow
If you've followed the Installation guide you should have all the requirements set up to start working. Now we're going to take a look at how you actually do some work and use everything you've just installed.
First, open your text editor and go to File -> Open Folder and then select the folder that you cloned from Github. Do not open any files nor subfolders individually. Open the whole project by selecting the folder app
. This step might seem a little unnecessary, but it's important to make sure that you have all the correct files opened going forward. I also wanted to emphasize to open the whole app folder and not the individual files. Sometimes when you open a project for the first time the sidebar with the project hierarchy doesn't show up. To enable it you go to View > Side Bar
and then click Show Side Bar
.
To start off, you should visit Our systems for a general description of the Github workflow if you're not familiar with it already. Otherwise, you need to diverge from the master branch and create your own separate branch before you can start working. What this means is that you separate your changes from the live version. First, navigate to the app
folder with the custom CMD/Terminal command
apploc
from the Installation guide. If you don't have the apploc
command you can always use cd
. Now, run the status
command with
git status
This is a really good command to know and shows you some information about the current Github status. The most important being what branch you're on and which files you've edited. Next, you want to create a new branch by executing the branch
command as
git branch [new branch name]
You can then list all the available branches with
git branch
and make sure your new branch is there. branch
is also a nice command to use if you ever forget the name of your branch. After you've successfully created a branch you want to switch to it (or check it out) with the checkout
command. Switch to the new branch with
git checkout [new branch name]
Lastly, you can run
git status
to make sure your current branch has switched to the new one.
After you've created a new branch a couple of times and are comfortable in doing so, you can use
git checkout -b [new branch name]
to create a new branch and also switch to it. The flag -b
makes it so that the branch we switch to also gets created. However, I think it's best to first know the different commands combined in this before using it.
When you've opened the project files and switch to a new branch you are free to change and do whatever you'd like. All the changes you make are local and doesn't affect anyone else. Now, it would be quite nice to be able to see the effect of the changes you make. You do this by hosting a local web server with PhoneGap that runs the app for you in real time. To start the web server you have to be in the projects www
folder. You can navigate there with cd
or by running the custom CMD/Terminal command
apploc
from the Installation guide. Then, you start the actual web server with PhoneGap command serve
by executing
phonegap serve
The first time you start the web server it will ask you if you want to send information to PhoneGap, which we don't. It will also ask for access through your firewall which you should allow. If you've downloaded the PhoneGap Developer App its the IP address on the second row in listening on ip:port
that you want to connect to. This is your computers IP and the port where it's hosting the server. Make sure your computer and phone are connected to the same WiFi network or it won't work. To finally view the F-app you just open a web browser and connect to localhost:3000
and you should see it.
- recommend to familiarize yourself with the project structure, link to our systems
- debugging in the browser, changing devices and os (css files)
When you're finished with your changes and they look good on all devices it's time to update the master branch. Follow step 3-13 in Git Workflow to do this.