Skip to content

Commit aa5f7f6

Browse files
committed
Update readme.md
1 parent c2914e4 commit aa5f7f6

File tree

1 file changed

+119
-115
lines changed

1 file changed

+119
-115
lines changed

Diff for: readme.md

+119-115
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ A grunt task looks for new files in your `client/app` and `client/components` fo
6161

6262
Available generators:
6363

64-
* All
64+
* App
6565
- [angular-fullstack](#app) (aka [angular-fullstack:app](#app))
66-
- [angular-fullstack:openshift](#openshift)
67-
- [angular-fullstack:heroku](#heroku)
6866
* Server Side
6967
- [angular-fullstack:endpoint](#endpoint)
7068
* Client Side
@@ -76,6 +74,9 @@ Available generators:
7674
- [angular-fullstack:provider](#service)
7775
- [angular-fullstack:factory](#service)
7876
- [angular-fullstack:decorator](#decorator)
77+
* Deployment
78+
- [angular-fullstack:openshift](#openshift)
79+
- [angular-fullstack:heroku](#heroku)
7980

8081
### App
8182
Sets up a new AngularJS + Express app, generating all the boilerplate you need to get started.
@@ -84,83 +85,6 @@ Example:
8485
```bash
8586
yo angular-fullstack
8687
```
87-
###Openshift
88-
89-
Deploying to OpenShift can be done in just a few steps:
90-
91-
yo angular-fullstack:openshift
92-
93-
A live application URL will be available in the output.
94-
95-
> **Enabling web sockets**
96-
>
97-
> If you're using socket.io, you will need to update the client to connect to the correct port for sockets to work.
98-
>
99-
> In `/client/app/components/socket/socket.service` update the socket to connect to port 8000. (with `my-openshift-app` being the deployed name of your app):
100-
>
101-
> var ioSocket = io.connect('my-openshift-app.com:8000');
102-
>
103-
> **oAuth**
104-
>
105-
> If you're using any oAuth strategies, you must set environment variables for your selected oAuth. For example, if we're using Facebook oAuth we would do this :
106-
>
107-
> rhc set-env FACEBOOK_ID=id -a my-openshift-app
108-
> rhc set-env FACEBOOK_SECRET=secret -a my-openshift-app
109-
>
110-
> You will also need to update the callback urls for your oAuth strategies in your `server/config/environment/index.js`
111-
>
112-
> After you've set the required environment variables, restart the server:
113-
>
114-
> rhc app-restart -a my-openshift-app
115-
116-
**Pushing Updates**
117-
118-
grunt
119-
120-
Commit and push the resulting build, located in your dist folder:
121-
122-
cd dist && git add -A && git commit -m "describe your changes here"
123-
git push -f my-openshift-app master
124-
125-
### Heroku
126-
127-
Deploying to heroku only takes a few steps.
128-
129-
yo angular-fullstack:heroku
130-
131-
To work with your new heroku app using the command line, you will need to run any `heroku` commands from the `dist` folder.
132-
133-
If you're using mongoDB you will need to add a database to your app:
134-
135-
heroku addons:add mongohq
136-
137-
Your app should now be live. To view it run `heroku open`
138-
139-
> **Enabling web sockets**
140-
>
141-
> If you're using socket.io you will need to enable websockets on your app:
142-
>
143-
> heroku labs:enable websockets
144-
>
145-
> **oAuth**
146-
>
147-
> If you're using any oAuth strategies, you must set environment variables for your selected oAuth. For example, if we're using Facebook oAuth we would do this :
148-
>
149-
> heroku config:set FACEBOOK_ID=id
150-
> heroku config:set FACEBOOK_SECRET=secret
151-
>
152-
> You will also need to update the callback urls for your oAuth strategies in your `server/config/environment/index.js`
153-
>
154-
155-
#### Pushing Updates
156-
157-
grunt
158-
159-
Commit and push the resulting build, located in your dist folder:
160-
161-
cd dist && git add -A && git commit -m "describe your changes here"
162-
git push -f heroku master
163-
16488

16589
### Endpoint
16690
Generates a new API endpoint.
@@ -287,6 +211,84 @@ yo angular-fullstack:decorator serviceName
287211
Produces
288212

289213
client/app/serviceName/serviceName.decorator.js
214+
215+
###Openshift
216+
217+
Deploying to OpenShift can be done in just a few steps:
218+
219+
yo angular-fullstack:openshift
220+
221+
A live application URL will be available in the output.
222+
223+
> **Enabling web sockets**
224+
>
225+
> If you're using socket.io, you will need to update the client to connect to the correct port for sockets to work.
226+
>
227+
> In `/client/app/components/socket/socket.service` update the socket to connect to port 8000. (with `my-openshift-app` being the deployed name of your app):
228+
>
229+
> var ioSocket = io.connect('my-openshift-app.com:8000');
230+
>
231+
> **oAuth**
232+
>
233+
> If you're using any oAuth strategies, you must set environment variables for your selected oAuth. For example, if we're using Facebook oAuth we would do this :
234+
>
235+
> rhc set-env FACEBOOK_ID=id -a my-openshift-app
236+
> rhc set-env FACEBOOK_SECRET=secret -a my-openshift-app
237+
>
238+
> You will also need to update the callback urls for your oAuth strategies in your `server/config/environment/index.js`
239+
>
240+
> After you've set the required environment variables, restart the server:
241+
>
242+
> rhc app-restart -a my-openshift-app
243+
244+
**Pushing Updates**
245+
246+
grunt
247+
248+
Commit and push the resulting build, located in your dist folder:
249+
250+
cd dist && git add -A && git commit -m "describe your changes here"
251+
git push -f my-openshift-app master
252+
253+
### Heroku
254+
255+
Deploying to heroku only takes a few steps.
256+
257+
yo angular-fullstack:heroku
258+
259+
To work with your new heroku app using the command line, you will need to run any `heroku` commands from the `dist` folder.
260+
261+
If you're using mongoDB you will need to add a database to your app:
262+
263+
heroku addons:add mongohq
264+
265+
Your app should now be live. To view it run `heroku open`
266+
267+
> **Enabling web sockets**
268+
>
269+
> If you're using socket.io you will need to enable websockets on your app:
270+
>
271+
> heroku labs:enable websockets
272+
>
273+
> **oAuth**
274+
>
275+
> If you're using any oAuth strategies, you must set environment variables for your selected oAuth. For example, if we're using Facebook oAuth we would do this :
276+
>
277+
> heroku config:set FACEBOOK_ID=id
278+
> heroku config:set FACEBOOK_SECRET=secret
279+
>
280+
> You will also need to update the callback urls for your oAuth strategies in your `server/config/environment/index.js`
281+
>
282+
283+
#### Pushing Updates
284+
285+
grunt
286+
287+
Commit and push the resulting build, located in your dist folder:
288+
289+
cd dist && git add -A && git commit -m "describe your changes here"
290+
git push -f heroku master
291+
290292

291293
## Bower Components
292294

@@ -319,41 +321,6 @@ Yeoman generated projects can be further tweaked according to your needs by modi
319321

320322
A `.yo-rc` file is generated for helping you copy configuration across projects, and to allow you to keep track of your settings. You can change this as you see fit.
321323

322-
{
323-
"generator-angular-fullstack": {
324-
"insertRoutes": true,
325-
"registerRoutesFile": "server/routes.js",
326-
"routesNeedle": "// Insert routes below",
327-
"insertSockets": true,
328-
"registerSocketsFile": "server/config/socketio.js",
329-
"socketsNeedle": "// Insert sockets below",
330-
"filters": {
331-
"js": true,
332-
"html": true,
333-
"sass": true,
334-
"uirouter": true,
335-
"socketio": true,
336-
"mongoose": true,
337-
"auth": true
338-
}
339-
},
340-
"generator-ng-component": {
341-
"routeDirectory": "client/app/",
342-
"directiveDirectory": "client/app/",
343-
"filterDirectory": "client/app/",
344-
"serviceDirectory": "client/app/",
345-
"basePath": "client",
346-
"filters": [
347-
"uirouter"
348-
],
349-
"extensions": [
350-
"js",
351-
"html",
352-
"scss"
353-
]
354-
}
355-
}
356-
357324
## Testing
358325

359326
Running `grunt test` will run the client and server unit tests with karma and mocha.
@@ -374,6 +341,43 @@ Use `grunt test:e2e` to have protractor go through tests located in the `e2e` fo
374341

375342
Keeping your app secrets and other sensitive information in source control isn't a good idea. To have grunt launch your app with specific environment variables, add them to the git ignored environment config file: `server/config/local.env.js`.
376343

344+
## Project Structure
345+
346+
Overview
347+
348+
├── client
349+
│   ├── app - All of our app specific components go in here
350+
│   ├── assets - Custom assets: fonts, images, etc…
351+
│   ├── components - Our reusable components, non-specific to to our app
352+
353+
├── e2e - Our protractor end to end tests
354+
355+
└── server
356+
├── api - Our apps server api
357+
├── auth - For handling authentication with different auth strategies
358+
├── components - Our reusable or app-wide components
359+
├── config - Where we do the bulk of our apps configuration
360+
│ └── local.env.js - Keep our environment variables out of source control
361+
│   └── environment - Configuration specific to the node environment
362+
└── views - Server rendered views
363+
364+
An example client component in `client/app`
365+
366+
main
367+
├── main.js - Routes
368+
├── main.controller.js - Controller for our main route
369+
├── main.controller.spec.js - Test
370+
├── main.html - View
371+
└── main.less - Styles
372+
373+
An example server component in `server/api`
374+
375+
thing
376+
├── index.js - Routes
377+
├── thing.controller.js - Controller for our `thing` endpoint
378+
├── thing.model.js - Database model
379+
├── thing.socket.js - Register socket events
380+
└── thing.spec.js - Test
377381

378382
## Contribute
379383

0 commit comments

Comments
 (0)