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 6 Next »

Table of Contents

Purpose

The purpose of this document is to onboard developers to the FinishLine team. To learn more about the team itself, see the Software Solutions page. To get a better idea of the goals and roles on the team, you can read the Software Solutions Charter.

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. If you are not familiar with Git, you can find a great presentation on what Git is here. Some other resources include common git commands, CLI commands, and what Git is (if you get the gist you do not need to read through all of it).

    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. 

  2. NodeJS: Version 14 16 18 Please

    1. Ensure that you have Node.js v18 installed. Any iteration of version 18 will do as long as it is version 18! (Make sure to pick an installer that corresponds to your operating system) https://nodejs.org/en/blog/release/v18.17.1

    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 18 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. If you’re on Windows: run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned to prevent some future problems with yarn

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

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

Database

Docker is the new method to run the database. If you’re a returning developer and still have the old way, please migrate to docker, we will be unable to support using postgres now.

Method 1

  1. Install Docker

    1. Download Docker Desktop for your OS and install it following the default steps (there are a few weird steps for Windows so make sure to do those).

    2. After installation, restart your computer if required.

  2. Once Docker is setup go to the root directory of FinishLine/Launchpad and run yarn database:setup

  3. Go to your Docker desktop app and the container you just made should appear. If it says “running”, then everything is working!

  4. If using Windows follow two more steps because Docker for Windows runs on WSL (Windows Subsystem for Linux):

    1. Install WSL by running wsl --install

    2. Setup wsl by launching ubuntu from the start menu

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.

    1. This combines three commands for you: yarn prisma:migrate which applies all the existing database migrations to the database, yarn prisma:generate which builds the type files for typescript so you can code with it, and yarn prisma:seed which populates the database with test data

  2. Refer to Software Prisma FAQ for more information about these commands.

Run and Test

  1. To test that things are working, run yarn install and then yarn start in the CLI (in the root directory) and go to an example API route. For Launchpad you can go to localhost:4001/ FinishLine: localhost:3001/users.

    1. Then go to localhost:3000 (FinishLine) or localhost:4000 (Launchpad) to see the dashboard (if it does not launch automatically)! Feel free to take a look around! You may need to open an incognito tab.

  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.

      1. 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)

      2. 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).

  • No labels