Skip to content

Instantly share code, notes, and snippets.

@jschr
Last active April 13, 2017 00:38
Show Gist options
  • Save jschr/49fae4688e28c62320fdf5c4d9eb65c6 to your computer and use it in GitHub Desktop.
Save jschr/49fae4688e28c62320fdf5c4d9eb65c6 to your computer and use it in GitHub Desktop.
Project structure for https://github.com/jschr/jschr.io
/app # contains the code for the website generator and our react components (written in Typescript)
/assets # image assets
/components # React components
App.tsx # the top-level React component for our app
Template.tsx # defines the html template for server-side rendering (injects the pre-rendered App html, css and js)
webpack.config.ts # our webpack config that is used for dev and in our handler
getProps.tsx # an async function for retrieving our app props (ie. fetches from Github, Twitter and Medium)
mount.tsx # function that mounts our app to the DOM
ssr.tsx # server-side rendering function, returns the initial html of our website
index.ts # our webpack entry file, mounts the app when in browser context and exports the ssr function for the static website generator
handler.ts # the lambda function to run the webpack build, upload to S3 and invalidate CloudFront
/infrastructure # our terraform files
/env-dev # the dev environment setup (you can easily create more environments thanks to terraform modules)
/modules # terraform modules
/app # our main app module that defines the required infrastructure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment