Contribute to the DSpace Development Fund

The newly established DSpace Development Fund supports the development of new features prioritized by DSpace Governance. For a list of planned features see the fund wiki page.

This page is for attendees of the OR2017 workshop "Getting Started with Angular UI Development for DSpace". It provides links to resources, workshop preparation, etc.

Tutorial Recording

A later version of this workshop/tutorial was recorded at the DSpace North American User Group meeting on Aug 23, 2017 at Georgetown University. This recording includes the beginning of the Workshop, but does not include the hands-on development section.  Slides from this updated video tutorial are available at: https://goo.gl/pWFacH 

Workshop Slides

The workshop slides are available at: https://goo.gl/o2mgGo

Additionally, there was a separate OR2017 talk which gave higher level updates on DSpace 7 efforts. Those DSpace 7 overview slides are also available at: https://goo.gl/Hrt4Ct

Preparing for "Hands-on" portion of workshop

For the hands-on portion of the workshop, we will be working directly with the dspace-angular project (this is the in-development Angular UI for DSpace 7).  However, don't worry. It's rather easy to install, and you do not need to install DSpace itself (as we have a public REST API we'll be using).

Requirements

If you wish to take part in the "hands-on" portion of our workshop, we recommend pre-installing the following on your laptop.  (If you forget, or run into issues, don't worry. Each of these should be rather quick to install at the workshop, internet connection permitting.)

  • Git :You'll want to have Git to simply clone and install our dspace-angular project (this is the in-development Angular UI for DSpace 7). If you don't have Git, you can choose to install either GitHub Desktop (which includes a GUI) or just plain Git. Any version of Git is fine.
  • Node.js (version 6.x recommended) : Required to build/run the Angular UI.
    • Note: Node.js will also automatically install npm (Node Package Manager). You shouldn't need to install that separately
    • Do not use node 8. If you want to install node 6 on a Mac with homebrew, use brew install node@6. If you already installed node8, and yarn, you have to uninstall yarn and node, and than try again with the node6 install. You may also need to do brew unlink and brew link to re-associate the node command with node 6. More details on this.
  • Yarn (version 0.20.x or above) : This is an easier to use, speedier package manager that works similar to npm (Node's package manager). It's currently required to build Angular UI.
  • dspace-angular: If you get excited, you can now install dspace-angular itself using the command line. However, if you don't get to this, we can walk you through it at the workshop.
    1. git clone https://github.com/DSpace/dspace-angular.git   (Pulls down the code into a dspace-angular folder on your local computer)
    2. cd dspace-angular (Move into the newly created dspace-angular folder)
    3. yarn run global     (Install all global dependencies via yarn)
    4. yarn install           (Install all local dependencies via yarn)
    5. yarn run watch:dev             (Build and startup the DSpace Angular UI)
    6. Assuming all went well, you should be able to go to http://localhost:3000 in your web browser and see the Angular UI homepage.  If something doesn't work, we can help you fix it at the workshop.

That's it! Again, there is no need to have DSpace running or install a database, Java, Tomcat or any of the other usual DSpace prerequisites.  During the workshop, we will point our Angular UIs at the same REST API and simply use that as our DSpace backend.

Development Tools

While not required, the following tools may make it easier to do basic development with the Angular UI.

  • Chrome web browser : When developing an Angular application, all web browsers are not created equal. While you obviously should use other browsers to help test your application, Chrome has built in debugging/visualization tools that come in handy when doing Angular development. Make sure you disable cache in your network tab and keep the inspect element open.
  • An IDE : If you wish to do much Angular development, you'll likely want an IDE (Integrated Development Environment) or an editor that understands the TypeScript language.  Here's a few we prefer. Just choose ONE.If you have no strong preference, you may want to start with Visual Studio Code.
    • Visual Studio Code (Free) : This is a TypeScript IDE from Microsoft (the makers of TypeScript). It's frequently used for Angular development, even by some of the main Angular developers, and provides an excellent debugger for Chrome (which you may also wish to install for easier debugging)
    • Intellij (Requires a license) : If you use IntelliJ already for other development work, IntelliJ IDEA Ultimate has TypeScript support. You could also use WebStorm, IntelliJ's Javascript IDE
    • Atom.io (Free) : This is an advanced text editor from the makers of GitHub. If you install the Typescript language plugin, it acts a little more like a basic IDE for TypeScript / Angular (providing autocomplete and highlighting).  However, be forewarned that it doesn't have the debugging capabilities of Visual Studio Code or IntelliJ.
    • Any other editor or IDE that provides either TypeScript or Angular 2 support.

Creating a branch for the exercises

To follow along with the exercises run the following git commands in the project directory to get the correct starting point

  1. git remote add workshop https://github.com/DSpace-Labs/dspace-angular-workshops.git
  2. git fetch workshop
  3. git checkout or2017-start
  4. git checkout -b or2017-hands-on

At certain points during the hands-on part we'll show a git tag that corresponds to the solution so far. If you'd like to sync up to that point, run the following:

  1. Revert all existing files to their state at the start:

    • git reset or2017-start --hard
  2. Remove any newly created files

    • git clean -f -d
  3. Sync with the solution

    • git merge $TAG_NAME

Additional Resources


  • No labels

3 Comments

  1. Note to be processed into the docs: when doing the git resets in IntelliJ IDEA, it wipes the IntelliJ project file, which seemed to create some issues that I was unable to solve during the workshop. So to be figured out how we can do the git resets without affecting IDEA's internal housekeeping.

  2. Hardy Pottinger captured a handwritten list of TODOs for our DSpace-Angular Documentation (especially related to more details about IDE setup/configuration). This is just a note to remind him to post that TODO list (once he gets a chance (wink)).

    Others who attended the workshop are also welcome to pose questions or details for Documentation enhancement as comments here.  Thanks!

  3. I get errors when I try to run yarn run watch:dev. watch:dev is not defined in package.json. Running yarn run watch instead, didn't worked out. Node.js comes up, but my browser is loading, and loading, and loading, and ...

    I just see that you told people to clone DSpace-Labs/dspace-angular-workshops while I did clone DSpace/dspace-angular...