Football Gather - Server Side

Vapor 4 Swift 5.2 Xcode 11.6

FootballGather is a demo project for friends to get together and play football matches as quick as possible. My intention is to to try out different iOS Architecture Patterns and use server side Swift (Vapor this time).

This repo contains the server side logic. For the iOS version, please check Football Gather - iOS Side.

Features

  • Ability to add players
  • Set countdown timer for matches
  • Use the application in offline mode
  • Persist players

TODOs

  • Finish the implementation of the web services API
  • Nice to have basic access authentication

Database Structure

FootballGather-db-diagram

API

UserController

  • GET /api/users - Gets the list of users
  • GET /api/users/{userId} - Gets the specified user by its id
  • POST /api/users - Creates a new user
  • POST /api/users/login - Logins a user and returns the token
  • DELETE /api/users - Deletes the logged in user

PlayerController

  • POST /api/players - Creates a new player
  • DELETE /api/players/{playerId} - Deletes a player by its id
  • PUT /api/players/{playerId} - Updates a player by its id
  • GET /api/players/{playerId}/gathers - Gets the list of gathers for the player
  • GET /api/players - Gets the list of players

GatherController

  • GET /api/gathers - Gets the list of gathers
  • POST /api/gathers - Creates a new gather
  • DELETE /api/gathers/{gatherId} - Deletes a gather by its id
  • PUT /api/gathers/{gatherId} - Updates a gather by its id
  • POST /api/gathers/{gatherId}/players/{playerId} - Adds a player to a gather
  • GET /api/gathers/{gatherId}/players - Gets the list of players in the gather

Author

You can reach out to me @radude89 or find me on Stack Overflow.