Skip to content
Sam Ping edited this page Jul 25, 2021 · 8 revisions

Setup

Welcome to Sledge! We are so excited that you are working with us.

Sledge is a full-stack web application that is split into two parts- the client (aka frontend) and the server (aka backend). These two parts are set up separately, and are connected when the frontend makes a request to the server.

Requirements

Sledge relies on Node Package Manager (aka NPM) to install and keep track of packages, and uses MongoDB for the database. You need to install those onto your system before setting up Sledge.

Installing Node.js (and NPM)

Take a look here.

Installing MongoDB

Take a look here.

  • FOR WINDOWS USERS: Note that you generally want to install MongoDB as a service. This will start up the MongoDB service in the background whenever you turn on your computer. Additionally, after installing MongoDB, you should add MongoDB to your system PATH so that you can open the Mongo shell in a single command.

Cloning the Repository

To get the code for Sledge, you'll need to clone the Sledge repository. To do so, run:

git clone https://github.com/HackRU/sledge.git

Then you can enter the repository (that is now on your computer) with:

cd sledge

Frontend

Here's how to set up the frontend:

  1. Go into the frontend directory: cd client
  2. Install the node dependencies: npm i
  3. Create a copy of the .env.example file, and name the copy .env: cp .env.example .env
  4. Start the web app: npm start

And in your web browser, if you open localhost:3000 (if it didn't already automatically open), you'll see the spinning React.js logo.

Backend

The backend is set up similarily to the frontend:

  1. Go into the backend repository.
  2. Install the node dependencies: npm i
  3. Start the server: node server.js

Common Errors

Whenever you run into an issue, try searching your error up on Google! It has most likely been encountered by other people as well. But as usual, don't be afraid to ask your project lead any questions!

Clone this wiki locally