Skip to content

Commit

Permalink
Update build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellblaser committed Jan 8, 2024
1 parent 4ae0b0e commit 7ef1502
Showing 1 changed file with 50 additions and 10 deletions.
60 changes: 50 additions & 10 deletions docs/Development Environment and Build Instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,63 @@ parent: Docs

## Development Environment and Build Instructions

#### Server
For users who do not want or need to modify the source code, we recommend using a Prebuilt Release from our <a href="/download">Downloads Page</a>.
## Server

Building the Server from Source is relatively easy, as we've made a script that does it all for you. If you're using Linux, macOS or the Windows Subsystem for Linux, the build script should just work.
For users who do not want or need to modify the source code, we recommend using a Prebuilt Release from our <a href="/FRCDetective/download">Downloads Page</a>.

There are two release options - either a Docker image or raw Python 3 source files.

#### Python Source Files

This is the simplest way to run the Server, especially for development, or if you are dedicating an entire machine to run the application exclusively.

It has a shorter setup time, and only depends on `python3` and `pip`.

Simply run `python3 ./detective.py`, and answer the questions when prompted for the initial setup. This will initialise server files in `server/datastore/*`.

#### Docker Image

Currently building a Docker image using our prebuilt script is outdated, and will need updating to regain this functionality.

A docker image is a little more complex to setup, although it has the advantage of being containerised, and highly stable.

---
>**For development systems running macOS or Linux, follow the instructions below. For Windows users, you will need to install the Windows Subsystem for Linux, and make sure you have python3, python3-pip, unzip and zip installed. If you are using WSL, don't install the Docker Engine through the package manager, but rather install the Windows version of Docker Desktop. It can be used through the command line the same way, and will produce less errors when you're trying to build.**

To build the source, you'll need to grab a few packages from python's `pip` package manager, and ensure you have either Docker Desktop (for macOS) or the Docker Engine (for Linux) installed.
> **For development systems running macOS or Linux, follow the instructions below. For Windows users, you will need to install the Windows Subsystem for Linux, and make sure you have python3, python3-pip, unzip and zip installed. If you are using WSL, don't install the Docker Engine through the package manager, but rather install the Windows version of Docker Desktop. It can be used through the command line the same way, and will produce less errors when you're trying to build.**
You can install all of the required packages by running the command `pip3 install flask flask-wtf flask-login flask-sqlalchemy flask-migrate flask-bootstrap email-validator waitress`.
To install Docker, read the instructions on their website <a href="https://docs.docker.com/engine/install/">here</a>.
To build the source, you'll need to grab a few packages from python's `pip` package manager, and ensure you have either Docker Desktop or the Docker Engine installed.

Once you've installed the dependencies, cd to `FRCDetective/Server` (ensure you are in the server folder) and run `./productionbuild.sh` (not as root, but as your normal user). If prompted, enter your password.
You can install all of the required packages by running the command `python -m pip install -r ./server/requirements.txt`.
To install Docker, read the instructions on their website <a href="https://docs.docker.com/engine/install/">here</a>.

*If you are still testing your code changes, you can run `python3 main.py -a 127.0.0.1` from the Server directory and test your code changes live on your system, outside of the container. Currently, upload and download of server files does not work outside of the Docker container, and we don't officially support this method of running the server application.*
Once you've installed the dependencies, cd to `server` and run `./productionbuild.sh` (not as root, but as your normal user). If prompted, enter your password.

Once your build is complete, `cd ../../` (to the directory adjacent to your repository directory), and you'll see a new .zip file named `DetectiveServer-Release.zip`. To deploy this to another system, copy this file across now and follow the <a href="/docs/Installation Instructions">Installation Instructions</a> on our other page.

If you're wanting to test on your development system, but inside of the Docker Container, you can follow the same instructions, however you shouldn't need to install any additional dependencies - what you've installed for development should be more than enough.
If you're wanting to test on your development system, but inside of the Docker Container, you can follow the same instructions, however you shouldn't need to install any additional dependencies - what you've installed for development should be more than enough.



## Client

To build the Client application for Windows computers and/or Android devices, you will require a Windows development environment. To compile for iOS or MacOS, you will require a Mac computer for a complilation machine, as we will need to use Xcode.

Firstly, install the following software...

```markdown
- Git for Windows
- Visual Studio 2022 Community
- Desktop Development with C++ workload
- Android Studio 2022.3 or later
- Android SDK Platform, API 33.0.0
- Android SDK Command-line Tools
- Android SDK Build-Tools
- Android SDK Platform-Tools
- Android Emulator
- Visual Studio Code
- Flutter extension for VS Code
```

Now, open VS Code and when prompted, click *Download SDK* for flutter.

To be sure, run `flutter doctor`, and if all is well, you are able to press F5 to build.

0 comments on commit 7ef1502

Please sign in to comment.