Git Product home page Git Product logo

cryptoapp's Introduction

fullstack-react-boilerplate (tiny bones)

Starting point for Full Stack React-based Javascript Applications!

Features:

  • React
  • React-Redux
  • React-Router v4
  • Express Server
  • PostgreSQL Database w/ Sequelize ORM
  • Redux Dev Tools Extension
  • Webpack Bundling & SCSS Compiling Config
  • Babel ES6
  • Live Reloading & Building
  • Local Authorization and Google OAuth2

Instructions

  1. Clone this repo to your local machine https://github.com/Crizzooo/react-redux-express-boilerplate.git
  2. npm install
  3. rm -rf .git - To remove commit log from boilerplate
  4. git init - To initiate new git log
  5. npm run dev - To build and launch server
  6. Visit localhost:3000 to verify everything works!
  7. Make your own github repo and git remote add origin ${repoURL}
  8. Get to building the meat of your project without worrying about the boring stuff!
  9. Passport, Auth, and Postgres Databases are set up - but you'll have to uncomment the appropriate code in server/index.js, create your database, and supply a googleOAuthKey / secrets file to use them.

File Structure

.
+-- client
|   +-- src
|       +-- components
|           +-- sampleComponent.js         <-- React Component JS
|           +-- sampleComponentStyle.scss  <-- Modular SCSS Styles for components
|       +-- public
|           +-- dist          <-- Webpack output of bundle.js
|           +-- stylesheets   <-- holds our main scss file, others can be imported to components
|           +-- index.html
|       +-- reducers
|       +-- app.js            <-- Holds Routes for React Router v4
|       +-- index.js          <-- Initates React Rout and React-Router v4
|       +-- store.js          <-- React Redux Store
+-- server
|   +-- api                 <-- Folder for API Routes
|   +-- index.js            <-- Initates Express Server which serves index.html and static files

Database

Can't think of a database name? This boilerplate will pick a database name for you! It pulls it out of the package.json "name" property. You must create the database in order for things to work properly:

createdb your-app-name-here

Already have a database name? Just input it into an environment variable:

process.env.DATABASE_NAME = 'your-database-name-here';

Secrets.js

To use this boilerplate in development mode, you'll need a secrets.js file in your root directory. Be sure to make one before running npm run dev. This file is in .gitignore by default.

The secrets file should be used to set environment variables, ie:

// in secrets.js
process.env.GOOGLE_CLIENT_SECRET = 'yourGoogleSecret';

// in server/index.js - this is done for you
if (process.env.NODE_ENV === 'development') {
  require('../secrets.js')
}

Authorization

Local auth and Google OAuth2 have been set up in this boilerplate. There are separated into individual React components that you can simply place where you want in your app. See client/src/app.js.

Google OAuth2

To get Google OAuth2 working for your app, you must register it with Google API (https://console.developers.google.com). Google will provide you with a Client ID and secret which you must set as environment variables. You must also set the OAuth2 callback to match what is specified in your code. Right now, that callback is http://localhost:{PORT}/api/users/google/redirect.

Future Updates Pipeline

  1. Tests to check App Structure is working

cryptoapp's People

Contributors

crizzooo avatar mperitz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.