Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

General

Welcome to Northeastern Electric Racing’s Software Solutions team! We are excited to have you join!

Purpose

The purpose of the Software Solutions team is to create software that makes the lives of the rest of the club easier. Currently, this means that we work on creating and updating our project management dashboard dubbed “FinishLine by NER.” Our goal is to have our club (and others in the future) be able to manage all projects and finances via the dashboard. The app is primarily for the benefit of Northeastern Electric Racing's Project Management Office, club leadership, and club members as a whole. Please read more about the responsibilities and goals of the team in the Software Solutions Charter. You can also find more about the club and about the project on the GitHub repository’s readme.

Environment Setup

Time to dive into the meat of onboarding: environment setup! Note: every time you install something, please restart your CLI to be able to use it (it will probably say that what you installed is not recognized otherwise).

Project Setup

  1. Git: What is it and why?

    1. Git is a version control system and GitHub is an internet hosting service using the version control that Git provides. You can find a great presentation on what Git is here.

    2. In order to set up Git on your computer please follow these steps (after creating a GitHub account if you do not already have one). Make sure to do the authentication step so that your computer is tied to your GitHub account.

    3. Now that you have Git installed and have a GitHub account, clone the repository from here to your computer, potentially using git clone in your preferred CLI (i.e. Terminal/Powershell; please use Powershell over Command Prompt on Windows) to pull the project down to your computer. 

    4. After this onboarding, if you are not already, familiarize yourself with Git! There will be some resources at the end of the environment setup and Fall Learning Session #1 is all about Git! 

  2. NodeJS: Version 14 16 Please

    1. Ensure that you have Node.js v16 installed. Any iteration of version 16 will do as long as it is version 16! [Note: as of August 2022, this is the LTS version found on the main download page. For the future, if this is not an iteration of version 16, either scroll down on this page and search for it manually or download the package for your operating system from this link.]

    2. Check the box to install any additional tools during installation to ensure functionality with VSCode while installing (don’t worry if there are a couple errors here - this tends to happen on new installs).

    3. After installation, confirm that the version is some variant of 16 with the command node -v.

  3. NPM & Yarn

    1. Navigate to the folder of the cloned repository using your CLI (via the cd command).

    2. In your CLI, run npm install -g yarn.

    3. Run yarn install to instruct npm to install all the necessary packages.

Database

There are now two methods to setup the database. Please use the first one (please).

Method 1: Docker!

  1. Install Docker

    1. Download Docker Desktop for your OS and install it following the default steps.

    2. After installation, restart your computer if required.

  2. .env setup

    1. Navigate to the src/backend directory and add a .env file here via the command ni .env [Windows] or touch .env [Mac] in the CLI or create the new file manually in your File Explorer or IDE (we use VSCode - more on that later). 

    2. Paste the following line into the .env file: DATABASE_URL="postgresql://postgres:docker@localhost:5432/nerpm?schema=public"

    3. Navigate to the root directory of the project and run the following two commands (note - if you are already running Postgres from the old manual installation, you must stop it first):

      1. docker run --name finishline -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgres

      2. docker exec -ti finishline psql -U postgres -c "CREATE DATABASE nerpm;"

Method 2: Manual Setup (Not Recommended - Skip to Initial Database Migration if completed above)

  1. PostgreSQL Setup

    1. Mac Setup: The easiest way to install PostgreSQL on a Mac is with Postgres.app.

    2. Windows Setup: Install the newest PostgreSQL and follow all default steps. At points where it asks for any psql package installs, please include them. If a password or multiple are required, remember these passwords (they will be important later). After the installation, please restart your CLI of choice (Powershell, Command Prompt, etc).

  2. Database Initialization

    1. After downloading and installing PostgreSQL properly, you'll need to run PostgreSQL and create a database named nerpm. By default, PostgreSQL typically has a postgres database. You can use psql in the CLI to create a database by running this SQL statement (after running psql): CREATE DATABASE nerpm; (make sure to include the semicolon!). Naming the new database nerpm will ensure it matches with the database URL specified in the project preparation section below.

    2. Alternatively, if the psql command does not work (likely due to the PATH variable not being set), try the command psql -U postgres (as postgres is the default username) and mimic the above steps after that. If these both fail, you can use pgAdmin instead. Search for the "pgAdmin 4" application on your computer's search bar and open it. Here, click on "Servers" and right click on "Databases" and then navigate to "Create" and then "Database..." and then use the name nerpm (for the same reason as above).

  3. .env setup

    1. Navigate to the src/backend directory and add a .env file here via ni .env [Windows] or touch .env [Mac] in the CLI or create the new file manually in your IDE. 

    2. Mac setup: Paste the following line into the .env file and replace <USERNAME> with your computer username: DATABASE_URL="postgresql://<USERNAME>:@localhost:5432/nerpm?schema=public"

    3. Windows setup: Paste the following line into the .env file and replace <PASSWORD> with the password you created earlier: DATABASE_URL="postgresql://postgres:<PASSWORD>@localhost:5432/nerpm?schema=public" 

