Skip to content

Commit 615e798

Browse files
authored
Update README.md
1 parent 2639e74 commit 615e798

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed

Diff for: README.md

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# react-context-lesson
2+
We are going to replace our local state management from redux to the new context API. This repository is our application before we introduced sagas to handle our asynchronous code, which is a good starting point to make the appropriate changes!
3+
4+
# How to fork and clone
5+
6+
One quick note about cloning this project. If you wish to make commits and push the code up after cloning this repo, you should fork the project first. In order to own your own copy of this repository, you have to fork it so you get your own copy on your own profile!
7+
8+
You can see the fork button in the top right corner of every GitHub project; click it and a copy of the project will be added to your GitHub profile under the same name as the original project.
9+
10+
![alt text](https://i.ibb.co/1YN7SJ6/Screen-Shot-2019-07-01-at-2-02-40-AM.png "image to fork button")
11+
12+
After forking the project, simply clone it the way you would from the new forked project in your own GitHub repository and you can commit and push to it freely!
13+
14+
15+
# After you fork and clone:
16+
17+
## Install dependencies
18+
19+
In your terminal after you clone your project down, remember to run either `yarn` or `npm install` to build all the dependencies in the project.
20+
21+
## Set your firebase config
22+
23+
Remember to replace the `config` variable in your `firebase.utils.js` with your own config object from the firebase dashboard! Navigate to the project settings and scroll down to the config code. Copy the object in the code and replace the variable in your cloned code.
24+
25+
![alt text](https://i.ibb.co/6ywMkBf/Screen-Shot-2019-07-01-at-11-35-02-AM.png "image to firebase config")
26+
27+
28+
## Set your stripe publishable key
29+
30+
Set the `publishableKey` variable in the `stripe-button.component.jsx` with your own publishable key from the stripe dashboard.
31+
32+
![alt text](https://i.ibb.co/djQTmVF/Screen-Shot-2019-07-01-at-2-18-50-AM.png "image to publishable key")
33+
34+
## Things to set before you deploy
35+
36+
You will also need to connect your existing Heroku app to this new forked and cloned repo, or you have to create a new Heroku app and push to it. A quick refresher on how to do either of these:
37+
38+
## Set to an existing Heroku app
39+
40+
To set to an existing Heroku app you already have deployed, you need to know the name of the app you want to deploy to. To see a list of all the apps you currently have on Heroku:
41+
42+
```
43+
heroku apps
44+
```
45+
46+
Copy the name of the app you want to connect the project to, then run:
47+
48+
```
49+
heroku git:remote -a <PASTE_YOUR_APP_NAME_HERE>
50+
```
51+
52+
And now you'll have your repo connected to the heroku app under the git remote name `heroku`.
53+
54+
Then skip to the bottom of this article to see what to do next!
55+
56+
57+
## To create a new Heroku app
58+
59+
Create a new Heroku project by typing in your terminal:
60+
61+
```
62+
heroku create
63+
```
64+
65+
This will create a new Heroku project for you. Then run:
66+
67+
```
68+
git remote -v
69+
```
70+
71+
You should see heroku `https://git.heroku.com/<RANDOMLY_GENERATED_NAME_OF_YOUR_APP>` in the list. This means you have successfully connected your project to the newly created Heroku app under the git remote of `heroku`.
72+
73+
74+
## Deploying to Heroku
75+
76+
You can deploy to heroku by running:
77+
78+
```
79+
git push heroku master
80+
```
81+
82+
You will see this warning message if you are pushing to an existing app:
83+
84+
```
85+
! [rejected] master -> master (fetch first)
86+
error: failed to push some refs to 'https://git.heroku.com/hasura-crwn-clothing.git'
87+
hint: Updates were rejected because the remote contains work that you do
88+
hint: not have locally. This is usually caused by another repository pushing
89+
hint: to the same ref. You may want to first integrate the remote changes
90+
hint: (e.g., 'git pull ...') before pushing again.
91+
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
92+
```
93+
94+
This is because we are pushing to an existing app that was deploying an entirely different repository from what we have now. Simply run:
95+
96+
```
97+
git push heroku master --force
98+
```
99+
100+
This will overwrite the existing Heroku app with our new code.
101+
102+
103+
## Open our Heroku project
104+
105+
After heroku finishes building our project, we can simply run:
106+
107+
```
108+
heroku open
109+
```
110+
111+
This will open up our browser and take us to our newly deployed Heroku project!

0 commit comments

Comments
 (0)