How to Install ACP Admin on NixOS

ACP Admin is an open-source web-based platform for managing clubs, associations, and other organizations. This tutorial will guide you through the steps to install ACP Admin on NixOS.

Step 1: Install NixOS

If you haven't installed NixOS yet, check out the official NixOS installation guide.

Step 2: Install Required Packages

Before installing ACP Admin, we need to make sure that all the required dependencies are installed on the system. In this case, we need to install Git, Node.js, and MongoDB.

sudo nix-env -i git nodejs mongodb

Step 3: Clone ACP Admin Repository

Clone the ACP Admin repository to your local disk by running the following command:

git clone https://github.com/tnovelli/acp-admin.git

Step 4: Configure MongoDB

Before starting the ACP Admin application, we need to configure MongoDB. First, we need to create the data directory for MongoDB:

sudo mkdir -p /var/lib/mongodb
sudo chown -R mongodb:mongodb /var/lib/mongodb

Next, we need to create a configuration file for MongoDB. Create a new file called /etc/mongodb.conf and add the following lines:

storage:
  dbPath: /var/lib/mongodb

security:
  authorization: enabled

By enabling authorization, we require users to authenticate before they can access the database.

Restart MongoDB using the following command:

sudo systemctl restart mongodb

Step 5: Configure ACP Admin

Navigate to the ACP Admin directory using the following command:

cd acp-admin

Next, run the following command to install the required npm packages:

npm install

Now we need to configure the config.json file to set up the database connection. Copy the config.example.json file to config.json, and update the following values:

{
  "mongoUrl": "mongodb://localhost:27017/acp-admin-db",
  "authProviders": {
    "google": {
      "clientID": "INSERT CLIENT ID HERE",
      "clientSecret": "INSERT CLIENT SECRET HERE"
    }
  }
}

Replace INSERT CLIENT ID HERE and INSERT CLIENT SECRET HERE with your Google OAuth credentials.

Step 6: Start ACP Admin

To start the ACP Admin application, run the following command:

npm start

ACP Admin should now be running at http://localhost:8080.

Summary

By following the steps outlined in this tutorial, you should now have ACP Admin up and running on your NixOS system. You can now log in to ACP Admin using your Google OAuth credentials, create new clubs or organizations, and manage existing ones.