stab-virtual-jabog32 / fpt

flight planning tool
Other
2 stars 6 forks source link

Flight Planning Tool (FPT) for DCS Squadron

Overview

The Flight Planning Tool (FPT) is a vJaBoG32 specific Fork of /obfuscoder/fpt is a Ruby on Rails web application designed for virtual squadrons in the DCS (Digital Combat Simulator) environment. This tool allows pilots and air traffic controllers (ATCs) to manage flight plans, share them with ATC, and export relevant data to LUA files for DCS mods (e.g., Kneeboards, Waypoints). The app integrates with DCS to enhance mission planning and execution, providing centralized management of flights and their associated data.

Features

Prerequisites

Before setting up the application, ensure that the following tools and dependencies are installed:

See further information below, how to install prerequisites.

Setup

1. Clone the Repository

git clone https://github.com/stab-virtual-jabog32/fpt

2. Install Dependencies

Run the following command to install required gems:

bundle install

For JavaScript and CSS dependencies, use:

yarn install

3. Database Setup

Ensure that your PostgreSQL server is running and then create and migrate the database:

rails db:create
rails db:migrate

4. Start the Rails Server

To run the application locally, use:

rails server

1. Install Ruby

It’s recommended to use a version manager like rbenv to install Ruby, as it allows you to manage different Ruby versions easily.

Using : Step 1: Install and

# Install rbenv and ruby-build
sudo apt update
sudo apt install -y rbenv build-essential libssl-dev libreadline-dev zlib1g-dev

# Set up rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc

# Install ruby-build to easily install Ruby versions
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build

Step 2: Install Ruby (version specified in <.ruby-version>)

# Install Ruby (use the version from .ruby-version file)
rbenv install <ruby-version>
rbenv global <ruby-version>

# Verify the installation
ruby -v

Step 3: Install Rails Once Ruby is installed, you can install Rails using the gem package manager:

# Install Rails
gem install rails -v <rails-version>

# Verify the installation
rails -v

Make sure the Rails version is compatible with the one specified in the Gemfile.

Step 4: Install PostgreSQL PostgreSQL is the recommended database for this application. Use the following commands to install and set it up:stall Rails using the gem package manager:

# Update package list
sudo apt update

# Install PostgreSQL
sudo apt install postgresql postgresql-contrib libpq-dev

# Start the PostgreSQL service
sudo service postgresql start

Once PostgreSQL is installed, you will need to create a user that matches your Linux username:

# Switch to the PostgreSQL shell
sudo -u postgres psql

# Create a user (replace 'your_username' with your Linux username)
CREATE USER your_username WITH SUPERUSER PASSWORD 'your_password';

# Exit the PostgreSQL shell
\q

You can modify the database settings in <config/database.yml> to use this user.

After configuring the user and the database, create the database:

rails db:create
rails db:migrate

Step 5: Install Yarn Yarn is used to manage front-end dependencies (JavaScript libraries). It’s required for handling Rails assets like CSS and JS.

# Add Yarn package repository
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

# Update package list and install Yarn
sudo apt update
sudo apt install yarn

# Verify installation
yarn -v

Step 6: Install Application Dependencies Now that the system is ready, install the required gems and JavaScript dependencies for the application

# Install Ruby dependencies (gems)
bundle install

# Install JavaScript/CSS dependencies
yarn install

Step 7: Start the Rails Server Once all dependencies are installed, start the Rails server with the following command:

rails server

The server will be available at http://localhost:3000.

How to Pull Request

Please only use rebase option for easy changes (e.g. JSON config update for adding a user)