Initial Database Migration

  1. In order to run the database for the first time, you will need to execute the following command in the CLI (make sure you’ve navigated back to the base folder of the repo!). Run yarn prisma:reset. This should apply all the existing database migrations to the database (create the required tables in the database, see yarn prisma:migrate) and populate the database with seed data (see yarn prisma:seed).

  2. Refer to prisma migration tools for more information about these commands.

Run and Test

  1. To test that things are working, run yarn start in the CLI (in the root directory) and go to an example API route. Example: localhost:3001/users.

    1. Then go to localhost:3000 to see the dashboard (if it does not launch automatically)! Feel free to take a look around!

  2. IDE: VSCode

    1. We use VSCode at NER. You can use something else, but we won’t be able to help you if you have problems. VSCode is pretty industry standard though, so it’s very good to know.

    2. Click File > Open Folder then navigate to the repo and open it

    3. There should be a popup in the bottom right asking you if you want to install the recommended extensions. Click install.

    4. If for some reason this doesn’t show up, the following are the mandatory VSCode extensions. You can install them manually by clicking the extensions tab on the left (it looks like building blocks) and searching for them:

      1. Jest (orta.vscode-jest)

      2. Prisma (prisma.prisma)

      3. ESLint (dbaeumer.vscode-eslint)

      4. Prettier (esbenp.prettier-vscode)

    5. And the optional ones (for a better experience):

      1. Babel (mgmcdermott.vscode-language-babel)

      2. Material Icon Theme (pkief.material-icon-theme)

  3. Congrats!

    1. You now (theoretically) have a functioning environment! Congratulations! If not, please look at the FAQ page, and if that doesn’t help, look for further help in the #software_env-setup slack channel (more info down below). Once again, here is the link to the repo (and here is the link to the outdated repo which still holds a lot of useful information).

What Now?

Learn about the technologies we use and join Slack! The technologies are mentioned below and on the GitHub repository. If you are not familiar with the technologies, don’t worry! We have a learning curriculum to help with the basics! Also, if you are not familiar with Git, please familiarize yourself with common git commands, CLI commands, and what Git is (if you get the gist you do not need to read through all of it). You may also follow tutorials found in the NER curriculum for this information as well as attend Learning Session #1. When you are ready to start development on the codebase, please read through the contributor guide on the GitHub repo.

Join the Slack!

At NER, we utilize Slack for communication. We ask that you download Slack on both your phone and computer to be able to reliably view and respond to any communication. Here is a quick start guide for Slack (on desktop). Most of the information in this should translate over to mobile. Please note that notifications may be off by default, so please ensure that they are turned on. After this, go through the channels that exist in the Slack and join any relevant channels (#software_env-setup & #software for starters). Additionally, try to avoid sending messages @everyone in general, but feel free to @ someone that may be relevant to your issue.

Organization & Leads

Now who may be relevant to @ for issues?

Our Product Team exists as a wonderful resource for all developers on the Software Solutions team. Product Analysts, Product Managers, and our head hold key business facing information for all parts of our application, and are a great resource to go to if you have non-technical questions. Make sure to reach out to relevant analysts, PMs, or even Leroy first before reaching out to others for these questions in case they can answer your questions.

For technical or coding questions, try to contact anyone you are pair programming with or working with on a feature. If this does not help, move to the tech leads & senior developers. Next step is to check in with a Software Group Lead, Reid Chandler or Arnav Joshi. If they cannot answer anything, please contact the Head of Software Solutions, Anthony Bernardi. After that only the president, James Chang-Davidson, can help you 😳 (he doesn’t bite).

  • No labels