GithubHelp home page GithubHelp logo

stepcounter-backend's Introduction

stepcounter-backend

The Company Steps Leaderboard Backend is a RESTful API built to manage teams and their step counters. It allows you to create teams, add users to teams, increment step counters for users, and retrieve team and user information.

Getting Started

These instructions will help you set up and run the backend on your local machine.

Prerequisites

You will need the following tools installed on your system:

Installation

  1. Clone the repository:
git clone https://github.com/marwaGoda/stepcounter-backend.git
  1. Change into the project directory:
cd backend
  1. Install the required dependencies:
go mod download
  1. Run the backend server:
go run main.go

The server will start running on http://localhost:8080.

API Endpoints

The API provides the following endpoints:

  • POST /teams: Create a new team.
  • GET /teams: Retrieve a list of all teams.
  • GET /teams/{teamID}: Retrieve the details of a specific team.
  • POST /teams/{teamID}/users: Add a new user to a team.
  • GET /teams/{teamID}/users: Retrieve all users in a team.
  • POST /teams/{teamID}/users/{userID}/counters: Increment the step count for a user in a team.
  • GET /teams/{teamID}/counters: Retrieve the current total steps taken by a team.
  • POST /teams/{teamID}/users/{userID}/counters/increment: Increment the step counter of a user in a team by a value.

Running Tests

To run the unit tests for the backend, use the following command:

go test ./api

Built With

  • Go - The programming language used.
  • Gorilla Mux - The HTTP router used for handling requests.

stepcounter-backend's People

Contributors

marwagoda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.