Z is a custom URL shortener for the University of Minnnesota developed by LATIS. We use Z to create and manage University branded short links, for example: http://z.umn.edu/mycoolsite.
Features
- Custom or generated link short urls at z.umn.edu
- QR code generation
- Click statistics
- Collections of links
- Sharing link management between users
- Integration with University directory
- Ownership transfer of links
- Administrative dashboard
- History of link changes
- Link creation API
-
Prep your system for running Ruby and Rails with MySQL
-
Make sure that
config/database.yml
is correctly configured with database credentials, andconfig/ldap.yml
is correctly configured with LDAP credentials, and an instance of MySQL is running. -
Install the version of ruby in
.ruby-version
:rbenv install
-
Install dependencies with bundler and yarn
bundle install # ruby dependencies yarn install # javascript dependencies
-
Create, import the schema, and seed the database. Part of this connects to LDAP, so you will need to be on UMN VPN.
# create the database, run migrations, and seed the database ./bin/rails db:setup # or ./bin/rails db:reset to drop the exist db first
-
To launch the application, run:
./bin/dev
This will use
foreman
to start both Vite (used for VueJS), and Rails.
Connect to [http://localhost:5100].
In test mode, Rails will use UserLookupServiceSkeleton
, a stubbed version of the normal LDAP UserLookupService
which will load test users from Cypress fixtures at cypress/fixtures
rather than doing a normal LDAP lookup.
To run the unit tests with Rspec:
bundle exec rspec
Cypress is used for End to End testing. To run the tests locally, you will need to have the application running.
You'll want to start the server using UserLookupServiceSkeleton
, a stubbed version of the normal LDAP, which will load test user data from Cypress fixtures at cypress/fixtures
. This is configured in Procfile.test
.
# start the Rails server in test mode wiht user lookup skeleton service stubbed
./bin/foreman start -f Procfile.test
Once the server is running, you can open Cypress with:
# open cypress
yarn cypress open
For deployment, we use:
- Capistrano, for deployment
- Apache/Passenger, as our server stack
- LATIS Ansible Playbook, for larger platform changes like a ruby version bump.
See config/deploy.rb
and config/deploy/
for deployment configuration.
To deploy remote dev and staging environments:
bundle exec cap <environmentname> deploy
Environment Name | Server |
---|---|
remotedev | cla-z-dev-02.oit.umn.edu |
staging | cla-z-tst-02.oit.umn.edu |
After deploying, populate the ip2location_db1 table with the content from the IP2Location LITE IP-Country Database.
Most of the language has been extracted into a single localization file. This allows you to change any language and make Z applicable to your environment.
- Source Code: https://www.github.com/z
- Issue Tracker: https://www.github.com/umn-latis/z/issues