Skip to content

Running ALP Locally

Now that you have set up your environment and have been granted access to the ALP repository, it is time to run the application on your local machine!

Setup Database

Hangfire

We are currently using Hangfire to handle our background tasks. Hangfire automatically creates its required database tables when the application starts for the first time, so no manual database setup is required.

The default configuration assumes that your database has been set up with the default settings and that your local Postgres server accepts the credentials:

username: postgres | password: postgres

Hangfire will automatically create the necessary tables (typically prefixed with hangfire_) in your main ALP database when the application starts.

Database Update

For ALP, database update may be run using the .NET Entity Framework Core tools. You can install the tools by following the instructions found here.

You may use them directly, which will involve specifying the directories explicitly. Alternatively you can use the database.sh script at the root of the project. This is a shortcut that passes in the required paths for you.

The update can be run using the following command:

bash
./database.sh database update

If the above bash code is not working in windows cmd, try this

bash
dotnet ef --project ALP.Data/ALP.Data.csproj --startup-project ALP/ALP.csproj database update

Replace 'database update' to any EFcore command if you wish do the EFcore operation.

Troubleshooting

If you have used other username and password for database servers, it can be changed in the /ALP/ALP/appsetting.Development.json file.

Running the Backend

The RESTful API can be started by simply running the project using Visual Studio by opening the solution file .sln; or via the dotnet toolchain in the command line.

TIP

  • You might face warning from backend when logged in with the following details, just press continue and you would successfully get into the system.

Running the Frontend

The Vue SPA project can be found at /ALP/App from the root of the project. It is located here as it is built and served by the RESTful API in a production scenario.

During development, you can run the project by navigating to /ALP/App folder, then:

  • Install the required packages by running
yarn install
  • Run the application with
yarn serve

TIP

Please do use http://localhost:8080 to login to program running locally instead of the http://127.0.0.1:8080/

Local Logging in

To login to the system when running locally, an admin user is initialised.

Log in

Username : admin@example.com

Password : 123qwe

One-Time Passcode : Can be viewed and edited in database table 'alp/table/user_one_time_passwords'

Released by DevOps Team