Part II - Installation
Once you have created at least one acquisitions list in Alma Analytics, you can proceed and install AAOS:
- Download the latest package available from GitHub.
- Unzip the package in a directory of your choosing.
- Navigate to the directory.
composer install
to install the required dependencies.cp .env.example .env
to generate a .env file.php artisan key:generate
to generate an encryption key.- Create a database following the instructions on this page.
- Create an admin account following the instructions on this page.
php artisan serve
to locally experiment with Alma Acquisitions - Open Source (AAOS.)
Tip
If you do not have Composer installed on your server, upload the composer.phar
file - available on the Composer website - to your application folder and use php composer.phar install
with a non-root account to install dependencies.
Database
Note
This application is based on Laravel. Laravel can use various database connections: if you would like something else than MySQL or SQLite, please refer to the official Laravel documentation for more information.
MySQL
For production environments, or for extended development, we recommend using MySQL as your database.
- In your
.env
file, make sureDB_CONNECTION=mysql
is set. - Generate a MySQL database on the server, and make sure that the
.env
settings are properly set, and that the AAOS can make a connection to your database. php artisan migrate:fresh
to populate the database with the right tables.php artisan serve
to lunch your application.
SQLite
If you are only testing the application, we advise using SQLite:
- In your .env file replace
DB_CONNECTION=mysql
withDB_CONNECTION=sqlite
- In the
/database
folder, create a text file calleddatabase.sqlite
php artisan migrate:fresh
to populate the database, and create dummy data and an admin user.php artisan serve
to lunch your application.
Note
While you have created the tables, you have not created an admin user, or added any data to the database. AAOS will return a error - 404
because it cannot find any acquisitions. This is correct and expected.
Danger
Do not use php artisan migrate:fresh
on a public/production server, unless you are starting out: you will erase all the data from the database!
Creating an admin account
Once you have created and connected to a database, and you have generated the tables, you must generate an admin account. To generate a admin user, or creating multiple admin users, we use Tinker. Tinker is included in Laravel.
These commands can be used both locally or on the server for both SQLite and MySQL databases.
php artisan tinker
DB::table('users')->insert(['name'=>'YourUsername','email'=>'thisis@youremail.com','password'=>Hash::make('TypeYourPasswordHere')])
This will return true
, meaning that an account has been added to the database.
Note
Any user created in this application is an admin. There is no differentiation in roles implemented.
Start using your application
On your local machine, you can use php artisan serve
to launch a local version of your application. You will be able to login at http://127.0.0.1:8000/login.
Once you have logged in, AAOS will query the Alma API and return the list of available acquisitions lists that can be created at http://127.0.0.1:8000/admin.
If you have installed the application on your server, and used Tinker to create an admin account, proceed directly to yourURL.com/login
or yourURL.com/admin
.
Additional notes
Note
The main folder in Laravel is named public
, some servers use public_html
instead. Make sure your DNS points to the "public" folder.
You can also decide to use the public_html
folder instead, but you will have to make some changes to your configuration. How to do this is out of scope of this documentation.
Note
You can further optimize the application using more complex Laravel and Composer commands. See the Laravel documentation on deployment.