Maintaining Website

We have a website located at ufsolargators.org which contains information about our organization for sponsors and other interested parties to see. It is hosted for free using GitHub Pages and has an API hosted on AWS.

The website was built using React and the repository can be found on our GitHub organization called Advertisement-Website. The code for the API is also under the GitHub org, however it is private due to security concerns. Please request access from a senior member and they can get you that.

Getting Set Up Locally

There are many guides on how to get setup with a react. Here are a few: Official React Guide, W3 Schools Guide.

To get started with making changes to the website nodeJS must be installed first, as it is a prerequisite to react.

#Get Node sources
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
#Now install node
$ sudo apt-get install nodejs

note: You may need to install curl if it’s not already

$ brew install node

note: You will need to install brew for this to work, refer to this article on how to do that.

Alternatively you can download node’s installer from their website, link is here.

The easiest way to install node on windows is to download the installer from their website. The link to their download page is here.

Next clone the Advertisement-Website locally. Then cd into the directory of the project using your favorite terminal.

Now install the necessary packages using the following npm command.

$ npm install

After installing there should be no errors. If there was you might see some red text in your terminal. At this point you will likely need to google the specific error you got to figure out how to move forward.

Now run start to see the website!

$ npm start

After doing so a new window in your favorite browser should open at http://localhost:3000. If it doesn’t you may need to navigate directly there.

API Endpoints

Our API is located at api.ufsolargators.org and has various endpoints. This section will describe their use.

POST /api/contact

This is the endpoint that our contact form uses. It’s used to send a message directly to a fixed email account defined in the backend.

Example request:

axios.post('https://api.ufsolargators.org/api/contact', {
    email: email,
    name: name,
    msg: msg,
    token: captcha
})

Example response:

{
    msg: "Sent!",
    success: true
}
Query Parameters
  • email – email address of the person to contacting us

  • name – name of person contacting us

  • msg – message they are sending

  • token – captcha token

Response JSON Object
  • msg (string) – returns Sent! when success is true, other wise contains the error message

  • success (boolean) – when false there was an error, when true there was no error

DNS Configuration

The DNS is hosted by google domains. Contact a senior member to get the credentials if it needs to be edited.