Skip to content

Getting Started

Naya Singhania edited this page Oct 3, 2024 · 29 revisions

Cloning the Repository

Clone the SCE dev tool and follow the guide for setup: https://github.com/SCE-Development/SCE-CLI#setup

sce clone c

cd Clark

sce link c

Running MongoDB

  1. Install docker:
  • Install for Windows here
  • Install for Mac here
  • Install for Linux here
  1. run mongodb with:
sce run mongo

Running setup.py

Ensure you have python3 installed and run the script with:

# if macOS or linux:
python3 setup.py
# if Windows:
python setup.py

Running the Application

Frontend Only

To simply run the application's frontend, paste the below command into your terminal.

npm run start

Shortly after, a window in your browser will open with the website on http://localhost:3000.

Frontend and Backend

In another new terminal window or tab, run the application with the command below:

npm run server

In yet another new terminal window or tab, run the application with the command below:

npm start

After some time, the application will load in the browser's terminal.

Creating an Account

  1. In the topmost directory of Core-v4, run
npm run create-user

Follow the prompts and if the website is running from the steps above, you should be able to login with this created account.

Setting Up GMail (Skip if you are a new dev member!)

Pre-requisite: you will need a Google Cloud Platform project setup to complete this section.

  1. Create a new config.json file in the /api/config/ directory by simply making a copy of the existing config.example.json and renaming it.

  2. Open a terminal window and run:

    npm run generate-token
    
  3. Before anything, you must have a GCP project setup. The first 2 steps will prompt you for Client ID & Secret keys, obtain from https://console.cloud.google.com/ under the API Credentials section. Some GCP consoles look differently, so the info we need can be found in either of these:

    • api-credentials api-credentials
  4. The third step will prompt you to visit a link and get an auth code. You'll need to first authorize your GCP project, then copy the value in this text input, paste it into the server terminal and hit enter.

    • image
  5. A token.json file should be created under /api/config/ and you're now good to go, let's see your authorization token being used. In a terminal window use the command: (make sure you have 2 other terminal windows running the frontend and mongoDB)

    NODE_ENV=production npm run server
    
  6. Create an account with a fake email.

    • fake-email
  7. If you are taken to the confirmation page saying "Your application has submitted!", then you're good to go.

    • Since signing up with a fake email, you won't be able to see the actual verification email.
  • Note: you need access into the sce.sjsu@gmail.com email account in order to set this up.
  • Note: If you need to repeat this process, delete any existing token.js file.

Setting up RFID server (Skip if you are a new dev member!)

Prerequisites: Find the AWS-IOT folder in the shared google drive folder and download it.

  1. Drag and drop the AWS-IOT folder into Core-v4/api/
  2. Run npm start, npm run server and mongod commands in separate terminals
  3. Login into the website as an admin and go to RFID Manager
  4. Follow the instructions on how to setup ESP32

Having trouble?

Post any relevant screenshots in #development in the SCE Slack and we'll sort it out.