Git Product home page Git Product logo

mynatec's Introduction

Ruby on Rails / Create React App / ActiveAdmin stack

Credit to (this post's)[https://dev.to/heroku/a-rock-solid-modern-web-stackrails-5-api--activeadmin--create-react-app-on-heroku-jfm] author for the hard work in getting this all set up. Here I've just taken his hard work and made it in to a template for next time I want to create a project like this. Please feel free to take this, and check out his tutorial for a great write up on how to get this set up from scratch.

This version uses gem 'pg' for easy development/deployment to Heroku. I assume you're using yarn - you'll need to adjust my yarn commands to your preferred program if you're not.

Additionally, comes preinstalled with axios, redux, and react-router for just... ease of getting going.

Already set up for single page apps - will allow your SPA to handle 404 errors and, of course, allow people to save links inside your app.

Setup

  • Clone this repo
  • bundle
  • rake db:create
  • rake db:seed to create a default user
  • yarn --cwd client to install dependencies

Versions: Ruby version - 2.5.1 Rails version - 5.2.1

Running Development Servers

bin/rake start starts up a rails server and a create react app server and opens a browser. Should be ready to roll!

Very basics of ActiveAdmin

To get started with activeadmin, at the very basic end of the spectrum - you'll need to generate the ability for ActiveAdmin to mess with your stuff. Which is the whole point, right?

Tell active admin about a model: bin/rails generate active_admin:resource Modelname

Then, permit ActiveAdmin to modify your fields in app/admin/modelname.rb

ActiveAdmin.register Drink do
  permit_params :title, :description, :steps, :source
end

Hit http://localhost:3001/admin to access the ActiveAdmin side. Use [email protected] and the best password ever: password for development

Deployment

Create an app on heroku,:

heroku apps:create

heroku buildpacks:add heroku/nodejs --index 1
heroku buildpacks:add heroku/ruby --index 2

to include Java RTE if needed, 
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-jvm-common.git --index 3

git add .
git commit -vam "Initial commit"
git push heroku master

heroku run rake db:seed

mynatec's People

Contributors

jamesmskelsey avatar

Watchers

James Cloos 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.