Skip to content

Build Code

Brett Loewen edited this page Oct 9, 2024 · 13 revisions

How to How-to Compile & Run

Note

If you don't have access to a required resource you can reach out to us


Backend [Server & API]

Steps

  1. Install Visual studio 2022
  2. Install MySql community https://dev.mysql.com/downloads/mysql/
    • If the DB username and password need to be changed in the project, SailDBContext.cs and appsettings.json should be updated accordingly
  3. Pull the latest release from the Project Repo (Please note that we have 2 repos. you do not want to use the admin repo)
  4. open SailMapper in visual studio /comp4350-project/backend/SailMapper.sln
  5. In the solution explorer tab, right click SailMapper and open a terminal
  6. Run: dotnet restore, dotnet tool install --global dotnet-ef, then dotnet ef database update
  7. At the top of visual studio ensure that "SailMapper" is the startup item and "https" is the startup project, click run
  8. To run tests, in the terminal dotnet test
  9. To run Linting, in the terminal dotnet format SailMapper.sln

If at any point there is an error message requesting which project some code should be ran against, you must be in the /SailMapper folder and append SailMapper.sln to the command



REACT [Frontend: RC_Client]

Steps

  1. If you don't already have Node.js, download and install it from https://nodejs.org/en and confirm it setup correctly by running node --version
  2. Pull the latest release from the Project Repo (Please note that we have 2 repos. you do not want to use the admin repo)
  3. Navigate to the frontend/react folder in the project
  4. Run npm install in a terminal
  5. Run npm run dev in a terminal and go to http://localhost:5173/ in a browser to access the running website
  6. Run npm run test in a terminal to run the tests
    • You can also run npm run test:ui to get the test results listed out in a browser window


Flutter [Frontend: Racer_Client]

Warning

For the student(s) who are Building & Running our project
Unless you are working in a similar environment complete Flutter last.

Setup/Dependencies

If you follow Flutter's Start building Flutter Android apps on Windows, with default settings, (plus any optional suggestions that you may receive from your IDE or tutorial) you will have nearly an identical setup to mine.

The following point(s) may not be reasonable for you to reproduce:

  • Windows 11 environment

more info on environment

What you should have:

  • VS Code
    • Version: 1.77 (or later)
  • VS Code Extensions:
  • Flutter (For Mobile Client)
    • Version: 3.24.3
  • Dart (For Flutter)
    • Version: 3.5.3 (Flutter handles)
  • Android Studio
    • Android Emulator
      • Phone: Pixel 7a
      • Version: Android 15
      • API Level: 35

Pre-Building Tasks

  1. Everything above
  2. Grab Files
  3. Pull the latest release from the Project Repo (Please note that we have 2 repos. you do not want to use the admin repo)
  4. Install Emulator
  5. Start your emulator
  6. Open Android Studio
  7. Click "More Actions"
  8. Click "Virtual Device Manager"
  9. Press the play button
  10. Open your repo copy in VS Code
  11. Navigate to the Flutter root, cd frontend/flutter_client (assuming you are in the project root)
  12. On the sidebar for VS Code click the Bug on the Play button.
  13. At the top there is now a green arrow with a drop-down menu
  14. Select your emulator
  15. Click the green arrow. (this lints, compiles, CI tests, and more, all in one click)
  16. You did it 🥳
  17. Wrapping up
  • The emulator may take a few minutes to start up each time
  • You may need to relaunch the emulator twice, I found it unstable on my system
  • A common problem is your PATH variables are not set up correctly
  • More info can be found on our Wiki, (Not exhaustive)
  • The VS Code sidebar contains more info for Building. In the order below
    • Run and Debug:
    • Testing: To see your CI testing results
    • Flutter: Dev Tools and Debugging

image


Finished

  • Sailing Race Analyzer
  • Features
    • Web App
    • Mobile App
  • Repo
  • Issue Tracking
  • Branching
  • Dev Tools & Programs
  • Architecture
  • Database Structure
  • Network
  • Sequence Diagrams
  • Backend
  • REACT
  • Flutter

Clone this wiki locally