Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
/ ngRails Public archive

A Rails 5 / Angular 2 Starter Project (TypScript Version)

Notifications You must be signed in to change notification settings

R-V-S/ngRails

Repository files navigation

ngRails (TypeScript)

An easy starter project for a Rails 5 / Angular 2 build. This is the TypeScript version. There is also a JavaScript version. Features:

  • webpack serves assets.
  • TypeScript enables ES6/7 JavaScript language features and a robust typing system.
  • Sass makes styling smart, and smart styling easy.
  • Foreman runs webpack and Rails server concurrently with just one command.
  • Heroku deployment is a cinch.

Prerequisites

Installation

Fork or clone this repository

If you choose to clone, you can run this command to clone this repo into a new project folder (e.g. my-proj):

git clone https://github.com/R-V-S/ngRails.git my-proj
cd my-proj

Install the node modules for webpack and TypeScript

npm install

Install gems

bundle

Run

foreman start

Development

Angular

Angular's files are contained in app/client. No testing platform is installed. Consider Karma.

Templates and stylesheets should be required inline rather than using Angular's templateUrl or styleUrls.

Stylesheets for components must end in .component.css or .component.scss. This is because component stylesheets, which are included inline, must be run through Babel's raw loader.

Webpack

Webpack's configuration is in config/webpack.config.js

Rails

Rails is installed without Sprockets (-S) and without Minitest (-T). Rspec is installed as a testing platform.

Databases

By default, sqlite3 is configured to run locally and postgresql is configured for production.

Deployment

Deploying to Heroku is easy.

Install the Heroku CLI

Heroku CLI

Create a new Heroku app

heroku create

Configure buildpacks

heroku buildpacks:add --index 1 heroku/nodejs
heroku buildpacks:add --index 2 heroku/ruby
heroku buildpacks:add --index 3 https://github.com/febeling/webpack-rails-buildpack.git

Push your code / Deploy

git push heroku master

Open

heroku open

About

A Rails 5 / Angular 2 Starter Project (TypScript Version)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published