Skip to content

Commit d874cd1

Browse files
committed
Setup; add Github OAuth
1 parent 952db05 commit d874cd1

File tree

9 files changed

+39
-4900
lines changed

9 files changed

+39
-4900
lines changed

.meteor/packages

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ vulcan:i18n-en-us
88

99
############ Accounts Packages ############
1010

11-
12-
# accounts-twitter
13-
# accounts-facebook
11+
accounts-github
1412

1513
############ Your Packages ############
1614

README.md

+5-171
Original file line numberDiff line numberDiff line change
@@ -1,178 +1,12 @@
1-
2-
# Vulcan Starter
3-
4-
This kit gives you all you need to quickly learn Vulcan and launch your own projects.
5-
6-
Other resources:
7-
8-
- [Vulcan Docs](http://docs.vulcanjs.org)
9-
- [Vulcan Slack](http://slack.vulcanjs.org)
10-
11-
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
12-
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
13-
**Table of Contents**
14-
15-
- [Quick Install](#quick-install)
16-
- [Step 1 - Clone](#step-1---clone)
17-
- [Step 2 – Run](#step-2--run)
18-
- [Getting Started Tutorial](#getting-started-tutorial)
19-
- [Other Examples](#other-examples)
20-
- [Complete Install](#complete-install)
21-
- [Critical prerequisite](#critical-prerequisite)
22-
- [Step 1 - Preparation](#step-1---preparation)
23-
- [Step 2 - Test Vulcan installation](#step-2---test-vulcan-installation)
24-
- [Step 3 - Prepare your project](#step-3---prepare-your-project)
25-
- [Step 4 - Test your project installation](#step-4---test-your-project-installation)
26-
27-
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
28-
29-
## Quick Install
30-
31-
If you already have Meteor up and running, read this section. Otherwise, read the [Complete Install](#complete-install) section.
32-
33-
#### Step 1 - Clone
34-
35-
```
36-
git clone [email protected]:VulcanJS/Vulcan-Starter.git
37-
cd Vulcan-Starter
38-
```
39-
40-
(or, using `https`: `git clone https://github.com/VulcanJS/Vulcan-Starter.git`)
41-
42-
#### Step 2 – Run
1+
[Vulcan docs](http://docs.vulcanjs.org)
432

443
```
4+
git clone [email protected]:GraphQLGuide/news.git
5+
cd news
456
npm install
467
npm start
478
```
489

49-
## Getting Started Tutorial
50-
51-
When you first run this repo, you'll see the first step of Vulcan's interactive Getting Started tutorial.
52-
53-
![https://d3vv6lp55qjaqc.cloudfront.net/items/0I2W3G1i2K3z0p052c02/Screen%20Shot%202018-02-03%20at%2011.16.53.png?X-CloudApp-Visitor-Id=43642&v=807ac6f9](https://d3vv6lp55qjaqc.cloudfront.net/items/0I2W3G1i2K3z0p052c02/Screen%20Shot%202018-02-03%20at%2011.16.53.png?X-CloudApp-Visitor-Id=43642&v=807ac6f9)
54-
55-
This interactive tutorial will guide you through Vulcan basics, such as:
56-
57-
- Creating routes.
58-
- Registering components.
59-
- Defining a schema.
60-
- Loading data.
61-
- Generating forms.
62-
63-
All while modifying the code of the tutorial itself! How meta!
64-
65-
## Other Examples
66-
67-
Additionally, this repo also contains the following example apps:
68-
69-
- **Simple Example**: build a simple paginated list of movies [[video]](http://docs.vulcanjs.org/example-simple.html).
70-
- **Movies Example**: like the Simple example, but more in-depth [[video+tutorial]](http://docs.vulcanjs.org/example-movies.html).
71-
- **Permissions Example**: manage user roles in Vulcan [[video]](http://docs.vulcanjs.org/example-permissions.html).
72-
- **Instagram Example**: create a simple Instagram clone [[video]](http://docs.vulcanjs.org/example-instagram.html).
73-
- **Interfaces Example**: using GraphQL interfaces.
74-
- **Reactions Example**: implement Facebook-style reactions & voting.
75-
- **Forum Example**: a full-fledged Hacker News-style forum codebase [[docs]](http://docs.vulcanjs.org/example-forum.html).
76-
- **Customization Example**: how to customize other Vulcan packages, based on the Forum Example [[video+tutorial]](http://docs.vulcanjs.org/example-customization.html).
77-
78-
## Complete Install
79-
80-
The *Complete Install* steps will get you going on a freshly built Ubuntu desktop machine (including installing Node, Meteor, etc.) using the "[two-repo](http://docs.vulcanjs.org/#Two-Repo-Install)" install.
81-
82-
The steps below assume a machine that has not previously been used for software development.
83-
84-
They were tested Oct 15/2017, on an 8Gb Qemu/KVM virtual machine running a freshly installed Xubuntu Desktop 16.04 LTS.
85-
Expect other environments to behave differently but, sufficiently similar that, adaptation should not be difficult.
86-
87-
#### Critical prerequisite
88-
89-
Note that, to use the scripts below, you **must already have** SSH access to GitHub. You'll need that in any case for properly managing version control of your project. Learn more at [GiHub Bootcamp : Connecting to GitHub with SSH](https://help.github.com/articles/connecting-to-github-with-ssh/)
90-
91-
#### Step 1 - Preparation
92-
93-
# Specify where things should go
94-
export NEW_PROJECT_NAME="myVulcan"; # a name for your new project
95-
export PROJECTS_DIRECTORY="${HOME}/projects"; # the installation path for your new project
96-
export VULCAN_HOME="${PROJECTS_DIRECTORY}/Vulcan"; # the path to the root of your Vulcan installation
97-
98-
# Prepare dependencies
99-
sudo apt install -y git curl build-essential;
100-
# Need git for managing your project's source code.
101-
# Need curl to get the other stuff.
102-
# Need C++ build tools for fast bcrypt installation
103-
104-
# Install 'meteor'
105-
curl https://install.meteor.com/ | sh;
106-
107-
# Sanity check your Meteor installation
108-
echo -e "\nMeteor version...";
109-
meteor --version;
110-
export METEOR_NODE_VERSION=$(meteor node --version);
111-
echo -e "Meteor Node version...\n ${METEOR_NODE_VERSION}";
112-
113-
114-
# Install 'nvm', so as to be able to easily switch NodeJs versions
115-
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash;
116-
117-
# Prepare to use 'nvm' immediately
118-
export NVM_DIR="$HOME/.nvm"
119-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
120-
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
121-
122-
123-
# Set Meteor version of Node as your default for NodeJS work outside of Meteor
124-
nvm install ${METEOR_NODE_VERSION};
125-
nvm alias default ${METEOR_NODE_VERSION};
126-
127-
# Create a projects folder and step into it
128-
mkdir -p ${PROJECTS_DIRECTORY}
129-
cd ${PROJECTS_DIRECTORY}
130-
131-
# Clone Vulcan core into its own folder and step into it
132-
git clone [email protected]:VulcanJS/Vulcan.git
133-
134-
# install and pre-cache all of Vulcan's NodeJS dependencies
135-
cd ${VULCAN_HOME};
136-
meteor npm install;
137-
138-
#### Step 2 - Test Vulcan installation
139-
140-
Check it works with a browser at http://localhost:3033
141-
then kill it with &lt;ctrl-c>
142-
143-
# Run Vulcan so it pre-caches all its Meteor dependencies
144-
[ -f settings.json ] || cp sample_settings.json settings.json;
145-
meteor --port 3033 --settings settings.json;
146-
147-
148-
#### Step 3 - Prepare your project
149-
150-
cd ${PROJECTS_DIRECTORY};
151-
152-
# Clone Vulcan starter kit as your named project
153-
git clone [email protected]:VulcanJS/Vulcan-Starter.git ${NEW_PROJECT_NAME}
154-
155-
# Step in your project folder
156-
cd ${NEW_PROJECT_NAME};
157-
158-
# Make sure your app uses the same Meteor release as Vulcan
159-
cp ${VULCAN_HOME}/.meteor/release ./.meteor;
160-
161-
# install and pre-cache all of your named app's NodeJS dependencies
162-
# meteor npm install --save cross-fetch;
163-
meteor npm install;
164-
165-
# Tell Meteor to refer to the Vulcan sister folder for packages that Vulcan supplies
166-
export METEOR_PACKAGE_DIRS=../Vulcan/packages;
167-
echo "Vulcan's Meteor packages folder : ${METEOR_PACKAGE_DIRS}.";
168-
169-
#### Step 4 - Test your project installation
170-
171-
Check it works with a browser at http://localhost:3000
172-
then kill it with &lt;ctrl-c>
173-
174-
# Run your Vulcan project
175-
[ -f settings.json ] || cp sample_settings.json settings.json;
176-
meteor --port 3000 --settings settings.json
177-
10+
App: [127.0.0.1:3000](http://127.0.0.1:3000/) (Github OAuth doesn't work on localhost:3000)
17811

12+
GraphiQL: [127.0.0.1:3000/graphiql](http://127.0.0.1:3000/graphiql)

license.md info/license.md

File renamed without changes.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"scripts": {
88
"prestart": "node .vulcan/prestart_vulcan.js",
9-
"start": "meteor --settings settings.json",
9+
"start": "ROOT_URL=http://127.0.0.1:3000 meteor --settings settings.json",
1010
"lint": "eslint --cache --ext .js packages"
1111
},
1212
"dependencies": {

packages/news/lib/modules/config.js

+6
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ Users.avatar.setOptions({
55
defaultImageUrl:
66
'http://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&f=y'
77
})
8+
9+
Accounts.ui.config({
10+
requestPermissions: {
11+
github: ['read:user', 'user:email']
12+
}
13+
})

packages/news/lib/server/config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ServiceConfiguration.configurations.upsert(
2+
{ service: 'github' },
3+
{
4+
$set: {
5+
clientId: Meteor.settings.oAuth.github.clientId,
6+
secret: Meteor.settings.oAuth.github.secret
7+
}
8+
}
9+
)

packages/news/lib/server/main.js

+2
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ import './posts/index.js'
1919

2020
import './api.js'
2121
import './rss.js'
22+
23+
import './config.js'

sample_settings.json

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"public": {
3-
4-
"title": "Your site title",
5-
"tagline":"Your site tagline",
3+
"title": "GraphQL News",
4+
"tagline": "HN for GraphQL",
65

76
"logoUrl": "http://placekitten.com/250/80",
87
"logoHeight": "80",
@@ -15,21 +14,25 @@
1514
"twitterAccount": "foo",
1615
"facebookPage": "http://facebook.com/foo",
1716

18-
"googleAnalyticsId":"123foo"
19-
17+
"googleAnalyticsId": "123foo"
2018
},
2119

2220
"defaultEmail": "[email protected]",
23-
"mailUrl": "smtp://username%40yourdomain.mailgun.org:[email protected]:587/",
21+
"mailUrl":
22+
"smtp://username%40yourdomain.mailgun.org:[email protected]:587/",
2423

2524
"oAuth": {
26-
"twitter": {
27-
"consumerKey": "foo",
28-
"secret": "bar"
29-
},
30-
"facebook": {
31-
"appId": "foo",
25+
"github": {
26+
"clientId": "foo",
3227
"secret": "bar"
3328
}
29+
},
30+
31+
"newsletter": {
32+
"frequency": [1, 2, 3, 4, 5, 6, 7],
33+
"time": "14:20",
34+
"enabledInDev": false,
35+
"enable": true,
36+
"provider": "mailchimp"
3437
}
3538
}

0 commit comments

Comments
 (0)