├── .nvmrc ├── cms ├── log │ └── .keep ├── tmp │ └── .keep ├── vendor │ └── .keep ├── test │ ├── fixtures │ │ ├── .keep │ │ ├── files │ │ │ └── .keep │ │ ├── projects.yml │ │ └── users.yml │ ├── mailers │ │ └── .keep │ ├── models │ │ ├── .keep │ │ ├── user_test.rb │ │ └── project_test.rb │ ├── controllers │ │ └── .keep │ ├── integration │ │ └── .keep │ └── test_helper.rb ├── .ruby-gemset ├── .ruby-version ├── app │ ├── graph │ │ ├── mutations │ │ │ └── .gitkeep │ │ ├── queries │ │ │ └── .gitkeep │ │ ├── app_schema.rb │ │ ├── types │ │ │ ├── json_type.rb │ │ │ ├── project_type.rb │ │ │ ├── user_type.rb │ │ │ ├── auth_user_type.rb │ │ │ └── root_query_type.rb │ │ └── concerns │ │ │ └── field_generator.rb │ ├── models │ │ ├── concerns │ │ │ └── .keep │ │ ├── project.rb │ │ ├── application_record.rb │ │ └── user.rb │ ├── controllers │ │ ├── concerns │ │ │ └── .keep │ │ ├── application_controller.rb │ │ └── graphql_controller.rb │ ├── views │ │ └── layouts │ │ │ ├── mailer.text.erb │ │ │ └── mailer.html.erb │ ├── jobs │ │ └── application_job.rb │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ └── mailers │ │ └── application_mailer.rb ├── README.md ├── public │ └── robots.txt ├── bin │ ├── bundle │ ├── rake │ ├── rails │ ├── spring │ ├── update │ └── setup ├── config │ ├── boot.rb │ ├── spring.rb │ ├── environment.rb │ ├── initializers │ │ ├── mime_types.rb │ │ ├── application_controller_renderer.rb │ │ ├── filter_parameter_logging.rb │ │ ├── backtrace_silencers.rb │ │ ├── wrap_parameters.rb │ │ ├── cors.rb │ │ └── inflections.rb │ ├── cable.yml │ ├── routes.rb │ ├── locales │ │ └── en.yml │ └── secrets.yml ├── config.ru ├── Rakefile ├── db │ ├── migrate │ │ ├── 20170809224732_add_fields_to_user.rb │ │ └── 20170810223903_create_projects.rb │ └── seeds.rb ├── lib │ └── tasks │ │ └── graphql.rake ├── .gitignore └── Gemfile ├── .eslintignore ├── config ├── testing │ ├── __mocks__ │ │ ├── styleMock.js │ │ └── fileMock.js │ └── templates │ │ └── _index.prod.html ├── generators │ ├── component │ │ ├── export.ts.hbs │ │ ├── types.ts.hbs │ │ ├── import.ts.hbs │ │ ├── styles.ts.hbs │ │ ├── stateless.tsx.hbs │ │ └── es6class.tsx.hbs │ ├── container │ │ ├── export.js.hbs │ │ ├── reducer.export.js.hbs │ │ ├── types.export.ts.hbs │ │ ├── state-type.js.hbs │ │ ├── reducer.export-state.js.hbs │ │ ├── reducer.import.js.hbs │ │ ├── import.js.hbs │ │ ├── types.import.ts.hbs │ │ ├── state.import.js.hbs │ │ ├── styles.js.hbs │ │ ├── state.js.hbs │ │ ├── actions.js.hbs │ │ ├── reducer.js.hbs │ │ ├── constants.js.hbs │ │ ├── types.ts.hbs │ │ ├── actionCreators.js.hbs │ │ ├── presentation.js.hbs │ │ └── selectors.js.hbs │ ├── utils │ │ ├── safeString.js │ │ └── index.js │ └── cli.js ├── .storybook │ ├── addons.js │ ├── config.js │ ├── stories │ │ ├── index.js │ │ └── components │ │ │ ├── LoadingIndicator.js │ │ │ ├── Pic.js │ │ │ ├── Image.js │ │ │ ├── Toast.js │ │ │ └── Notification.js │ └── webpack.config.js ├── types │ └── require.d.ts └── ignoreAssets.js ├── packages └── ui │ ├── src │ ├── Anchor │ │ ├── types.ts │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── anchorMocks.mock.ts │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ │ └── index.test.tsx │ │ ├── styles.ts │ │ └── index.tsx │ ├── Footer │ │ ├── types.ts │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── footerMocks.mock.ts │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ │ └── index.test.tsx │ │ ├── styles.ts │ │ └── index.tsx │ ├── Hero │ │ ├── types.ts │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── heroMocks.mock.ts │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ │ └── index.test.tsx │ │ ├── index.tsx │ │ └── styles.ts │ ├── Article │ │ ├── types.ts │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── articleMocks.mock.ts │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ │ └── index.test.tsx │ │ ├── styles.ts │ │ └── index.tsx │ ├── Markdown │ │ ├── types.ts │ │ ├── styles.ts │ │ └── index.tsx │ ├── LoadingIndicator │ │ ├── types.ts │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── loadingIndicatorMocks.mock.ts │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ │ └── index.test.tsx │ │ ├── styles.ts │ │ └── index.tsx │ ├── Heading │ │ ├── types.ts │ │ ├── styleUtils.ts │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── headingProps.mock.ts │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ │ └── index.test.tsx │ │ ├── styles.ts │ │ └── index.tsx │ ├── Image │ │ ├── types.ts │ │ ├── index.tsx │ │ ├── styles.ts │ │ └── __tests__ │ │ │ └── __mocks__ │ │ │ └── imageMocks.mock.ts │ ├── Avatar │ │ ├── types.ts │ │ ├── maps.ts │ │ ├── default.ts │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── avatarMocks.mock.ts │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ │ └── index.test.tsx │ │ ├── index.tsx │ │ └── styles.ts │ ├── theming │ │ ├── index.ts │ │ ├── types.ts │ │ ├── colorMap.ts │ │ └── globalCss.ts │ ├── Headline │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── headlineProps.mock.ts │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ │ └── index.test.tsx │ │ ├── types.ts │ │ ├── styleUtils.ts │ │ ├── styles.ts │ │ └── index.tsx │ ├── Paragraph │ │ ├── types.ts │ │ ├── styleUtils.ts │ │ ├── index.tsx │ │ └── styles.ts │ ├── Box │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── boxMocks.mock.ts │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ │ └── index.test.tsx │ │ ├── index.tsx │ │ ├── maps.ts │ │ ├── styles.ts │ │ └── types.ts │ ├── Header │ │ ├── types.ts │ │ ├── header.tsx │ │ ├── styles.ts │ │ └── utils.ts │ ├── utils │ │ ├── index.ts │ │ └── remStringFromPx.ts │ ├── Notification │ │ ├── types.ts │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── notificationMocks.mock.ts │ │ │ └── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ ├── styles.ts │ │ └── index.tsx │ ├── Toast │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── toast.mock.ts │ │ │ └── index.test.tsx │ │ ├── types.ts │ │ └── styles.ts │ ├── WithAnimation │ │ ├── types.ts │ │ ├── index.tsx │ │ └── animation.ts │ ├── SvgIcon │ │ ├── types.ts │ │ └── index.tsx │ ├── Button │ │ ├── maps.ts │ │ ├── types.ts │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── buttonMocks.mock.ts │ │ │ └── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ ├── styles.ts │ │ └── index.tsx │ ├── Section │ │ ├── __tests__ │ │ │ ├── __mocks__ │ │ │ │ └── sectionMocks.mock.ts │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ │ └── index.test.tsx │ │ ├── styles.ts │ │ └── index.tsx │ └── index.ts │ ├── tsconfig.json │ └── package.json ├── src ├── client │ ├── components │ │ ├── Menu │ │ │ ├── types.ts │ │ │ ├── styles.ts │ │ │ └── index.tsx │ │ ├── Burger │ │ │ ├── types.ts │ │ │ ├── button.ts │ │ │ ├── span.ts │ │ │ └── index.tsx │ │ ├── CaseStudy │ │ │ ├── types.ts │ │ │ ├── relative.ts │ │ │ ├── __tests__ │ │ │ │ └── __mocks__ │ │ │ │ │ └── caseStudy.mock.js │ │ │ └── overlay.ts │ │ ├── Html │ │ │ └── types.ts │ │ ├── Navigation │ │ │ ├── types.ts │ │ │ ├── styles.ts │ │ │ └── index.tsx │ │ ├── PageIntro │ │ │ ├── types.ts │ │ │ ├── hr.ts │ │ │ ├── styles.ts │ │ │ └── index.tsx │ │ ├── CaseStudies │ │ │ ├── types.ts │ │ │ ├── index.tsx │ │ │ └── __tests__ │ │ │ │ ├── index.test.js │ │ │ │ └── __mocks__ │ │ │ │ └── caseStudies.mock.js │ │ ├── index.ts │ │ └── Footer │ │ │ └── index.tsx │ ├── features │ │ ├── Layout │ │ │ ├── types.ts │ │ │ ├── constants.ts │ │ │ ├── main.ts │ │ │ ├── div.ts │ │ │ ├── __tests__ │ │ │ │ ├── __snapshots__ │ │ │ │ │ ├── index.test.tsx.snap │ │ │ │ │ ├── div.test.tsx.snap │ │ │ │ │ └── main.test.tsx.snap │ │ │ │ ├── div.test.tsx │ │ │ │ ├── main.test.tsx │ │ │ │ ├── actionCreators.test.ts │ │ │ │ ├── reducer.test.ts │ │ │ │ ├── index.test.tsx │ │ │ │ └── selectors.test.ts │ │ │ ├── state.ts │ │ │ ├── styles.ts │ │ │ ├── actions.ts │ │ │ ├── actionCreators.ts │ │ │ ├── selectors.ts │ │ │ ├── reducer.ts │ │ │ └── presentation.tsx │ │ ├── Project │ │ │ ├── types.ts │ │ │ ├── project.graphql.ts │ │ │ ├── withGraphql.ts │ │ │ ├── index.tsx │ │ │ ├── __tests__ │ │ │ │ └── index.test.tsx │ │ │ └── presentation.tsx │ │ ├── Portfolio │ │ │ ├── types.ts │ │ │ ├── projects.graphql.ts │ │ │ ├── withGraphql.ts │ │ │ ├── presentation.tsx │ │ │ ├── __tests__ │ │ │ │ └── index.test.js │ │ │ └── index.tsx │ │ ├── NavigationMenu │ │ │ ├── li.ts │ │ │ ├── ul.ts │ │ │ ├── constants.ts │ │ │ ├── actions.ts │ │ │ ├── actionCreators.ts │ │ │ ├── __tests__ │ │ │ │ ├── actionCreators.test.ts │ │ │ │ ├── selectors.test.ts │ │ │ │ └── reducer.test.ts │ │ │ ├── types.ts │ │ │ ├── reducer.ts │ │ │ ├── state.ts │ │ │ ├── navLink.tsx │ │ │ ├── selectors.ts │ │ │ ├── nav.ts │ │ │ ├── presentation.tsx │ │ │ └── index.tsx │ │ ├── Clients │ │ │ ├── types.ts │ │ │ ├── clientBox.ts │ │ │ ├── styles.ts │ │ │ ├── clients.graphql.ts │ │ │ ├── withGraphql.ts │ │ │ ├── client.tsx │ │ │ ├── index.tsx │ │ │ └── presentation.tsx │ │ ├── Home │ │ │ ├── wrapper.ts │ │ │ ├── styles.ts │ │ │ ├── __tests__ │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── wrapper.test.tsx.snap │ │ │ │ ├── wrapper.test.tsx │ │ │ │ ├── actionCreators.test.ts │ │ │ │ └── index.test.tsx │ │ │ ├── sectionIsVisible.ts │ │ │ ├── types.ts │ │ │ ├── constants.ts │ │ │ ├── actions.ts │ │ │ ├── selectors.ts │ │ │ ├── reducer.ts │ │ │ ├── actionCreators.ts │ │ │ └── state.ts │ │ ├── Contact │ │ │ ├── index.tsx │ │ │ └── presentation.tsx │ │ └── index.ts │ ├── logic.ts │ ├── theming │ │ ├── index.ts │ │ ├── types.ts │ │ └── colorMap.ts │ ├── shared │ │ ├── constants.ts │ │ ├── actionCreators.ts │ │ └── actions.ts │ ├── apolloClient.ts │ ├── test │ │ └── mockstore.ts │ ├── reducers.ts │ ├── state.ts │ ├── index.tsx │ ├── types.ts │ └── routes.tsx └── server │ ├── graph │ ├── mutations │ │ ├── index.ts │ │ └── contact │ │ │ ├── index.ts │ │ │ └── create.ts │ ├── queries │ │ ├── client │ │ │ ├── index.ts │ │ │ ├── clients.ts │ │ │ └── client.ts │ │ ├── index.ts │ │ └── project │ │ │ ├── index.ts │ │ │ ├── projects.ts │ │ │ └── project.ts │ ├── types │ │ ├── index.ts │ │ ├── contact.ts │ │ ├── contact-input.ts │ │ ├── client.ts │ │ └── project.ts │ └── index.ts │ ├── db │ ├── models │ │ ├── index.ts │ │ ├── client.ts │ │ ├── contact.ts │ │ └── project.ts │ └── utils │ │ └── uuid.ts │ └── graphqlEntry.ts ├── Procfile ├── netlify.toml ├── .gitignore ├── server.js ├── CHANGELOG.md ├── .travis.yml ├── .env ├── README.md ├── index.html ├── .babelrc ├── tsconfig.json ├── devServer.js └── LICENSE /.nvmrc: -------------------------------------------------------------------------------- 1 | 6.9.5 -------------------------------------------------------------------------------- /cms/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/tmp/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/vendor/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/.ruby-gemset: -------------------------------------------------------------------------------- 1 | myapp 2 | -------------------------------------------------------------------------------- /cms/test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.4.1 2 | -------------------------------------------------------------------------------- /cms/app/graph/mutations/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/app/graph/queries/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | **/*.ts 2 | **/*.tsx 3 | -------------------------------------------------------------------------------- /cms/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /config/testing/__mocks__/styleMock.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; -------------------------------------------------------------------------------- /packages/ui/src/Anchor/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/Footer/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/Hero/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/Article/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/Markdown/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /src/client/components/Menu/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /src/client/features/Layout/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /src/client/features/Project/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /cms/app/models/project.rb: -------------------------------------------------------------------------------- 1 | class Project < ApplicationRecord 2 | end 3 | -------------------------------------------------------------------------------- /config/generators/component/export.ts.hbs: -------------------------------------------------------------------------------- 1 | $1 2 | {{ properCase name }}, -------------------------------------------------------------------------------- /config/generators/component/types.ts.hbs: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /config/generators/container/export.js.hbs: -------------------------------------------------------------------------------- 1 | $1 2 | {{ properCase name }}, -------------------------------------------------------------------------------- /config/testing/__mocks__/fileMock.js: -------------------------------------------------------------------------------- 1 | module.exports = 'test-file-stub'; -------------------------------------------------------------------------------- /packages/ui/src/LoadingIndicator/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /src/client/components/Burger/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /src/client/components/CaseStudy/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /src/client/components/Html/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './index'; 2 | -------------------------------------------------------------------------------- /src/client/components/Navigation/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /src/client/components/PageIntro/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/Heading/types.ts: -------------------------------------------------------------------------------- 1 | export { Props, Tag } from './index'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/Image/types.ts: -------------------------------------------------------------------------------- 1 | export { Props, ImageSize } from './index'; 2 | -------------------------------------------------------------------------------- /src/client/components/CaseStudies/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | -------------------------------------------------------------------------------- /cms/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /config/generators/container/reducer.export.js.hbs: -------------------------------------------------------------------------------- 1 | $1 2 | {{ camelCase name }}, -------------------------------------------------------------------------------- /config/generators/container/types.export.ts.hbs: -------------------------------------------------------------------------------- 1 | $1 2 | {{ properCase name }}Types, -------------------------------------------------------------------------------- /packages/ui/src/Avatar/types.ts: -------------------------------------------------------------------------------- 1 | export { Props, ImageSize } from './index'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/LoadingIndicator/__tests__/__mocks__/loadingIndicatorMocks.mock.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/client/features/Portfolio/types.ts: -------------------------------------------------------------------------------- 1 | export { Props, Project } from './'; 2 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | # Procfile for heroku 2 | web: cross-env NODE_ENV=server node server.js 3 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | command = "npm run deploy" 3 | publish = "build/public" 4 | -------------------------------------------------------------------------------- /src/client/logic.ts: -------------------------------------------------------------------------------- 1 | 2 | const rootLogic = []; 3 | 4 | export default rootLogic; 5 | -------------------------------------------------------------------------------- /cms/README.md: -------------------------------------------------------------------------------- 1 | # The Agency CMS 2 | A content management system, built using GraphQL on Rails 3 | -------------------------------------------------------------------------------- /config/generators/container/state-type.js.hbs: -------------------------------------------------------------------------------- 1 | $1 2 | {{ camelCase name }}: {{ properCase name }}State; -------------------------------------------------------------------------------- /src/client/theming/index.ts: -------------------------------------------------------------------------------- 1 | import colorMap from './colorMap'; 2 | 3 | export default colorMap; 4 | -------------------------------------------------------------------------------- /packages/ui/src/theming/index.ts: -------------------------------------------------------------------------------- 1 | import colorMap from './colorMap'; 2 | 3 | export default colorMap; 4 | -------------------------------------------------------------------------------- /cms/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::API 2 | end 3 | -------------------------------------------------------------------------------- /config/generators/container/reducer.export-state.js.hbs: -------------------------------------------------------------------------------- 1 | $1 2 | {{ camelCase name }}: {{ camelCase name }}State, 3 | -------------------------------------------------------------------------------- /packages/ui/src/Footer/__tests__/__mocks__/footerMocks.mock.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | color: '#0b0b0b', 3 | }; 4 | -------------------------------------------------------------------------------- /packages/ui/src/Headline/__tests__/__mocks__/headlineProps.mock.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | color: '#fff', 3 | }; 4 | -------------------------------------------------------------------------------- /packages/ui/src/Paragraph/types.ts: -------------------------------------------------------------------------------- 1 | export { Props, ParagraphSize, Margin, SizeMap, MarginSizeMap } from './index'; 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | dist 4 | npm-debug.log 5 | .vscode 6 | coverage 7 | yarn-error.log 8 | .DS_STORE 9 | -------------------------------------------------------------------------------- /cms/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /src/server/graph/mutations/index.ts: -------------------------------------------------------------------------------- 1 | import contact from './contact'; 2 | 3 | export default { 4 | ...contact, 5 | }; 6 | -------------------------------------------------------------------------------- /cms/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /packages/ui/src/Box/__tests__/__mocks__/boxMocks.mock.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | pad: 'medium', 3 | size: 'large', 4 | }; 5 | -------------------------------------------------------------------------------- /packages/ui/src/Header/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | export { Props as HeaderComponentProps } from './header'; 3 | -------------------------------------------------------------------------------- /packages/ui/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | import remStringFromPx from './remStringFromPx'; 2 | 3 | export default remStringFromPx; 4 | -------------------------------------------------------------------------------- /src/server/graph/mutations/contact/index.ts: -------------------------------------------------------------------------------- 1 | import create from './create'; 2 | 3 | export default { 4 | create, 5 | }; 6 | -------------------------------------------------------------------------------- /cms/app/graph/app_schema.rb: -------------------------------------------------------------------------------- 1 | AppSchema = GraphQL::Schema.define( 2 | query: RootQueryType, 3 | # mutation: RootMutationType 4 | ) -------------------------------------------------------------------------------- /config/generators/container/reducer.import.js.hbs: -------------------------------------------------------------------------------- 1 | $1 2 | import {{ camelCase name }} from 'features/{{ properCase name }}/reducer'; -------------------------------------------------------------------------------- /packages/ui/src/Avatar/maps.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | thumb: 50, 3 | small: 100, 4 | medium: 150, 5 | large: 250, 6 | }; 7 | -------------------------------------------------------------------------------- /packages/ui/src/Hero/__tests__/__mocks__/heroMocks.mock.ts: -------------------------------------------------------------------------------- 1 | export const heroProps = { 2 | backgroundColor: 'ff6600', 3 | }; 4 | -------------------------------------------------------------------------------- /packages/ui/src/Notification/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | export type Status = 'none' | 'ok' | 'warning' | 'error'; 3 | -------------------------------------------------------------------------------- /packages/ui/src/Toast/__tests__/__mocks__/toast.mock.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | status: 'ok', 3 | onClose: jest.fn(), 4 | }; 5 | -------------------------------------------------------------------------------- /packages/ui/src/Toast/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | 3 | export type Status = 'ok' | 'warning' | 'error' | 'none'; 4 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | require('babel-core/register'); 2 | require('./config/ignoreAssets'); 3 | var app = require('./build/src/server/index.jsx'); 4 | -------------------------------------------------------------------------------- /src/client/shared/constants.ts: -------------------------------------------------------------------------------- 1 | export type DEFAULT_ACTION_TYPE = ''; 2 | export const DEFAULT_ACTION_TYPE: DEFAULT_ACTION_TYPE = ''; 3 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## 1.0.1 4 | - Add jest snapshot / enzyme testing 5 | - Introduce changelog, contributing.md and roadmap.md -------------------------------------------------------------------------------- /cms/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /config/generators/component/import.ts.hbs: -------------------------------------------------------------------------------- 1 | $1 2 | import {{ properCase name }} from '{{ getPath path 'components' }}{{ properCase name }}'; 3 | -------------------------------------------------------------------------------- /config/generators/container/import.js.hbs: -------------------------------------------------------------------------------- 1 | $1 2 | import {{ properCase name }} from '{{ getPath path 'features' }}{{ properCase name }}'; 3 | -------------------------------------------------------------------------------- /config/generators/container/types.import.ts.hbs: -------------------------------------------------------------------------------- 1 | $1 2 | import * as {{ properCase name }}Types from './features/{{ properCase name }}/types'; -------------------------------------------------------------------------------- /packages/ui/src/WithAnimation/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | 3 | export type AnimationType = 'fadeIn' | 'fadeInUp' | 'fadeUp'; 4 | -------------------------------------------------------------------------------- /src/client/features/NavigationMenu/li.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | 3 | export default styled.li` 4 | display: block; 5 | `; 6 | -------------------------------------------------------------------------------- /cms/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /packages/ui/src/SvgIcon/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | export interface SvgProps extends React.SVGProps { 3 | viewBox?: string; 4 | } 5 | -------------------------------------------------------------------------------- /cms/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /cms/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /cms/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /cms/config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /packages/ui/src/Button/maps.ts: -------------------------------------------------------------------------------- 1 | export const sizeMap = { 2 | xsmall: 10, 3 | small: 12, 4 | medium: 16, 5 | large: 20, 6 | xlarge: 24, 7 | }; 8 | -------------------------------------------------------------------------------- /cms/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /src/client/features/Layout/constants.ts: -------------------------------------------------------------------------------- 1 | export type SET_MOBILE_TYPE = 'LAYOUT/SET_MOBILE'; 2 | export const SET_MOBILE: SET_MOBILE_TYPE = 'LAYOUT/SET_MOBILE'; 3 | -------------------------------------------------------------------------------- /packages/ui/src/Article/__tests__/__mocks__/articleMocks.mock.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | pad: 'medium', 3 | size: 'large', 4 | backgroundColor: '#f5f5f5', 5 | }; 6 | -------------------------------------------------------------------------------- /packages/ui/src/Button/types.ts: -------------------------------------------------------------------------------- 1 | import { Props } from './'; 2 | 3 | export { Props }; 4 | export type Size = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'; 5 | -------------------------------------------------------------------------------- /packages/ui/src/Section/__tests__/__mocks__/sectionMocks.mock.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | pad: 'medium', 3 | size: 'large', 4 | backgroundColor: '#f5f5f5', 5 | }; 6 | -------------------------------------------------------------------------------- /src/client/components/Menu/styles.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | 3 | export default styled.div` 4 | height: 100px; 5 | width: 200px; 6 | `; 7 | -------------------------------------------------------------------------------- /cms/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/generators/component/styles.ts.hbs: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | 3 | export default styled.div` 4 | height: 100px; 5 | width: 200px; 6 | `; 7 | -------------------------------------------------------------------------------- /packages/ui/src/Markdown/styles.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | 3 | export default styled.div` 4 | box-sizing: border-box; 5 | display: block; 6 | `; 7 | -------------------------------------------------------------------------------- /src/client/features/Clients/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './'; 2 | 3 | export interface Client { 4 | image: string; 5 | name: string; 6 | url: string; 7 | } 8 | -------------------------------------------------------------------------------- /src/client/features/Layout/main.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | import styles from './styles'; 3 | 4 | export default styled.main` 5 | ${styles} 6 | `; 7 | -------------------------------------------------------------------------------- /cms/test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /packages/ui/src/Avatar/default.ts: -------------------------------------------------------------------------------- 1 | // tslint:disable 2 | export default 'https://cloud.githubusercontent.com/assets/13810084/23538009/f9e348ae-ff9d-11e6-9f7a-485e8247a026.png'; -------------------------------------------------------------------------------- /src/server/graph/queries/client/index.ts: -------------------------------------------------------------------------------- 1 | import client from './client'; 2 | import clients from './clients'; 3 | 4 | export default { 5 | client, 6 | clients, 7 | }; 8 | -------------------------------------------------------------------------------- /src/server/graph/queries/index.ts: -------------------------------------------------------------------------------- 1 | import projects from './project'; 2 | import clients from './client'; 3 | 4 | export default { 5 | ...projects, 6 | ...clients, 7 | }; 8 | -------------------------------------------------------------------------------- /cms/test/models/project_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ProjectTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /src/client/features/Layout/div.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | import { divStyles } from './styles'; 3 | 4 | export default styled.main` 5 | ${divStyles} 6 | `; 7 | -------------------------------------------------------------------------------- /src/server/db/models/index.ts: -------------------------------------------------------------------------------- 1 | import ClientModel from './client'; 2 | import ProjectModel from './project'; 3 | 4 | export default { 5 | ClientModel, 6 | ProjectModel, 7 | }; 8 | -------------------------------------------------------------------------------- /src/server/graph/queries/project/index.ts: -------------------------------------------------------------------------------- 1 | import project from './project'; 2 | import projects from './projects'; 3 | 4 | export default { 5 | project, 6 | projects, 7 | }; 8 | -------------------------------------------------------------------------------- /config/generators/container/state.import.js.hbs: -------------------------------------------------------------------------------- 1 | $1 2 | import { initialState as {{ camelCase name }}State, State as {{ properCase name }}State } from 'features/{{ properCase name }}/state'; -------------------------------------------------------------------------------- /packages/ui/src/Avatar/__tests__/__mocks__/avatarMocks.mock.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | src: 'https://avatars3.githubusercontent.com/u/19292575', 3 | name: 'Abhishek Ghosh', 4 | }; 5 | -------------------------------------------------------------------------------- /src/client/features/Home/wrapper.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | import wrapperStyles from './styles'; 3 | 4 | export default styled.div` 5 | ${wrapperStyles} 6 | `; 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "6.9.5" 4 | script: npm run test 5 | notifications: 6 | slack: scalable-react:HPFuyoipfw9RROPGrZrczz1m 7 | email: 8 | on_failure: always -------------------------------------------------------------------------------- /config/.storybook/addons.js: -------------------------------------------------------------------------------- 1 | // To get default addons (actions and links) 2 | import '@kadira/storybook/addons'; 3 | // To add the knobs addon 4 | import '@kadira/storybook-addon-knobs/register' 5 | -------------------------------------------------------------------------------- /src/client/features/Home/styles.ts: -------------------------------------------------------------------------------- 1 | import { css } from 'styled-components'; 2 | 3 | export default css` 4 | margin-top: -100px; 5 | padding-top: 100px; 6 | background-color: #03A9F4; 7 | `; 8 | -------------------------------------------------------------------------------- /src/client/features/NavigationMenu/ul.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | 3 | export default styled.ul` 4 | display: inline-block; 5 | line-height: 1; 6 | list-style: none; 7 | `; 8 | -------------------------------------------------------------------------------- /packages/ui/src/Button/__tests__/__mocks__/buttonMocks.mock.ts: -------------------------------------------------------------------------------- 1 | export const buttonProps = { 2 | color: 'blue', 3 | backgroundColor: '#ffffff', 4 | borderColor: '#000000', 5 | size: 300, 6 | }; 7 | -------------------------------------------------------------------------------- /src/client/components/Burger/button.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | 3 | export default styled.button` 4 | padding: 20px; 5 | background-color: transparent; 6 | border: none; 7 | `; 8 | -------------------------------------------------------------------------------- /src/client/components/Burger/span.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | 3 | export default styled.span` 4 | height: 18px; 5 | width: 24px; 6 | fill: #666; 7 | cursor: pointer; 8 | `; 9 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | # Environment variables for database connection. 2 | DB="the-agency-db" 3 | PORT=1338 4 | DEBUG=false 5 | API_URL="http://localhost:3000/graphql" 6 | MONGODB_URI="mongodb://localhost:27017/the-agency-db" 7 | -------------------------------------------------------------------------------- /cms/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /src/client/features/Clients/clientBox.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | import { Box } from 'ui'; 3 | import styles from './styles'; 4 | 5 | export default styled(Box)` 6 | ${styles} 7 | `; 8 | -------------------------------------------------------------------------------- /packages/ui/src/Section/styles.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | 3 | import { 4 | BoxStyles, 5 | } from '../Box/styles'; 6 | 7 | export default styled.section` 8 | ${BoxStyles} 9 | `; 10 | -------------------------------------------------------------------------------- /src/client/features/Clients/styles.ts: -------------------------------------------------------------------------------- 1 | import { css } from 'styled-components'; 2 | 3 | export default css` 4 | max-width: 50%; 5 | @media screen and (max-width: 720px) { 6 | max-width: 100%; 7 | } 8 | `; 9 | -------------------------------------------------------------------------------- /src/client/features/Layout/__tests__/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Layout Container should render with default props 1`] = ``; 4 | -------------------------------------------------------------------------------- /src/client/features/Clients/clients.graphql.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag'; 2 | 3 | export default gql` 4 | query Clients { 5 | clients { 6 | name 7 | url 8 | image 9 | } 10 | } 11 | `; 12 | -------------------------------------------------------------------------------- /src/client/shared/actionCreators.ts: -------------------------------------------------------------------------------- 1 | import { DefaultAction } from './actions'; 2 | import * as types from './constants'; 3 | 4 | export const defaultAction = (): DefaultAction => ({ 5 | type: types.DEFAULT_ACTION_TYPE, 6 | }); 7 | -------------------------------------------------------------------------------- /cms/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | channel_prefix: rails-graphql-api_production 11 | -------------------------------------------------------------------------------- /cms/test/fixtures/projects.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | content: 5 | title: MyString 6 | 7 | two: 8 | content: 9 | title: MyString 10 | -------------------------------------------------------------------------------- /src/client/features/Layout/__tests__/__snapshots__/div.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Layout Div component should create a snapshot 1`] = ` 4 |
7 | `; 8 | -------------------------------------------------------------------------------- /src/client/features/Layout/__tests__/__snapshots__/main.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Layout Main component should create a snapshot 1`] = ` 4 |
7 | `; 8 | -------------------------------------------------------------------------------- /cms/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | devise_for :users 3 | mount GraphiQL::Rails::Engine, at: '/graphiql', graphql_path: '/graphql' 4 | 5 | root to: redirect('/graphiql') 6 | resources :graphql 7 | 8 | end 9 | -------------------------------------------------------------------------------- /src/client/features/Home/__tests__/__snapshots__/wrapper.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Home Wrapper component should create a snapshot 1`] = ` 4 |
7 | `; 8 | -------------------------------------------------------------------------------- /src/client/features/NavigationMenu/constants.ts: -------------------------------------------------------------------------------- 1 | export type TOGGLE_MENU_TYPE = 'NAVIGATIONMENU/TOGGLE_MENU'; 2 | export const TOGGLE_MENU: TOGGLE_MENU_TYPE = 'NAVIGATIONMENU/TOGGLE_MENU'; 3 | 4 | export type ActionType = TOGGLE_MENU_TYPE; 5 | -------------------------------------------------------------------------------- /src/client/features/Portfolio/projects.graphql.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag'; 2 | 3 | export default gql` 4 | query Projects { 5 | projects { 6 | id: _id 7 | title 8 | image 9 | } 10 | } 11 | `; 12 | -------------------------------------------------------------------------------- /cms/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /packages/ui/src/Footer/styles.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | 3 | export const FooterComponent = styled.footer` 4 | background: ${(props) => props.color}; 5 | height: auto; 6 | min-height: 100px; 7 | width: 100%; 8 | `; 9 | -------------------------------------------------------------------------------- /packages/ui/src/utils/remStringFromPx.ts: -------------------------------------------------------------------------------- 1 | type Px = number; 2 | type Rem = number; 3 | 4 | const rootRem: number = 16; 5 | const calculateRem = (px: Px): Rem => (px / rootRem); 6 | export default (px: Px): string => `${calculateRem(px)}rem`; 7 | -------------------------------------------------------------------------------- /cms/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /cms/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /src/client/components/CaseStudy/relative.ts: -------------------------------------------------------------------------------- 1 | import styled, { css } from 'styled-components'; 2 | 3 | function styles() { 4 | return css` 5 | position: relative; 6 | `; 7 | } 8 | 9 | export default styled.div` 10 | ${styles()} 11 | `; 12 | -------------------------------------------------------------------------------- /cms/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /cms/db/migrate/20170809224732_add_fields_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddFieldsToUser < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :users, :bio, :string 4 | add_column :users, :name, :string 5 | add_column :users, :role, :integer 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /src/client/components/PageIntro/hr.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | import styles from './styles'; 3 | 4 | export interface Props { 5 | color: string; 6 | } 7 | 8 | export default styled.div` 9 | ${(props: Props) => styles(props)} 10 | `; 11 | -------------------------------------------------------------------------------- /config/types/require.d.ts: -------------------------------------------------------------------------------- 1 | declare var require: { 2 | (path: string): any; 3 | (path: string): T; 4 | (paths: string[], callback: (...modules: any[]) => void): void; 5 | ensure: (paths: string[], callback: (require: (path: string) => T) => void) => void; 6 | }; 7 | -------------------------------------------------------------------------------- /src/client/features/Layout/state.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface State { 3 | isMobile: boolean; 4 | brandText: string; 5 | }; 6 | 7 | export const initialState: State = { 8 | isMobile: false, 9 | brandText: 'The Agency', 10 | }; 11 | 12 | export default State; 13 | -------------------------------------------------------------------------------- /src/client/features/NavigationMenu/actions.ts: -------------------------------------------------------------------------------- 1 | import { Action } from 'redux'; 2 | import { TOGGLE_MENU_TYPE } from './constants'; 3 | 4 | export interface ToggleMenuAction extends Action { 5 | type: TOGGLE_MENU_TYPE; 6 | }; 7 | 8 | export type Action = ToggleMenuAction; 9 | -------------------------------------------------------------------------------- /src/client/features/Project/project.graphql.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag'; 2 | 3 | export default gql` 4 | query Project($id: ID!) { 5 | project(id: $id) { 6 | id: _id 7 | title 8 | image 9 | content 10 | } 11 | } 12 | `; 13 | -------------------------------------------------------------------------------- /cms/db/migrate/20170810223903_create_projects.rb: -------------------------------------------------------------------------------- 1 | class CreateProjects < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :projects do |t| 4 | t.jsonb :content 5 | t.string :title 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /packages/ui/src/Headline/types.ts: -------------------------------------------------------------------------------- 1 | export { Props } from './index'; 2 | export { SizeMap, HeadlineSize } from './styleUtils'; 3 | 4 | export type TextAligment = 'center' | 'left' | 'right' | 'justify'; 5 | export type FontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800; 6 | -------------------------------------------------------------------------------- /packages/ui/src/Notification/__tests__/__mocks__/notificationMocks.mock.ts: -------------------------------------------------------------------------------- 1 | export const NotificationPropsRequired = { 2 | message: 'Mock error message', 3 | }; 4 | 5 | export const NotificationPropsOther = { 6 | message: 'Mock error message', 7 | onClick: jest.fn(), 8 | }; 9 | -------------------------------------------------------------------------------- /config/generators/utils/safeString.js: -------------------------------------------------------------------------------- 1 | function SafeString(string) { 2 | this.string = string; 3 | } 4 | 5 | SafeString.prototype.toString = SafeString.prototype.toHTML = function() { 6 | return '' + this.string; 7 | }; 8 | 9 | module.exports = { 10 | SafeString 11 | }; 12 | -------------------------------------------------------------------------------- /packages/ui/src/Article/styles.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | import { 3 | BoxStyles, 4 | } from '../Box/styles'; 5 | 6 | export default styled.article` 7 | ${BoxStyles} 8 | box-shadow: 0 2px 4px 0 rgba(46, 61, 73, 0.2); 9 | border: 1px solid #dbe2e8; 10 | `; 11 | -------------------------------------------------------------------------------- /src/client/components/CaseStudy/__tests__/__mocks__/caseStudy.mock.js: -------------------------------------------------------------------------------- 1 | export default { 2 | "id": "58f43041f445ed0e26cd46e6", 3 | "title": "HPE Brand Central", 4 | "image": "https://github.com/RyanCCollins/cdn/blob/master/brand-central/bcmockup.jpg?raw=true", 5 | "__typename": "Project" 6 | } -------------------------------------------------------------------------------- /src/client/features/Home/sectionIsVisible.ts: -------------------------------------------------------------------------------- 1 | 2 | export default function sectionIsVisible(id: string): boolean { 3 | const windowHeight = window ? window.innerHeight : 1000; 4 | const node = document.getElementById(id); 5 | return node.getBoundingClientRect().top < windowHeight / 3; 6 | } 7 | -------------------------------------------------------------------------------- /cms/app/graph/types/json_type.rb: -------------------------------------------------------------------------------- 1 | JsonType = GraphQL::ScalarType.define do 2 | name 'JSON' 3 | description 'JSON Scalar Type, representing the Postgres jsonb data type. Useful for representing hierarchical data.' 4 | coerce_input -> (x, _) { JSON.parse(x) } 5 | coerce_result -> (x, _) { JSON.dump(x) } 6 | end 7 | -------------------------------------------------------------------------------- /cms/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /config/generators/container/styles.js.hbs: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | 3 | export const Section = styled.section` 4 | padding: 60px; 5 | background-color: #f5f5f5; 6 | min-height: calc(100vh - 50px); 7 | `; 8 | 9 | export const Heading = styled.h1` 10 | text-align: center; 11 | `; 12 | -------------------------------------------------------------------------------- /src/client/features/Clients/withGraphql.ts: -------------------------------------------------------------------------------- 1 | import { graphql } from 'react-apollo'; 2 | import CLIENTS_QUERY from './clients.graphql'; 3 | 4 | export default graphql(CLIENTS_QUERY, { 5 | props: ({ data: { loading, clients, error } }) => ({ 6 | loading, 7 | clients, 8 | error, 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /packages/ui/src/Heading/styleUtils.ts: -------------------------------------------------------------------------------- 1 | import { Tag } from './index'; 2 | import remStringFromPX from '../utils'; 3 | 4 | const sizeMap = { 5 | h1: 36, 6 | h2: 30, 7 | h3: 24, 8 | h4: 18, 9 | h5: 16, 10 | }; 11 | 12 | export const calculateSize = (tag: Tag): string => remStringFromPX(sizeMap[tag]); 13 | -------------------------------------------------------------------------------- /src/client/shared/actions.ts: -------------------------------------------------------------------------------- 1 | import { Action } from 'redux'; 2 | import * as types from './constants'; 3 | 4 | export interface DefaultAction extends Action { 5 | type: types.DEFAULT_ACTION_TYPE 6 | } 7 | 8 | export interface PayloadAction

