Climb! is a web application that improves the climbing competition experience by automating the scoring and verification process involved.
Target Audience: Competitive climbers
Main Functionality
For the minimum viable product:
- Competitors can create a competition
- Competitors can join a competition
- Competitors can log routes
- Competitors can view top climbs
For the final sprint:
- Competitors can have their logged routes verified
- Competitors can view their past logged routes for a competition
- Competitors can view their tentative final score
- Git (v2.21.1)
- Heroku (v7.38.0)
- Node (v12.14.1)
- PostgreSQL (v12.1)
- React (v6.13.4): Allows for the creation of web components for the frontend
- React Router (v6.13.4): Allows for routing of pages in the frontend
- React Router DOM (v6.13.4): Allows for routing of pages in the frontend
- Axios (v6.13.4): Allows for creating and handling API requests to the backend
Database
-
Navigate to the resources tab under your Heroku application and look for Heroku Postgres in the Add-ons search bar. Provision Postgres for your application with the Hobby Dev plan.
-
You can access the database from terminal with the following command (make sure you are logged into Heroku):
heroku pg:psql -a your-application-name
-
We have provided our schema in database.sql. Copy-paste this inside the Heroku Postgres terminal.
-
Once this is complete, copy over the config.example.js file into a new file named config.js and alter the fields to match the database configurations (username, host, database, port, password) on Heroku. These can be found by clicking on the Heroku Postgres option under Add-ons, then selecting Database Credentials under the Settings tab. Without this step, the Node.js server will not know what database to query.
Backend
Testing the web application on localhost:
- Navigate to the
backend
subdirectory:
cd backend
- Start the web server (this installs necessary dependencies as well):
npm start
Deploying the web application on Heroku:
- Configure the Heroku deployment:
cd .. heroku login heroku git:remote -a your-application-name
- Push the web application to Heroku:
git subtree push --prefix backend heroku master
Frontend
Testing the web application on localhost:
- Navigate to the
frontend
subdirectory:
cd frontend
- Install necessary dependencies:
npm install
- Start the web server:
npm start
Deploying the web application on Heroku:
- Configure the Heroku deployment:
cd .. heroku login heroku git:remote -a your-application-name
- Push the web application to Heroku:
git subtree push --prefix frontend heroku master
Mocha.js
- Install Mocha.js dependancies.
npm install mocha
npm install chai
npm install chai-http
- Navigate to
backend
directory.
cd backend
- Run tests.
a. Unit tests.
mocha test/unit
Here are our frontend and backend in production.
- Navigate to the homepage.
- Click on "Get Started" or "Sign Up" on the navigation bar and create an account. If you already have an account, click on "Log In" and log in.
- Click on "Competitions" to create or join a competition.
- Click on "Create Competition" and create a competition. If your competition already exists, click on "Join Competition" and join the competition.
- Click on "Log Routes" and log routes for a given competition and route number. You must have two witnesses whose usernames must be submitted with your logged route. You now see all of your logged climbs for your current competition.
- Click on "View Score" and view the top 3 climbs and your tentative final score for your current competition.
- Click on "Log Out" on the navigation bar.
- Restarting the backend Heroku dyno from an API call causes a delay of several seconds
- There is a very slight delay in showing top 3 table in "View Score"
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
See LICENSE.txt