├── .bowerrc
├── .buildignore
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .travis.yml
├── .yo-rc.json
├── README.md
├── bower.json
├── build
├── config.js
├── errors.js
└── injector
│ ├── body.html
│ └── head.html
├── client
├── .htaccess
├── .jshintrc
├── app
│ ├── app.js
│ ├── factories
│ │ └── logger
│ │ │ └── logger.factory.js
│ ├── movies
│ │ ├── movies-theatres
│ │ │ ├── movies-theatres.controller.js
│ │ │ ├── movies-theatres.controller.spec.js
│ │ │ └── movies-theatres.html
│ │ ├── movies.controller.js
│ │ ├── movies.controller.spec.js
│ │ ├── movies.html
│ │ └── movies.js
│ └── theatres
│ │ ├── theatres-movies
│ │ ├── theatres-movies.controller.js
│ │ ├── theatres-movies.controller.spec.js
│ │ └── theatres-movies.html
│ │ ├── theatres.controller.js
│ │ ├── theatres.controller.spec.js
│ │ ├── theatres.html
│ │ └── theatres.js
├── assets
│ └── images
│ │ └── yeoman.png
├── favicon.ico
├── index.html
├── robots.txt
├── styles
│ ├── app.scss
│ └── reset.scss
└── vendor
│ └── socket.io.js
├── e2e
└── main
│ ├── main.po.js
│ └── main.spec.js
├── gulpfile.js
├── karma.conf.js
├── package.json
├── protractor.conf.js
├── requirements
├── diagrams
│ ├── v1.png
│ └── v2.png
├── list-of-resources.txt
├── mockups
│ ├── 1-movies.png
│ ├── 2-theatres.png
│ ├── 3-showtimes.png
│ ├── annotated-1-movies.png
│ ├── annotated-2-theatres.png
│ └── annotated-3-showtimes.png
└── queries
│ ├── 1-setup.sql
│ └── 2-queries.sql
├── servers.runner.js
└── servers
└── server
├── .jshintrc
├── .jshintrc-spec
├── api
├── movie
│ └── index.js
└── theatre
│ └── index.js
├── app.js
├── components
└── errors
│ └── index.js
├── config
├── environment
│ ├── development.js
│ ├── index.js
│ ├── production.js
│ └── test.js
├── express.js
├── local.env.js
└── local.env.sample.js
├── data
├── db.js
├── mocks.js
└── sql2sql-stb.sqlite
├── routes.js
└── views
└── 404.html
/.bowerrc:
--------------------------------------------------------------------------------
1 | {
2 | "directory": "client/bower_components"
3 | }
4 |
--------------------------------------------------------------------------------
/.buildignore:
--------------------------------------------------------------------------------
1 | *.coffee
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # editorconfig.org
4 |
5 | root = true
6 |
7 |
8 | [*]
9 |
10 | # Change these settings to your own preference
11 | indent_style = space
12 | indent_size = 2
13 |
14 | # We recommend you to keep these unchanged
15 | end_of_line = lf
16 | charset = utf-8
17 | trim_trailing_whitespace = true
18 | insert_final_newline = true
19 |
20 | [*.md]
21 | trim_trailing_whitespace = false
22 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | public
3 | .tmp
4 | .sass-cache
5 | .idea
6 | client/bower_components
7 | dist
8 | /server/config/local.env.js
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - '0.10'
4 | - '0.11'
5 | before_script:
6 | - npm install -g bower grunt-cli
7 | - gem install sass
8 | - bower install
9 | services: mongodb
--------------------------------------------------------------------------------
/.yo-rc.json:
--------------------------------------------------------------------------------
1 | {
2 | "generator-soa": {
3 | "insertRoutes": true,
4 | "registerRoutesFile": "servers/server/routes.js",
5 | "routesNeedle": "// Insert routes below",
6 | "routesBase": "/api/",
7 | "pluralizeRoutes": true,
8 | "insertSockets": true,
9 | "registerSocketsFile": "servers/server/config/socketio.js",
10 | "socketsNeedle": "// Insert sockets below",
11 | "filters": {
12 | "js": true,
13 | "html": true,
14 | "sass": true,
15 | "uirouter": true,
16 | "bootstrap": true,
17 | "uibootstrap": false
18 | }
19 | },
20 | "generator-ng-component": {
21 | "routeDirectory": "client/app/",
22 | "directiveDirectory": "client/app/",
23 | "filterDirectory": "client/app/",
24 | "serviceDirectory": "client/app/",
25 | "basePath": "client",
26 | "moduleName": "",
27 | "filters": [
28 | "uirouter"
29 | ],
30 | "extensions": [
31 | "js",
32 | "html",
33 | "scss"
34 | ],
35 | "directiveSimpleTemplates": "",
36 | "directiveComplexTemplates": "",
37 | "filterTemplates": "",
38 | "serviceTemplates": "",
39 | "factoryTemplates": "",
40 | "controllerTemplates": "",
41 | "decoratorTemplates": "",
42 | "providerTemplates": "",
43 | "routeTemplates": ""
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Sequel to SQL - Watch Us Build
2 |
3 | *We changed the name of this series to "Watch Us Build," so you may see an occasional reference to its former name ("Soup to Bits") in this repository.*
4 |
5 | ## Pre-reqs
6 | 1. node and npm (https://nodejs.org)
7 | 2. gulp and bower (`npm install bower gulp -g`)
8 | 3. compass: `gem install compass`
9 |
10 | ## Installation
11 | 1. Clone repo: `git clone https://github.com/codeschool/WatchUsBuild-MovieListingsAppWithSQL.git`
12 | 2. Install dependencies: `npm install && bower install`
13 |
14 | ## Run locally
15 | 1. `gulp serve`
16 |
17 | _This will get your local server running on port 3000 (http://localhost:3000)_
18 |
19 |
20 | ### About this project
21 | This project was initially scaffolded with the [generator-soa](https://www.npmjs.com/package/generator-soa). Feel free to visit their page in case you run into any problems, chances are somebody else has ran into similar problems :)
22 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "movies",
3 | "version": "0.0.1",
4 | "dependencies": {
5 | "angular": ">=1.2.*",
6 | "json3": "~3.3.1",
7 | "es5-shim": "~3.0.1",
8 | "jquery": "~1.11.0",
9 | "angular-sanitize": ">=1.2.*",
10 | "lodash": "~2.4.1",
11 | "angular-ui-router": "~0.2.10",
12 | "restangular": "~1.4.0"
13 | },
14 | "devDependencies": {
15 | "angular-mocks": ">=1.2.*",
16 | "angular-scenario": ">=1.2.*"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/build/config.js:
--------------------------------------------------------------------------------
1 | var config = {
2 | app_file_name: 'app.js',
3 | modules_file_name: 'bundle.js',
4 | vendor_file_name: 'vendor.js',
5 | bower_file_name: 'bower_components.min.js',
6 | css_file_name: 'app.css',
7 | jade_file_name: 'cached_jade_templates.js',
8 | html_file_name: 'cached_html_templates.js',
9 | templates_file_name: 'cached_templates.js',
10 | module_name: 'moviesApp',
11 | client: {
12 | path: './client/',
13 |
14 |
15 | specs: ['./client/app/app.js', './client/{app,components}/**/*.js', './client/{app,components}/**/*.spec.js', './client/{app,components}/**/*.html'],
16 | scripts: {
17 | root: './client/app/app.js',
18 | modules: ['./client/{app,components}/**/*.js','!./client/{app,components}/**/*.spec.js', '!./client/app/app.js'],
19 | all: ['./client/{app,components}/**/*.js', '!./client/{app,components}/**/*.spec.js'],
20 |
21 |
22 | },
23 | styles: {
24 | stylus: './client/styles/app.styl',
25 | less: './client/styles/app.less',
26 | sass: './client/styles/app.scss',
27 | css: ['./client/styles/**/*.css'],
28 | },
29 | index: './client/index.html',
30 | templates:{
31 | jade: './client/{app,components}/**/*.jade',
32 | html: ['./client/{app,components}/**/*.html']
33 | },
34 | bower: './client/bower_components/',
35 | vendor: ['./client/vendor/**/*.js'],
36 | images: ['./client/assets/images/**/*']
37 | },
38 | build: {
39 | path: './.tmp/',
40 | stylePath: './.tmp/styles/',
41 | styles: './.tmp/styles/*.css',
42 | scriptPath: './.tmp/scripts/',
43 | scripts: ['./tmp/app/app.js', './.tmp/{app,components}/**/*.js'],
44 | templatePath: './.tmp/templates/',
45 | templates: './.tmp/templates/*.js',
46 | dist: './dist/public',
47 | images: './.tmp/images/**/*',
48 | fonts: './.tmp/fonts'
49 | },
50 | dist: {
51 | path: './dist/',
52 | images: './dist/assets/images/',
53 | scriptPath: './dist/scripts/',
54 | scripts: './dist/scritps/*.js',
55 | stylePath: './dist/styles/',
56 | styles: './dist/styles/*.css',
57 | bower: './dist/bower_components/',
58 | templatePath: './dist/templates/',
59 | templates: './dist/templates/*.js',
60 | index: './dist/index.html'
61 | },
62 | server: {
63 | path: './servers/',
64 | base: './servers/server/app.js',
65 | all: ['./servers/**/app.js', '!./servers/server/app.js']
66 | }
67 | }
68 | module.exports = config;
--------------------------------------------------------------------------------
/build/errors.js:
--------------------------------------------------------------------------------
1 | // # Error handling setup
2 | // # See: http://www.artandlogic.com/blog/2014/05/error-handling-in-gulp/
3 |
4 | var fatalLevel = require('yargs').argv.fatal;
5 |
6 | var ERROR_LEVELS = ['error', 'warning'];
7 |
8 | module.exports = {
9 |
10 | // # Convenience handlers to be used in gulp .on('error', callback)
11 | onError: function(error){ return handleError.call(this, 'error', error); },
12 | onWarning: function(error){ return handleError.call(this, 'warning', error); }
13 | };
14 |
15 | // # Log error and kill process
16 | var ndleError = function(level, error){
17 |
18 | console.log( error.message );
19 | console.log( "Level: " + level + " isFatal" + isFatal(level) );
20 | if ( isFatal(level) ){
21 | process.exit(1);
22 | }
23 | };
24 |
25 | // # Determine if the error is fatal. Returns true if the given level is
26 | // # equal to or more severe than the given fatality level (via cli arg).
27 | // # Defaults to fatality level to error if not set by user or some task default
28 | var isFatal = function(level) {
29 | return ERROR_LEVELS.indexOf(level) <= ERROR_LEVELS.indexOf(fatalLevel || 'error');
30 | };
--------------------------------------------------------------------------------
/build/injector/body.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/build/injector/head.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/client/.htaccess:
--------------------------------------------------------------------------------
1 | # Apache Configuration File
2 |
3 | # (!) Using `.htaccess` files slows down Apache, therefore, if you have access
4 | # to the main server config file (usually called `httpd.conf`), you should add
5 | # this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html.
6 |
7 | # ##############################################################################
8 | # # CROSS-ORIGIN RESOURCE SHARING (CORS) #
9 | # ##############################################################################
10 |
11 | # ------------------------------------------------------------------------------
12 | # | Cross-domain AJAX requests |
13 | # ------------------------------------------------------------------------------
14 |
15 | # Enable cross-origin AJAX requests.
16 | # http://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
17 | # http://enable-cors.org/
18 |
19 | #
20 | # Header set Access-Control-Allow-Origin "*"
21 | #
22 |
23 | # ------------------------------------------------------------------------------
24 | # | CORS-enabled images |
25 | # ------------------------------------------------------------------------------
26 |
27 | # Send the CORS header for images when browsers request it.
28 | # https://developer.mozilla.org/en/CORS_Enabled_Image
29 | # http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
30 | # http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
31 |
32 |
33 |
34 |
35 | SetEnvIf Origin ":" IS_CORS
36 | Header set Access-Control-Allow-Origin "*" env=IS_CORS
37 |
38 |
39 |
40 |
41 | # ------------------------------------------------------------------------------
42 | # | Web fonts access |
43 | # ------------------------------------------------------------------------------
44 |
45 | # Allow access from all domains for web fonts
46 |
47 |
48 |
49 | Header set Access-Control-Allow-Origin "*"
50 |
51 |
52 |
53 |
54 | # ##############################################################################
55 | # # ERRORS #
56 | # ##############################################################################
57 |
58 | # ------------------------------------------------------------------------------
59 | # | 404 error prevention for non-existing redirected folders |
60 | # ------------------------------------------------------------------------------
61 |
62 | # Prevent Apache from returning a 404 error for a rewrite if a directory
63 | # with the same name does not exist.
64 | # http://httpd.apache.org/docs/current/content-negotiation.html#multiviews
65 | # http://www.webmasterworld.com/apache/3808792.htm
66 |
67 | Options -MultiViews
68 |
69 | # ------------------------------------------------------------------------------
70 | # | Custom error messages / pages |
71 | # ------------------------------------------------------------------------------
72 |
73 | # You can customize what Apache returns to the client in case of an error (see
74 | # http://httpd.apache.org/docs/current/mod/core.html#errordocument), e.g.:
75 |
76 | ErrorDocument 404 /404.html
77 |
78 |
79 | # ##############################################################################
80 | # # INTERNET EXPLORER #
81 | # ##############################################################################
82 |
83 | # ------------------------------------------------------------------------------
84 | # | Better website experience |
85 | # ------------------------------------------------------------------------------
86 |
87 | # Force IE to render pages in the highest available mode in the various
88 | # cases when it may not: http://hsivonen.iki.fi/doctype/ie-mode.pdf.
89 |
90 |
91 | Header set X-UA-Compatible "IE=edge"
92 | # `mod_headers` can't match based on the content-type, however, we only
93 | # want to send this header for HTML pages and not for the other resources
94 |
95 | Header unset X-UA-Compatible
96 |
97 |
98 |
99 | # ------------------------------------------------------------------------------
100 | # | Cookie setting from iframes |
101 | # ------------------------------------------------------------------------------
102 |
103 | # Allow cookies to be set from iframes in IE.
104 |
105 | #
106 | # Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
107 | #
108 |
109 | # ------------------------------------------------------------------------------
110 | # | Screen flicker |
111 | # ------------------------------------------------------------------------------
112 |
113 | # Stop screen flicker in IE on CSS rollovers (this only works in
114 | # combination with the `ExpiresByType` directives for images from below).
115 |
116 | # BrowserMatch "MSIE" brokenvary=1
117 | # BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
118 | # BrowserMatch "Opera" !brokenvary
119 | # SetEnvIf brokenvary 1 force-no-vary
120 |
121 |
122 | # ##############################################################################
123 | # # MIME TYPES AND ENCODING #
124 | # ##############################################################################
125 |
126 | # ------------------------------------------------------------------------------
127 | # | Proper MIME types for all files |
128 | # ------------------------------------------------------------------------------
129 |
130 |
131 |
132 | # Audio
133 | AddType audio/mp4 m4a f4a f4b
134 | AddType audio/ogg oga ogg
135 |
136 | # JavaScript
137 | # Normalize to standard type (it's sniffed in IE anyways):
138 | # http://tools.ietf.org/html/rfc4329#section-7.2
139 | AddType application/javascript js jsonp
140 | AddType application/json json
141 |
142 | # Video
143 | AddType video/mp4 mp4 m4v f4v f4p
144 | AddType video/ogg ogv
145 | AddType video/webm webm
146 | AddType video/x-flv flv
147 |
148 | # Web fonts
149 | AddType application/font-woff woff
150 | AddType application/vnd.ms-fontobject eot
151 |
152 | # Browsers usually ignore the font MIME types and sniff the content,
153 | # however, Chrome shows a warning if other MIME types are used for the
154 | # following fonts.
155 | AddType application/x-font-ttf ttc ttf
156 | AddType font/opentype otf
157 |
158 | # Make SVGZ fonts work on iPad:
159 | # https://twitter.com/FontSquirrel/status/14855840545
160 | AddType image/svg+xml svg svgz
161 | AddEncoding gzip svgz
162 |
163 | # Other
164 | AddType application/octet-stream safariextz
165 | AddType application/x-chrome-extension crx
166 | AddType application/x-opera-extension oex
167 | AddType application/x-shockwave-flash swf
168 | AddType application/x-web-app-manifest+json webapp
169 | AddType application/x-xpinstall xpi
170 | AddType application/xml atom rdf rss xml
171 | AddType image/webp webp
172 | AddType image/x-icon ico
173 | AddType text/cache-manifest appcache manifest
174 | AddType text/vtt vtt
175 | AddType text/x-component htc
176 | AddType text/x-vcard vcf
177 |
178 |
179 |
180 | # ------------------------------------------------------------------------------
181 | # | UTF-8 encoding |
182 | # ------------------------------------------------------------------------------
183 |
184 | # Use UTF-8 encoding for anything served as `text/html` or `text/plain`.
185 | AddDefaultCharset utf-8
186 |
187 | # Force UTF-8 for certain file formats.
188 |
189 | AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml
190 |
191 |
192 |
193 | # ##############################################################################
194 | # # URL REWRITES #
195 | # ##############################################################################
196 |
197 | # ------------------------------------------------------------------------------
198 | # | Rewrite engine |
199 | # ------------------------------------------------------------------------------
200 |
201 | # Turning on the rewrite engine and enabling the `FollowSymLinks` option is
202 | # necessary for the following directives to work.
203 |
204 | # If your web host doesn't allow the `FollowSymlinks` option, you may need to
205 | # comment it out and use `Options +SymLinksIfOwnerMatch` but, be aware of the
206 | # performance impact: http://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks
207 |
208 | # Also, some cloud hosting services require `RewriteBase` to be set:
209 | # http://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-mod-rewrite-not-working-on-my-site
210 |
211 |
212 | Options +FollowSymlinks
213 | # Options +SymLinksIfOwnerMatch
214 | RewriteEngine On
215 | # RewriteBase /
216 |
217 |
218 | # ------------------------------------------------------------------------------
219 | # | Suppressing / Forcing the "www." at the beginning of URLs |
220 | # ------------------------------------------------------------------------------
221 |
222 | # The same content should never be available under two different URLs especially
223 | # not with and without "www." at the beginning. This can cause SEO problems
224 | # (duplicate content), therefore, you should choose one of the alternatives and
225 | # redirect the other one.
226 |
227 | # By default option 1 (no "www.") is activated:
228 | # http://no-www.org/faq.php?q=class_b
229 |
230 | # If you'd prefer to use option 2, just comment out all the lines from option 1
231 | # and uncomment the ones from option 2.
232 |
233 | # IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME!
234 |
235 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
236 |
237 | # Option 1: rewrite www.example.com → example.com
238 |
239 |
240 | RewriteCond %{HTTPS} !=on
241 | RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
242 | RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
243 |
244 |
245 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
246 |
247 | # Option 2: rewrite example.com → www.example.com
248 |
249 | # Be aware that the following might not be a good idea if you use "real"
250 | # subdomains for certain parts of your website.
251 |
252 | #
253 | # RewriteCond %{HTTPS} !=on
254 | # RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
255 | # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
256 | #
257 |
258 |
259 | # ##############################################################################
260 | # # SECURITY #
261 | # ##############################################################################
262 |
263 | # ------------------------------------------------------------------------------
264 | # | Content Security Policy (CSP) |
265 | # ------------------------------------------------------------------------------
266 |
267 | # You can mitigate the risk of cross-site scripting and other content-injection
268 | # attacks by setting a Content Security Policy which whitelists trusted sources
269 | # of content for your site.
270 |
271 | # The example header below allows ONLY scripts that are loaded from the current
272 | # site's origin (no inline scripts, no CDN, etc). This almost certainly won't
273 | # work as-is for your site!
274 |
275 | # To get all the details you'll need to craft a reasonable policy for your site,
276 | # read: http://html5rocks.com/en/tutorials/security/content-security-policy (or
277 | # see the specification: http://w3.org/TR/CSP).
278 |
279 | #
280 | # Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
281 | #
282 | # Header unset Content-Security-Policy
283 | #
284 | #
285 |
286 | # ------------------------------------------------------------------------------
287 | # | File access |
288 | # ------------------------------------------------------------------------------
289 |
290 | # Block access to directories without a default document.
291 | # Usually you should leave this uncommented because you shouldn't allow anyone
292 | # to surf through every directory on your server (which may includes rather
293 | # private places like the CMS's directories).
294 |
295 |
296 | Options -Indexes
297 |
298 |
299 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
300 |
301 | # Block access to hidden files and directories.
302 | # This includes directories used by version control systems such as Git and SVN.
303 |
304 |
305 | RewriteCond %{SCRIPT_FILENAME} -d [OR]
306 | RewriteCond %{SCRIPT_FILENAME} -f
307 | RewriteRule "(^|/)\." - [F]
308 |
309 |
310 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
311 |
312 | # Block access to backup and source files.
313 | # These files may be left by some text editors and can pose a great security
314 | # danger when anyone has access to them.
315 |
316 |
317 | Order allow,deny
318 | Deny from all
319 | Satisfy All
320 |
321 |
322 | # ------------------------------------------------------------------------------
323 | # | Secure Sockets Layer (SSL) |
324 | # ------------------------------------------------------------------------------
325 |
326 | # Rewrite secure requests properly to prevent SSL certificate warnings, e.g.:
327 | # prevent `https://www.example.com` when your certificate only allows
328 | # `https://secure.example.com`.
329 |
330 | #
331 | # RewriteCond %{SERVER_PORT} !^443
332 | # RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L]
333 | #
334 |
335 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
336 |
337 | # Force client-side SSL redirection.
338 |
339 | # If a user types "example.com" in his browser, the above rule will redirect him
340 | # to the secure version of the site. That still leaves a window of opportunity
341 | # (the initial HTTP connection) for an attacker to downgrade or redirect the
342 | # request. The following header ensures that browser will ONLY connect to your
343 | # server via HTTPS, regardless of what the users type in the address bar.
344 | # http://www.html5rocks.com/en/tutorials/security/transport-layer-security/
345 |
346 | #
347 | # Header set Strict-Transport-Security max-age=16070400;
348 | #
349 |
350 | # ------------------------------------------------------------------------------
351 | # | Server software information |
352 | # ------------------------------------------------------------------------------
353 |
354 | # Avoid displaying the exact Apache version number, the description of the
355 | # generic OS-type and the information about Apache's compiled-in modules.
356 |
357 | # ADD THIS DIRECTIVE IN THE `httpd.conf` AS IT WILL NOT WORK IN THE `.htaccess`!
358 |
359 | # ServerTokens Prod
360 |
361 |
362 | # ##############################################################################
363 | # # WEB PERFORMANCE #
364 | # ##############################################################################
365 |
366 | # ------------------------------------------------------------------------------
367 | # | Compression |
368 | # ------------------------------------------------------------------------------
369 |
370 |
371 |
372 | # Force compression for mangled headers.
373 | # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
374 |
375 |
376 | SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
377 | RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
378 |
379 |
380 |
381 | # Compress all output labeled with one of the following MIME-types
382 | # (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
383 | # and can remove the `` and `` lines
384 | # as `AddOutputFilterByType` is still in the core directives).
385 |
386 | AddOutputFilterByType DEFLATE application/atom+xml \
387 | application/javascript \
388 | application/json \
389 | application/rss+xml \
390 | application/vnd.ms-fontobject \
391 | application/x-font-ttf \
392 | application/x-web-app-manifest+json \
393 | application/xhtml+xml \
394 | application/xml \
395 | font/opentype \
396 | image/svg+xml \
397 | image/x-icon \
398 | text/css \
399 | text/html \
400 | text/plain \
401 | text/x-component \
402 | text/xml
403 |
404 |
405 |
406 |
407 | # ------------------------------------------------------------------------------
408 | # | Content transformations |
409 | # ------------------------------------------------------------------------------
410 |
411 | # Prevent some of the mobile network providers from modifying the content of
412 | # your site: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5.
413 |
414 | #
415 | # Header set Cache-Control "no-transform"
416 | #
417 |
418 | # ------------------------------------------------------------------------------
419 | # | ETag removal |
420 | # ------------------------------------------------------------------------------
421 |
422 | # Since we're sending far-future expires headers (see below), ETags can
423 | # be removed: http://developer.yahoo.com/performance/rules.html#etags.
424 |
425 | # `FileETag None` is not enough for every server.
426 |
427 | Header unset ETag
428 |
429 |
430 | FileETag None
431 |
432 | # ------------------------------------------------------------------------------
433 | # | Expires headers (for better cache control) |
434 | # ------------------------------------------------------------------------------
435 |
436 | # The following expires headers are set pretty far in the future. If you don't
437 | # control versioning with filename-based cache busting, consider lowering the
438 | # cache time for resources like CSS and JS to something like 1 week.
439 |
440 |
441 |
442 | ExpiresActive on
443 | ExpiresDefault "access plus 1 month"
444 |
445 | # CSS
446 | ExpiresByType text/css "access plus 1 year"
447 |
448 | # Data interchange
449 | ExpiresByType application/json "access plus 0 seconds"
450 | ExpiresByType application/xml "access plus 0 seconds"
451 | ExpiresByType text/xml "access plus 0 seconds"
452 |
453 | # Favicon (cannot be renamed!)
454 | ExpiresByType image/x-icon "access plus 1 week"
455 |
456 | # HTML components (HTCs)
457 | ExpiresByType text/x-component "access plus 1 month"
458 |
459 | # HTML
460 | ExpiresByType text/html "access plus 0 seconds"
461 |
462 | # JavaScript
463 | ExpiresByType application/javascript "access plus 1 year"
464 |
465 | # Manifest files
466 | ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
467 | ExpiresByType text/cache-manifest "access plus 0 seconds"
468 |
469 | # Media
470 | ExpiresByType audio/ogg "access plus 1 month"
471 | ExpiresByType image/gif "access plus 1 month"
472 | ExpiresByType image/jpeg "access plus 1 month"
473 | ExpiresByType image/png "access plus 1 month"
474 | ExpiresByType video/mp4 "access plus 1 month"
475 | ExpiresByType video/ogg "access plus 1 month"
476 | ExpiresByType video/webm "access plus 1 month"
477 |
478 | # Web feeds
479 | ExpiresByType application/atom+xml "access plus 1 hour"
480 | ExpiresByType application/rss+xml "access plus 1 hour"
481 |
482 | # Web fonts
483 | ExpiresByType application/font-woff "access plus 1 month"
484 | ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
485 | ExpiresByType application/x-font-ttf "access plus 1 month"
486 | ExpiresByType font/opentype "access plus 1 month"
487 | ExpiresByType image/svg+xml "access plus 1 month"
488 |
489 |
490 |
491 | # ------------------------------------------------------------------------------
492 | # | Filename-based cache busting |
493 | # ------------------------------------------------------------------------------
494 |
495 | # If you're not using a build process to manage your filename version revving,
496 | # you might want to consider enabling the following directives to route all
497 | # requests such as `/css/style.12345.css` to `/css/style.css`.
498 |
499 | # To understand why this is important and a better idea than `*.css?v231`, read:
500 | # http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring
501 |
502 | #
503 | # RewriteCond %{REQUEST_FILENAME} !-f
504 | # RewriteCond %{REQUEST_FILENAME} !-d
505 | # RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
506 | #
507 |
508 | # ------------------------------------------------------------------------------
509 | # | File concatenation |
510 | # ------------------------------------------------------------------------------
511 |
512 | # Allow concatenation from within specific CSS and JS files, e.g.:
513 | # Inside of `script.combined.js` you could have
514 | #
515 | #
516 | # and they would be included into this single file.
517 |
518 | #
519 | #
520 | # Options +Includes
521 | # AddOutputFilterByType INCLUDES application/javascript application/json
522 | # SetOutputFilter INCLUDES
523 | #
524 | #
525 | # Options +Includes
526 | # AddOutputFilterByType INCLUDES text/css
527 | # SetOutputFilter INCLUDES
528 | #
529 | #
530 |
531 | # ------------------------------------------------------------------------------
532 | # | Persistent connections |
533 | # ------------------------------------------------------------------------------
534 |
535 | # Allow multiple requests to be sent over the same TCP connection:
536 | # http://httpd.apache.org/docs/current/en/mod/core.html#keepalive.
537 |
538 | # Enable if you serve a lot of static content but, be aware of the
539 | # possible disadvantages!
540 |
541 | #
542 | # Header set Connection Keep-Alive
543 | #
544 |
--------------------------------------------------------------------------------
/client/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "bitwise": true,
3 | "camelcase": true,
4 | "curly": true,
5 | "eqeqeq": true,
6 | "es3": false,
7 | "forin": true,
8 | "freeze": true,
9 | "immed": true,
10 | "indent": 2,
11 | "latedef": "nofunc",
12 | "newcap": true,
13 | "noarg": true,
14 | "noempty": true,
15 | "nonbsp": true,
16 | "nonew": true,
17 | "plusplus": false,
18 | "quotmark": "single",
19 | "undef": true,
20 | "unused": false,
21 | "strict": false,
22 | "maxparams": 10,
23 | "maxdepth": 5,
24 | "maxstatements": 40,
25 | "maxcomplexity": 8,
26 | "maxlen": 250,
27 |
28 | "asi": false,
29 | "boss": false,
30 | "debug": false,
31 | "eqnull": true,
32 | "esnext": false,
33 | "evil": false,
34 | "expr": false,
35 | "funcscope": false,
36 | "globalstrict": false,
37 | "iterator": false,
38 | "lastsemic": false,
39 | "laxbreak": false,
40 | "laxcomma": false,
41 | "loopfunc": true,
42 | "maxerr": false,
43 | "moz": false,
44 | "multistr": false,
45 | "notypeof": false,
46 | "proto": false,
47 | "scripturl": false,
48 | "shadow": false,
49 | "sub": true,
50 | "supernew": false,
51 | "validthis": false,
52 | "noyield": false,
53 |
54 | "browser": true,
55 | "node": true,
56 |
57 | "globals": {
58 | "jQuery": true,
59 | "angular": false,
60 | "console": true,
61 | "$": false,
62 | "_": true,
63 | "moment": true,
64 | "describe": true,
65 | "beforeEach": true,
66 | "module": true,
67 | "inject": true,
68 | "it": true,
69 | "expect": true,
70 | "browser": true,
71 | "element": true,
72 | "by": true
73 | }
74 | }
--------------------------------------------------------------------------------
/client/app/app.js:
--------------------------------------------------------------------------------
1 | ;(function(){
2 | 'use strict';
3 | angular
4 | .module('moviesApp', [
5 |
6 | 'ngSanitize',
7 | 'restangular',
8 | 'ui.router'
9 |
10 | ])
11 | .constant('serverBaseUrl', 'http://localhost:9000')
12 | .constant('serverUrl', 'http://localhost:9000/api/')
13 | .config( appConfig );
14 |
15 | appConfig.$inject = [
16 | 'RestangularProvider',
17 | '$stateProvider',
18 | '$urlRouterProvider',
19 | '$locationProvider'];
20 | function appConfig(RestangularProvider, $stateProvider, $urlRouterProvider, $locationProvider) {
21 | $urlRouterProvider
22 | .when('', '/movies')
23 | .otherwise('/');
24 |
25 | RestangularProvider.setBaseUrl('http://localhost:9000/api/');
26 | RestangularProvider.setRestangularFields({
27 | id: '_id',
28 | route: 'restangularRoute',
29 | selfLink: 'self.href'
30 | });
31 |
32 | RestangularProvider.setResponseExtractor(function extractResponse(serverResponse) {
33 | return serverResponse.data;
34 | });
35 |
36 | // $locationProvider.html5Mode(true);
37 | }
38 |
39 |
40 | }).call(this);
41 |
--------------------------------------------------------------------------------
/client/app/factories/logger/logger.factory.js:
--------------------------------------------------------------------------------
1 | // ;(function() {
2 | // 'use strict';
3 | // angular
4 | // .module('moviesApp')
5 | // .factory('logger', logger);
6 | // function logger() {
7 | // var logIt;
8 | // toastr.options = {
9 | // "closeButton": true,
10 | // "positionClass": "toast-bottom-right",
11 | // "timeOut": "3000"
12 | // };
13 | // logIt = function(message, type) {
14 | // return toastr[type](message);
15 | // };
16 | // return {
17 | // log: function(message) {
18 | // logIt(message, 'info');
19 | // },
20 | // logWarning: function(message) {
21 | // logIt(message, 'warning');
22 | // },
23 | // logSuccess: function(message) {
24 | // logIt(message, 'success');
25 | // },
26 | // logError: function(message) {
27 | // logIt(message, 'error');
28 | // }
29 | // };
30 | // }
31 | // }).call(this);
32 |
33 |
--------------------------------------------------------------------------------
/client/app/movies/movies-theatres/movies-theatres.controller.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | angular
4 | .module('moviesApp')
5 | .controller('MoviesTheatresCtrl', function (movie, theatres) {
6 |
7 | var vm = this;
8 | vm.movie = movie;
9 | vm.theatres = theatres;
10 |
11 | });
12 |
--------------------------------------------------------------------------------
/client/app/movies/movies-theatres/movies-theatres.controller.spec.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('Controller: MoviesTheatresCtrl', function () {
4 |
5 | // load the controller's module
6 | beforeEach(module('moviesApp'));
7 |
8 | var MoviesTheatresCtrl, scope;
9 |
10 | // Initialize the controller and a mock scope
11 | beforeEach(inject(function ($controller, $rootScope) {
12 | scope = $rootScope.$new();
13 | MoviesTheatresCtrl = $controller('MoviesTheatresCtrl', {
14 | $scope: scope
15 | });
16 | }));
17 |
18 | it('should ...', function () {
19 | expect(1).toEqual(1);
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/client/app/movies/movies-theatres/movies-theatres.html:
--------------------------------------------------------------------------------
1 |
2 | List of Theatres Playing Movie
3 |
4 |
6 |
7 |
8 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/client/app/movies/movies.controller.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | angular
4 | .module('moviesApp')
5 | .controller('MoviesCtrl', function MoviesCtrl(movies) {
6 |
7 | var vm = this;
8 | vm.movies = movies;
9 |
10 | });
11 |
--------------------------------------------------------------------------------
/client/app/movies/movies.controller.spec.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('Controller: MoviesCtrl', function () {
4 |
5 | // load the controller's module
6 | beforeEach(module('moviesApp'));
7 |
8 | var MoviesCtrl, scope;
9 |
10 | // Initialize the controller and a mock scope
11 | beforeEach(inject(function ($controller, $rootScope) {
12 | scope = $rootScope.$new();
13 | MoviesCtrl = $controller('MoviesCtrl', {
14 | $scope: scope
15 | });
16 | }));
17 |
18 | it('should ...', function () {
19 | expect(1).toEqual(1);
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/client/app/movies/movies.html:
--------------------------------------------------------------------------------
1 |
29 |
--------------------------------------------------------------------------------
/client/app/movies/movies.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | angular.module('moviesApp')
4 | .config(function ($stateProvider) {
5 | $stateProvider
6 | .state('movies', {
7 | url: '/movies',
8 | templateUrl: 'app/movies/movies.html',
9 | controller: 'MoviesCtrl as vm',
10 | resolve: {
11 | movies: function(Restangular) {
12 | return Restangular
13 | .all('movies')
14 | .getList();
15 | }
16 | }
17 | })
18 | .state('movies_theatres', {
19 | url: '/movies/:movie/theatres',
20 | controller: 'MoviesTheatresCtrl',
21 | controllerAs: 'vm',
22 | templateUrl: 'app/movies/movies-theatres/movies-theatres.html',
23 | resolve: {
24 | movie: function($stateParams, Restangular) {
25 | return Restangular
26 | .one('movies', $stateParams.movie)
27 | .get();
28 | },
29 |
30 | theatres: function($stateParams, Restangular) {
31 | return Restangular.one('movies', $stateParams.movie)
32 | .all('theatres')
33 | .getList();
34 | }
35 | }
36 | });
37 | });
38 |
--------------------------------------------------------------------------------
/client/app/theatres/theatres-movies/theatres-movies.controller.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | angular.module('moviesApp')
4 | .controller('TheatresMoviesCtrl', function TheatresMoviesCtrl(theatre, movies) {
5 |
6 | var vm = this;
7 | vm.theatre = theatre;
8 | vm.movies = movies;
9 |
10 | });
11 |
--------------------------------------------------------------------------------
/client/app/theatres/theatres-movies/theatres-movies.controller.spec.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('Controller: TheatresMoviesCtrl', function () {
4 |
5 | // load the controller's module
6 | beforeEach(module('moviesApp'));
7 |
8 | var TheatresMoviesCtrl, scope;
9 |
10 | // Initialize the controller and a mock scope
11 | beforeEach(inject(function ($controller, $rootScope) {
12 | scope = $rootScope.$new();
13 | TheatresMoviesCtrl = $controller('TheatresMoviesCtrl', {
14 | $scope: scope
15 | });
16 | }));
17 |
18 | it('should ...', function () {
19 | expect(1).toEqual(1);
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/client/app/theatres/theatres-movies/theatres-movies.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/client/app/theatres/theatres.controller.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | angular
4 | .module('moviesApp')
5 | .controller('TheatresCtrl', function TheatresCtrl(theatres) {
6 |
7 | var vm = this;
8 | vm.theatres = theatres;
9 |
10 | });
11 |
--------------------------------------------------------------------------------
/client/app/theatres/theatres.controller.spec.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('Controller: TheatresCtrl', function () {
4 |
5 | // load the controller's module
6 | beforeEach(module('moviesApp'));
7 |
8 | var TheatresCtrl, scope;
9 |
10 | // Initialize the controller and a mock scope
11 | beforeEach(inject(function ($controller, $rootScope) {
12 | scope = $rootScope.$new();
13 | TheatresCtrl = $controller('TheatresCtrl', {
14 | $scope: scope
15 | });
16 | }));
17 |
18 | it('should ...', function () {
19 | expect(1).toEqual(1);
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/client/app/theatres/theatres.html:
--------------------------------------------------------------------------------
1 |
20 |
--------------------------------------------------------------------------------
/client/app/theatres/theatres.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | angular.module('moviesApp')
4 | .config(function ($stateProvider) {
5 | $stateProvider
6 | .state('theatres', {
7 | url: '/theatres',
8 | templateUrl: 'app/theatres/theatres.html',
9 | controller: 'TheatresCtrl as vm',
10 | resolve: {
11 | theatres: function(Restangular) {
12 | return Restangular
13 | .all('theatres')
14 | .getList();
15 | }
16 | }
17 | })
18 | .state('theatres_movies', {
19 | url: '/theatres/:theatre/movies',
20 | templateUrl: 'app/theatres/theatres-movies/theatres-movies.html',
21 | controller: 'TheatresMoviesCtrl as vm',
22 | resolve: {
23 | theatre: function($stateParams, Restangular) {
24 | return Restangular
25 | .one('theatres', $stateParams.theatre)
26 | .get();
27 | },
28 |
29 | movies: function($stateParams, Restangular) {
30 | return Restangular
31 | .one('theatres', $stateParams.theatre)
32 | .all('movies')
33 | .getList();
34 | }
35 | }
36 | });
37 | });
38 |
--------------------------------------------------------------------------------
/client/assets/images/yeoman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeschool/WatchUsBuild-MovieListingsAppWithSQL/21f752a46f57fbdb3ab26a934deb72f8622b9beb/client/assets/images/yeoman.png
--------------------------------------------------------------------------------
/client/favicon.ico:
--------------------------------------------------------------------------------
1 | � ( @ -2Op"=p�Jt��Jt��b���������������������������������������������������b���Jt��Jt��"=p�Op-2 O`O�O�O�O�O�O�O�$\�Jt��������������v���v���������������Jt��$\�O�O�O�O�O�O�O�O` O�O�O�O�O�O�O�O�O�O� ;n�s���>���>���>���>���s��� ;n�O�O�O�O�O�O�O�O�O�O� O`O�O�O�O�O�O�O�O�O�O�$\�]���^n��^n��]���$\�O�O�O�O�O�O�O�O�O�O�O` O�O�O�O�O�O�O�O�O�O�O�n�* ��* ��n�O�O�O�O�O�O�O�O�O�O�O� O�O�O�O�O�O�O�O�O�O�O�5>Y�5>Y�O�O�O�O�O�O�O�O�O�O�O� -2O�O�O�O�O�O�O�O�O�O�&6e�&6e�O�O�O�O�O�O�O�O�O�O�-2 5r�4���E���$\�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�$\�E���4���5r� 5r�E���M���M���v���0\��O�O�O�O�O�O�O�$\�$\�O�O�O�O�O�O�O�0\��v���M���M���E���5r� )��p&��p��&��������������b���Jt��Jt��Jt��0\��#i��.r��.r��#i��0\��Jt��Jt��Jt��b���������������&��p��&��)��p 4���&��-���_������������������]���]�������7���p�����������p���7�������]���]�������������������_��-���-���4��� qֈp��p��p����������������������p���7���#i��p�����������p���#i��7���p�����������������������p��&��-���qֈ 8��(p��p��I���v���v���]���7���n���v���p���#i��]���v���v���]���#i��p���v���n���7���]���v���v���I���-���-���8��( ;��`-���M���7���7���7���.r��R��E��R��E��7���7���7���7���E��R��E��R��.r��7���7���7���M���M���;��` ���������������������������z ���������������������������
2 | � ���
3 | �
9�
9�
9�
9�
9�
9�
9�
9�
4 | �n�n�
5 | �
9�
9�
9�
9�
9�
9�
9�
9�
6 | ���� * �x* ��* ��* ��* ��* ��* ��* ��n�&