extends Action { 9 | type: string; 10 | payload?: P; 11 | } 12 | -------------------------------------------------------------------------------- /cms/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/client/features/Contact/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import Presentation from './presentation'; 3 | 4 | class Contact extends React.Component { 5 | public render() { 6 | return ( 7 | 8 | ); 9 | } 10 | } 11 | 12 | export default Contact; 13 | -------------------------------------------------------------------------------- /src/client/features/Portfolio/withGraphql.ts: -------------------------------------------------------------------------------- 1 | import { graphql } from 'react-apollo'; 2 | import PROJECTS_QUERY from './projects.graphql'; 3 | 4 | export default graphql(PROJECTS_QUERY, { 5 | props: ({ data: { loading, projects, error } }) => ({ 6 | loading, 7 | projects, 8 | error, 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/server/graph/types/index.ts: -------------------------------------------------------------------------------- 1 | import projectType from './project'; 2 | import clientType from './client'; 3 | import contactType from './contact'; 4 | import contactInputType from './contact-input'; 5 | 6 | export default { 7 | projectType, 8 | clientType, 9 | contactType, 10 | contactInputType, 11 | }; 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # The Agency 3 | 4 | __NOTICE__: This is a work in progress 5 | 6 | ![The Agency](https://github.com/RyanCCollins/cdn/blob/master/misc/the-agency.png?raw=true) 7 | 8 | # Documentation 9 | See [Scalable React TypeScript Boilerplate](https://github.com/scalable-react/scalable-react-typescript-boilerplate). 10 | -------------------------------------------------------------------------------- /packages/ui/src/Anchor/__tests__/__mocks__/anchorMocks.mock.ts: -------------------------------------------------------------------------------- 1 | export const hrefProps = { 2 | href: 'https://github.com/RyanCCollins/scalable-react-ts-boilerplate', 3 | label: 'Scalable React', 4 | color: '#fff', 5 | }; 6 | 7 | export default { 8 | path: '/docs', 9 | label: 'Docs', 10 | color: '#fff', 11 | }; 12 | -------------------------------------------------------------------------------- /src/server/db/models/client.ts: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | const ClientSchema = new mongoose.Schema({ 4 | name: { 5 | type: String, 6 | }, 7 | image: { 8 | type: String, 9 | }, 10 | url: { 11 | type: String, 12 | }, 13 | }); 14 | 15 | export default mongoose.model('Client', ClientSchema); 16 | -------------------------------------------------------------------------------- /cms/app/graph/types/project_type.rb: -------------------------------------------------------------------------------- 1 | ProjectType = GraphQL::ObjectType.define do 2 | name 'Project' 3 | description 'A project / case study' 4 | field :id, !types.ID, 'The id of the project' 5 | field :title, !types.String, 'The title of the project' 6 | field :content, types[JsonType], 'The content of the project, array of JSON' 7 | end -------------------------------------------------------------------------------- /cms/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../../config/environment', __FILE__) 2 | require 'rails/test_help' 3 | 4 | class ActiveSupport::TestCase 5 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 6 | fixtures :all 7 | 8 | # Add more helper methods to be used by all tests here... 9 | end 10 | -------------------------------------------------------------------------------- /config/generators/utils/index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | const trimTemplateFile = (template) => { 4 | // Loads the template file and trims the whitespace and then returns the content as a string. 5 | return fs.readFileSync(template, 'utf8').replace(/\s*$/, ''); 6 | }; 7 | 8 | module.exports = { 9 | trimTemplateFile 10 | }; 11 | -------------------------------------------------------------------------------- /src/client/features/Layout/styles.ts: -------------------------------------------------------------------------------- 1 | import { css } from 'styled-components'; 2 | 3 | export const divStyles = css` 4 | flex-grow: 1; 5 | `; 6 | 7 | export default css` 8 | margin-top: 0; 9 | padding-top: 100px; 10 | flex-direction: column; 11 | min-height: 100vh; 12 | display: flex; 13 | background-color: #f5f5f5; 14 | `; 15 | -------------------------------------------------------------------------------- /src/client/features/NavigationMenu/actionCreators.ts: -------------------------------------------------------------------------------- 1 | import * as T from './constants'; 2 | import { ToggleMenuAction } from './actions'; 3 | 4 | export const toggleMenu = (): ToggleMenuAction => ({ 5 | type: T.TOGGLE_MENU, 6 | }); 7 | 8 | export const actionCreators = { 9 | toggleMenu, 10 | }; 11 | 12 | export default actionCreators; 13 | -------------------------------------------------------------------------------- /src/server/db/models/contact.ts: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | const ContactSchema = new mongoose.Schema({ 4 | email: { 5 | type: String, 6 | required: true, 7 | index: { unique: false }, 8 | }, 9 | name: String, 10 | message: String, 11 | }); 12 | 13 | export default mongoose.model('Contact', ContactSchema); 14 | -------------------------------------------------------------------------------- /config/generators/container/state.js.hbs: -------------------------------------------------------------------------------- 1 | import { ErrorType } from './types'; 2 | 3 | export interface State { 4 | isLoading: boolean; 5 | error?: ErrorType; 6 | data?: string; 7 | } 8 | 9 | export const initialState: State = { 10 | isLoading: false, 11 | error: null, 12 | data: null, 13 | }; 14 | 15 | export default initialState; 16 | -------------------------------------------------------------------------------- /packages/ui/src/Box/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import Component from './styles'; 3 | import Props from './types'; 4 | 5 | export default function Box({ 6 | children, 7 | ...rest, 8 | }: Props): JSX.Element { 9 | return ( 10 | 11 | {children || null} 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/server/graph/types/contact.ts: -------------------------------------------------------------------------------- 1 | 2 | import { 3 | GraphQLObjectType, 4 | GraphQLString, 5 | } from 'graphql'; 6 | 7 | export default new GraphQLObjectType({ 8 | name: 'Contact', 9 | fields: () => ({ 10 | email: { type: GraphQLString }, 11 | name: { type: GraphQLString }, 12 | message: { type: GraphQLString }, 13 | }), 14 | }); 15 | -------------------------------------------------------------------------------- /packages/ui/src/Section/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import Component from './styles'; 3 | import BoxProps from '../Box/types'; 4 | 5 | export default function Section({ 6 | children, 7 | ...rest, 8 | }: BoxProps): JSX.Element { 9 | return ( 10 | 11 | {children} 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /cms/app/graph/types/user_type.rb: -------------------------------------------------------------------------------- 1 | UserType = GraphQL::ObjectType.define do 2 | name 'User' 3 | description 'The application, non auth user type' 4 | field :id, !types.ID, 'The id of the user' 5 | field :name, !types.String, 'The name of the user' 6 | field :bio, types.String, 'The bio of the user' 7 | field :avatar, types.String, 'The avatar url of the user' 8 | end -------------------------------------------------------------------------------- /src/client/features/Layout/actions.ts: -------------------------------------------------------------------------------- 1 | import { DefaultAction } from 'shared/actions'; 2 | import * as types from './constants'; 3 | import { Action } from 'redux'; 4 | 5 | export interface SetIsMobileAction extends Action { 6 | type: types.SET_MOBILE_TYPE, 7 | isMobile: boolean 8 | } 9 | 10 | export type Action = 11 | SetIsMobileAction | 12 | DefaultAction; 13 | -------------------------------------------------------------------------------- /src/server/graph/types/contact-input.ts: -------------------------------------------------------------------------------- 1 | import { 2 | GraphQLInputObjectType, 3 | GraphQLString, 4 | } from 'graphql'; 5 | 6 | export default new GraphQLInputObjectType({ 7 | name: 'ContactInput', 8 | fields: () => ({ 9 | email: { type: GraphQLString }, 10 | name: { type: GraphQLString }, 11 | message: { type: GraphQLString }, 12 | }), 13 | }); 14 | -------------------------------------------------------------------------------- /packages/ui/src/Avatar/index.tsx: -------------------------------------------------------------------------------- 1 | import { AvatarStyle } from './styles'; 2 | import styled from 'styled-components'; 3 | 4 | export type ImageSize = 'thumb' | 'small' | 'medium' | 'large'; 5 | export interface Props { 6 | src: string; 7 | name?: string; 8 | size?: ImageSize; 9 | } 10 | 11 | const Avatar = styled.div` 12 | ${AvatarStyle} 13 | `; 14 | 15 | export default Avatar; 16 | -------------------------------------------------------------------------------- /src/server/graph/queries/client/clients.ts: -------------------------------------------------------------------------------- 1 | import { 2 | GraphQLList, 3 | } from 'graphql'; 4 | 5 | import types from '../../types'; 6 | import ClientModel from '../../../db/models/client'; 7 | 8 | export default { 9 | type: new GraphQLList(types.clientType), 10 | args: {}, 11 | resolve() { 12 | return ClientModel 13 | .find() 14 | .exec(); 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /src/client/components/Menu/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import Component from './styles'; 3 | 4 | export interface Props extends React.HTMLProps { 5 | children: JSX.Element; 6 | } 7 | export default function Menu({ 8 | children, 9 | }: Props): JSX.Element { 10 | return ( 11 | 12 | {children} 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/server/graph/queries/project/projects.ts: -------------------------------------------------------------------------------- 1 | import { 2 | GraphQLList, 3 | } from 'graphql'; 4 | 5 | import types from '../../types'; 6 | import ProjectModel from '../../../db/models/project'; 7 | 8 | export default { 9 | type: new GraphQLList(types.projectType), 10 | args: {}, 11 | resolve() { 12 | return ProjectModel 13 | .find() 14 | .exec(); 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /src/server/graph/types/client.ts: -------------------------------------------------------------------------------- 1 | import { 2 | GraphQLObjectType, 3 | GraphQLString, 4 | GraphQLID, 5 | } from 'graphql'; 6 | 7 | export default new GraphQLObjectType({ 8 | name: 'Client', 9 | fields: () => ({ 10 | _id: { type: GraphQLID }, 11 | name: { type: GraphQLString }, 12 | image: { type: GraphQLString }, 13 | url: { type: GraphQLString }, 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/client/components/PageIntro/styles.ts: -------------------------------------------------------------------------------- 1 | import { css } from 'styled-components'; 2 | import { Props } from './hr'; 3 | 4 | export default function styles({ color }: Props) { 5 | return css` 6 | background-color: ${color}; 7 | width: 100px; 8 | height: 3px; 9 | display: block; 10 | margin: 35px 0; 11 | margin-right: auto; 12 | margin-left: auto; 13 | `; 14 | } 15 | -------------------------------------------------------------------------------- /packages/ui/src/Box/__tests__/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[` should render with default props 1`] = ` 4 | 5 |

6 | 7 | `; 8 | 9 | exports[` should render with different props 1`] = ` 10 | 14 |
15 | 16 | `; 17 | -------------------------------------------------------------------------------- /src/server/graph/types/project.ts: -------------------------------------------------------------------------------- 1 | import { 2 | GraphQLObjectType, 3 | GraphQLString, 4 | GraphQLID, 5 | } from 'graphql'; 6 | 7 | export default new GraphQLObjectType({ 8 | name: 'Project', 9 | fields: () => ({ 10 | _id: { type: GraphQLID }, 11 | title: { type: GraphQLString }, 12 | content: { type: GraphQLString }, 13 | image: { type: GraphQLString }, 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /cms/test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /src/client/features/NavigationMenu/__tests__/actionCreators.test.ts: -------------------------------------------------------------------------------- 1 | import * as T from '../constants'; 2 | import * as ActionCreators from '../actionCreators'; 3 | 4 | describe('NavigationMenu ActionCreators', () => { 5 | it('should have a type of TOGGLE_MENU', () => { 6 | const expected = { 7 | type: T.TOGGLE_MENU, 8 | }; 9 | expect(ActionCreators.toggleMenu()).toEqual(expected); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /config/generators/component/stateless.tsx.hbs: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import Component from './styles'; 3 | 4 | export interface Props extends React.HTMLProps { 5 | children: JSX.Element; 6 | } 7 | export default function {{ properCase name }}({ 8 | children, 9 | }: Props): JSX.Element { 10 | return ( 11 | 12 | {children} 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/server/db/utils/uuid.ts: -------------------------------------------------------------------------------- 1 | // tslint:disable 2 | export default function uuid() { 3 | var i; 4 | var random; 5 | var uuid = ''; 6 | for (i = 0; i < 32; i++) { 7 | random = Math.random() * 16 | 0; 8 | if (i === 8 || i === 12 || i === 16 || i === 20) { 9 | uuid += '-'; 10 | } 11 | 12 | uuid += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16); 13 | } 14 | 15 | return uuid; 16 | } -------------------------------------------------------------------------------- /config/.storybook/config.js: -------------------------------------------------------------------------------- 1 | import { configure, setAddon } from '@kadira/storybook'; 2 | import infoAddon from '@kadira/react-storybook-addon-info'; 3 | import withPropsCombinations, { setDefaults } from 'react-storybook-addon-props-combinations' 4 | 5 | setAddon(withPropsCombinations) 6 | 7 | setAddon(infoAddon); 8 | 9 | function loadStories() { 10 | require('./stories/index.js'); 11 | } 12 | 13 | configure(loadStories, module); 14 | -------------------------------------------------------------------------------- /packages/ui/src/Box/maps.ts: -------------------------------------------------------------------------------- 1 | export const SIZE_MAP = { 2 | none: 0, 3 | small: 12, 4 | medium: 24, 5 | large: 48, 6 | xlarge: 96, 7 | }; 8 | 9 | export const BOX_SIZE_MAP = { 10 | xxsmall: 48, 11 | xsmall: 96, 12 | small: 192, 13 | medium: 384, 14 | large: 576, 15 | xlarge: 720, 16 | xxlarge: 960, 17 | }; 18 | 19 | export const BREAKPOINTS = { 20 | phone: 480, 21 | tablet: 768, 22 | desktop: 1024, 23 | }; 24 | -------------------------------------------------------------------------------- /packages/ui/src/Footer/__tests__/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`