Skip to content

Added gulpfile & npm integration and changed project structure to sim… #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
node_modules
bower_components
sftp-config.json
_build
npm-debug.log
.idea
style.css
style.min.css
80 changes: 69 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,71 @@
Headless Drupal + AngularJS
=======================

# Headless Drupal + AngularJS
A working "Headless Drupal" example implementation - an AngularJS app set up to talk to Drupal 8 vis the rest.module.

# Features
* SASS support including sourceMaps
* Minimal CSS styling of the view
* Gulp watch, build and local server tasks
* Responsive navigation
* Owl slider directive
* localStorage service for set, get, remove data
* queryService $http wrapper to handle calls
* Clear folder structure
* Less than 10 request in build version
* Minified CSS and JS build files
* Google analytics snippet
* Interaction with your Drupal 8 back-end

## Download

```bash
git clone https://github.com/joshkoenig/headless-drupal-angular.git
```

## 1. Setup
```bash
npm install
```
- install all npm and bower dependencies

**Note:** If `npm install` fails during dependency installation it will be likely caused by `gulp-imagemin`. In that case remove `gulp-imagemin` dependency from `package.json`, run `npm install` again and then install `gulp-imagemin` separately with following command: `npm install gulp-imagemin --save-dev`

## 2. Watch files
```bash
gulp
```
- all SCSS/HTML will be watched for changes and injected into browser thanks to BrowserSync

## 3. Build production version
```bash
gulp build
```
- this will process following tasks:
* clean _build folder
* compile SASS files, minify and uncss compiled css
* copy and optimize images
* minify and copy all HTML files into $templateCache
* build index.html
* minify and copy all JS files
* copy fonts
* show build folder size

## 4. Start webserver without watch task
```bash
gulp server
```

## 5. Start webserver from build folder
```bash
gulp server-build
```

## See a demonstration online:
### http://dev-headless-drupal-8.gotpantheon.com/

This is a quick and dirty demo, intended as a starting place for discussion, and to help others get hacking quickly. There's a _lot_ of work TODO.

Pull requests are welcome.

## Quickstart

1. Clone this repo, run ```bower install``` and the
2. Visit app/index.html

You are now seeing content pulled from the Drupal 8 instance backing the demo site that I have running on Pantheon. Feel free to start experimenting with your own Angular implementation. Or start a demo with another framework!

## Running it w/your own Drupal Install

Going beyond the most basic demo, you will likely want to customize the back-end a little bit as well. Getting your own up and running is pretty simple:
Expand All @@ -30,9 +79,18 @@ Going beyond the most basic demo, you will likely want to customize the back-end


## TODO:

- Expand this Readme.md to explain how it works.
- Fixing whatever I've done n00bishly in Angular
- Better packaging/documentation of how to configure Drupal.
- Extend DEMO to include CRUD for nodes.
- Add custom routes to the demo.

## Changelog
### 1.0.1
- added gulpfile to simplify build process
- added npm integration
- changed project structure to make stuff easier
- updated the README with the updated changes

### 1.0.0
- Initial release
File renamed without changes.
File renamed without changes.
18 changes: 0 additions & 18 deletions app/bower_components/angular-loader/.bower.json

This file was deleted.

48 changes: 0 additions & 48 deletions app/bower_components/angular-loader/README.md

This file was deleted.

Loading