Installing Athena

This will tell you how to setup a private mirror of Athena.

Installing Athena Advanced

Ensure that you have followed and completed the Before Setup instructional page. The prerequisites inside of that page are deeply important for making alt:V Athena function out of the box.

Table of Contents

Setup Private Repo

Create a bare clone of the Athena Repository

git clone https://github.com/Stuyk/altv-athena --bare altv-athena-bare

Create a new private repistory on github. Let's call it altv-athena-private

Copy your URL from github.

Move into the bare directory from your command line tool of choice

cd altv-athena-bare

Mirror the bare repository to your private mirror.

git push --mirror <your_github_url_here>

Delete the bare repository.

cd ..
rmdir altv-athena-bare

Set Private Repo Main Branch to Master

Download from Private Repo

Clone the repository down from github.

git clone <your_github_url_here>

Add the upstream of the original athena repository.

git remote add upstream [email protected]:Stuyk/altv-athena.git
git remote set-url --push upstream DISABLE

Updating Submodules

This downloads all of our other repository dependencies such as the Ares Authorization Service.

git submodule update --init --recursive --force --remote

Installing Dependencies

This installs all NodeJS packages and dependencies that help run the server.

npm install

Installing Server Files

From this point forward you can simply run this npm command to update dependencies.

npm run update

Installing License Key

The license key is unique to your Gumroad Transaction. The license key will allow you to properly boot the alt:V Athena Server. This can be installed by using Environment Variables or a simple .env file will do.

Creating the .env File

In the same directory as your package.json file. Create a file called .env and open it up in whatever text editor you like to use. Add the following lines to your .env file depending on what you need.

I cannot stress this enough .env.txt is not the same as a .env file. Make sure your file is actually called .env with no extension.

GUMROAD

This argument is for your alt:V Athena Subscription License. It lets you boot the script.

GUMROAD=XXXXXXXX-YYYYYYYY-...

EMAIL

This argument is for your Gumroad Email. The Email you used when you bought a license.

MONGO_URL*

This argument is if you went with a remote MongoDB Server.

Optional. Not required to add.

MONGO_URL=mongodb://localhost:27017

MONGO_USERNAME*

This argument is if your database has a username anbd password. Highly recommended if you have remote access.

Optional. Not required to add.

MONGO_USERNAME=myUsername

MONGO_PASSWORD*

This argument is if your databae has a username and password. Highly recommended if you have remote access.

Optional. Not required to add.

MONGO_PASSWORD=coolPassword

Results May Vary

You should end up with something similar to this.

Do not put parameters if they are empty. You may not get the desired effect you want.

GUMROAD=XXXXXXXX-YYYYYYYY-...
MONGO_URL=
MONGO_USERNAME=
MONGO_PASSWORD=

Running the Server

Running the server should always be done through your command line, terminal, or powershell interface. You should use the npm scripts that included inside of package.json.

Make sure you follow the full setup before running any of this.

Running Production on Windows

npm run windows

Running Production on Linux

npm run linux

Running in Debug / Auto Refresh Mode

You need to open two terminals. I recommend doing this inside of VSCode as you'll see compilation of your project as well as keeping the server running which will automatically refresh for updates.

First Terminal

npm run windows

Second Terminal

npm run watch-windows

Replace windows with linux if you are using linux.

Cleaning Files, Cache, etc.

If you run into issues during your runtime you can always run the cleaning process which will rebuild cache for faster build times. It is only recommended to clean if you are updating.

You will not lose any major files upon running this process.

npm run clean

Updating and Storing Changes

Instead of being super ineffecient and merging files in one at a time, you're going to be using git to pull down changes. Which does things mostly automatically.

Here are some notes before you perform these actions (SUPER IMPORTANT):

  • Close All Open Files

  • Push All Current Change to Private Repository

  • Create a backup of your current folder

  • Run the two commands below.

git fetch upstream
git pull upstream master

If you run into merge conflicts... see the video below. It will help you understand what needs to be done to resolve merge conflicts.

Merge Conflicts?!

Don't worry I made a simple video to help explain merge conflicts. Check out this video:

Resolving Merge Conflicts

Merge conflicts only occur when you are pulling in new data from an existing repository. This means that it found similar code but isn't sure if you want to override your current code or mix the two. A merge conflict can easily be seen inside vscode when pulling dwon from the upstream.

Pushing Changes to Private Repository

If you make changes in your private clone. You can now simply push to the private repository and pull it down anywhere. Which is really great.

Here's how you can push changes.

git add .
git commit -m "What did I commit to the repo"
git push origin master