{"id":19796704,"url":"https://github.com/fahadpathan7/sust-ftms-backend","last_synced_at":"2026-05-04T17:35:38.274Z","repository":{"id":196380818,"uuid":"695784151","full_name":"fahadPathan7/SUST-FTMS-Backend","owner":"fahadPathan7","description":"Elevate the game with our SUST Football Tournament Management System. Seamlessly manage fixtures, scores, and teams to enhance the football experience at SUST.","archived":false,"fork":false,"pushed_at":"2023-11-17T12:52:04.000Z","size":90,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T16:12:31.888Z","etag":null,"topics":["golang","json","jwt","mysql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fahadPathan7.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-24T08:00:24.000Z","updated_at":"2024-01-22T09:17:58.000Z","dependencies_parsed_at":"2024-11-12T07:32:42.446Z","dependency_job_id":null,"html_url":"https://github.com/fahadPathan7/SUST-FTMS-Backend","commit_stats":null,"previous_names":["fahadpathan7/ftms-backend","fahadpathan7/sust-ftms-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fahadPathan7/SUST-FTMS-Backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahadPathan7%2FSUST-FTMS-Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahadPathan7%2FSUST-FTMS-Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahadPathan7%2FSUST-FTMS-Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahadPathan7%2FSUST-FTMS-Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fahadPathan7","download_url":"https://codeload.github.com/fahadPathan7/SUST-FTMS-Backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahadPathan7%2FSUST-FTMS-Backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32618116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","json","jwt","mysql"],"created_at":"2024-11-12T07:21:08.134Z","updated_at":"2026-05-04T17:35:38.233Z","avatar_url":"https://github.com/fahadPathan7.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# My RESTful API\n\nThis comprehensive RESTful API facilitates the management of tournaments, players, teams, referees, and other essential components.\n\n**Note:** For PUT and POST operations, ensure that all required information is provided.\n\n## Table of Contents\n- [JSON Web Token](#jwt)\n- [Operator](#operator)\n- [Department](#department)\n- [Player](#player)\n- [Teacher](#teacher)\n- [Team Manager](#team-manager)\n- [Team](#team)\n- [Tournament](#tournament)\n- [Referee](#referee)\n- [Match](#match)\n- [Starting Eleven](#starting-eleven)\n- [Individual Punishment](#individual-punishment)\n- [Individual Score](#individual-score)\n- [Tiebreaker](#tiebreaker)\n- [Setting up the backend](#setting-up-the-backend)\n\n\n## Endpoints\n\n### \u003ca name=\"jwt\"\u003e\u003c/a\u003e JSON Web Token\n\n- `GET /api/token/generate/{userEmail}` - Generate token\n- `GET /api/token/validate` - Validate token\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"operator\"\u003e\u003c/a\u003e Operator\n\n- `POST /api/operator/login` - Operator login\n- `GET /api/operator/{email}` - Get operator info (password will be null)\n\n**Note:** to login as operator only email and password is required.\n\n**A JSON sample for operator**\n```json\n{\n  \"email\": \"YourEmail\",\n  \"password\": \"YourPassword\",\n  \"name\": \"YourName\",\n  \"office\": \"YourOffice\"\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"department\"\u003e\u003c/a\u003e Department\n\n- `POST /api/dept` - Insert a new department\n- `PUT /api/dept/{deptCode}` - Update a department\n- `GET /api/depts` - Get all departments\n- `GET /api/dept/{deptCode}` - Get a specific department\n- `DELETE /api/dept/{deptCode}` - Delete a department\n\n**A JSON sample for department**\n```json\n{\n  \"deptCode\": 1,\n  \"deptName\": \"Department Name\",\n  \"deptHeadName\": \"Department Head Name\",\n  \"deptShortName\": \"DeptShortName\"\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"player\"\u003e\u003c/a\u003e Player\n\n- `POST /api/player` - Insert a new player\n- `POST /api/player/login` - Login a player\n- `PUT /api/player/{playerRegNo}` - Update a player\n- `GET /api/player/{playerRegNo}` - Get a specific player\n- `GET /api/dept/players/{deptCode}` - Get all players of a department\n- `DELETE /api/player/{playerRegNo}` - Delete a player\n\n**Note:** to login as player only email and password is required.\n\n**A JSON sample for player**\n```json\n{\n  \"playerRegNo\": 1,\n  \"playerName\": \"Player Name\",\n  \"playerDeptCode\": 1,\n  \"playerEmail\": \"abc@student.sust.edu\",\n  \"playerPassword\": \"***\",\n  \"playerImage\": \"local loc\"\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"teacher\"\u003e\u003c/a\u003e Teacher\n\n- `POST /api/techer` - Insert a new teacher\n- `GET /api/teacher/{email}` - Get a teacher\n- `GET /api/teachers/{deptCode}` - Get all the teachers of a dept\n\n**A JSON sample for teacher**\n```json\n{\n  \"email\": \"teacher email\",\n  \"name\": \"teacher name\",\n  \"deptCode\": 1,\n  \"title\": \"lecturer\"\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"team-manager\"\u003e\u003c/a\u003e Team Manager\n\n- `POST /api/teammanager` - Insert a new team manager in a tournament\n- `GET /api/teammanager/{tournamentId}/{email}` - Get a team manager of a tournament\n- `GET /api/teammanagers/{tournamentId}` - Get all team managers of a tournament\n- `DELETE /api/tournament/teammanager/{tournamentId}/{teamManagerEmail}` - Delete a team manager of a tournament\n\n**A JSON sample for team manager**\n```json\n{\n  \"email\": \"Manager email\",\n  \"TournamentId\": \"TournamentID\"\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"team\"\u003e\u003c/a\u003e Team\n\n- `POST /api/team` - Insert a new team\n- `PUT /api/tournament/team/{tournamentId}/{deptCode}` - Update a team\n- `GET /api/tournament/team/{tournamentId}/{deptCode}` - Get a team\n- `GET /api/tournament/teams/{tournamentId}` - Get all teams of a tournament\n- `DELETE /api/tournament/team/{tournamentId}/{deptCode}` - Delete a team\n\n**A JSON sample for team**\n```json\n{\n  \"tournamentId\": \"Tournament ID\",\n  \"teamSubmissionDate\": \"Submission Date\",\n  \"deptCode\": 1,\n  \"teamManagerEmail\": \"Team Manager\",\n  \"teamCaptainRegID\": 1,\n  \"playerRegNo\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],\n  \"isKnockedOut\": false\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"tournament\"\u003e\u003c/a\u003e Tournament\n\n- `POST /api/tournament` - Insert a new tournament\n- `PUT /api/tournament/{tournamentId}` - Update a tournament\n- `GET /api/tournaments` - Get all tournaments\n- `GET /api/tournament/{tournamentId}` - Get a specific tournament\n- `DELETE /api/tournament/{tournamentId}` - Delete a tournament\n\n**A JSON sample for tournament**\n```json\n{\n  \"tournamentId\": \"Tournament ID\",\n  \"tournamentName\": \"Tournament Name\",\n  \"startingDate\": \"Starting Date\",\n  \"endingDate\": \"Ending Date\"\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"referee\"\u003e\u003c/a\u003e Referee\n\n- `POST /api/referee` - Insert a new referee\n- `PUT /api/referee/{refereeId}` - Update a referee\n- `GET /api/referees` - Get all referees\n- `GET /api/referee/{refereeId}` - Get a specific referee\n- `DELETE /api/referee/{refereeId}` - Delete a specific referee\n\n**A JSON sample for referee**\n```json\n{\n  \"refereeID\": 1,\n  \"refereeName\": \"Referee Name\",\n  \"refereeInstitute\": \"Referee Institute\"\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"match\"\u003e\u003c/a\u003e Match\n\n- `POST /api/match` - Insert a new match\n- `PUT /api/match/{tournamentId}/{matchId}` - Update a match\n- `GET /api/tournament/matches/{tournamentId}` - Get all matches of a tournament\n- `GET /api/tournament/match/{tournamentId}/{matchId}` - Get a specific match in a tournament\n- `DELETE /api/match/{tournamentId}/{matchId}` - Delete a match\n\n**Note:** For POST, everything can be nill except tournamentId and matchId.\n\n**A JSON sample for match**\n```json\n{\n  \"tournamentId\": \"Tournament ID\",\n  \"matchId\": \"Match ID\",\n  \"matchDate\": \"Match Date\",\n  \"team1DeptCode\": 1,\n  \"team2DeptCode\": 2,\n  \"team1Score\": 3,\n  \"team2Score\": 4,\n  \"winnerTeamDeptCode\": 1,\n  \"matchRefereeID\": 5,\n  \"matchLinesman1ID\": 6,\n  \"matchLinesman2ID\": 7,\n  \"matchFourthRefereeID\": 8,\n  \"venue\": \"SUST Central Field\"\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"starting-eleven\"\u003e\u003c/a\u003e Starting Eleven\n\n- `POST /api/match/startingeleven` - Insert a new starting eleven\n- `PUT /api/match/startingeleven/{tournamentId}/{matchId}/{teamDeptCode}` - Update a starting eleven\n- `GET /api/match/startingeleven/{tournamentId}/{matchId}/{deptCode}` - Get the starting eleven of a team in a match\n- `DELETE /api/match/startingeleven/{tournamentId}/{matchId}/{teamDeptCode}` - Delete a starting eleven\n\n**A JSON sample for starting eleven**\n```json\n{\n  \"tournamentId\": \"Tournament ID\",\n  \"matchId\": \"Match ID\",\n  \"teamDeptCode\": 1,\n  \"startingPlayerRegNo\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],\n  \"substitutePlayerRegNo\": [12, 13, 14],\n  \"substituedPlayerRegNo\": [1, 2, 3]\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"individual-punishment\"\u003e\u003c/a\u003e Individual Punishment\n\n- `POST /api/individualpunishment` - Insert a new individual punishment\n- `PUT /api/individualpunishment/{tournamentId}/{matchId}/{playerRegNo}` - Update an individual punishment\n- `GET /api/tournament/individualpunishments/{tournamentId}` - Get all individual punishments (all players) of a tournament\n- `GET /api/tournament/match/team/individualpunishments/{tournamentId}/{matchId}/{teamDeptCode}` - Get all individual punishments of a match by a team\n- `GET /api/tournament/player/individualpunishments/{tournamentId}/{playerRegNo}` - Get all individual punishments of a player in a tournament\n- `DELETE /api/individualpunishment/{tournamentId}/{matchId}/{playerRegNo}` - Delete an individual punishment\n\n**A JSON sample for individual punishment**\n```json\n{\n  \"tournamentId\": \"Tournament ID\",\n  \"matchId\": \"Match ID\",\n  \"playerRegNo\": 1,\n  \"teamDeptCode\": 1,\n  \"punishmentType\": \"Punishment Type\"\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"individual-score\"\u003e\u003c/a\u003e Individual Score\n\n- `POST /api/individualscore` - Insert a new individual score\n- `PUT /api/individualscore/{tournamentId}/{matchId}/{playerRegNo}` - Update an individual score\n- `GET /api/tournament/individualscores/{tournamentId}` - Get all individual scores (all players) of a tournament\n- `GET /api/tournament/player/individualscores/{tournamentId}/{playerRegNo}` - Get all individual scores of a player in a tournament\n- `GET /api/tournament/match/team/individualscores/{tournamentId}/{matchId}/{teamDeptCode}` - Get all individual scores of a match by a team\n- `DELETE /api/individualscore/{tournamentId}/{matchId}/{playerRegNo}` - Delete an individual score\n\n**A JSON sample for individual score**\n```json\n{\n  \"tournamentId\": \"Tournament ID\",\n  \"matchId\": \"Match ID\",\n  \"playerRegNo\": 1,\n  \"teamDeptCode\": 1,\n  \"goals\": 2\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n### \u003ca name=\"tiebreaker\"\u003e\u003c/a\u003e Tiebreaker\n\n- `POST /api/tiebreaker` - Insert a new tiebreaker\n- `PUT /api/tiebreaker/{tournamentId}/{matchId}` - Update a tiebreaker\n- `GET /api/tournament/tiebreakers/{tournamentId}` - Get all tiebreakers of a tournament\n- `GET /api/tournament/tiebreaker/{tournamentId}/{matchId}` - Get a tiebreaker of a match of a tournament\n- `DELETE /api/tiebreaker/{tournamentId}/{matchId}` - Delete a tiebreaker\n\n**A JSON sample for tiebreaker**\n```json\n{\n  \"tournamentId\": \"Tournament ID\",\n  \"matchId\": \"Match ID\",\n  \"team1DeptCode\": 1,\n  \"team2DeptCode\": 2,\n  \"team1TieBreakerScore\": 3,\n  \"team2TieBreakerScore\": 4\n}\n```\n\u003cbr\u003e\u003cbr\u003e\n## \u003ca name=\"setting-up-the-backend\"\u003e\u003c/a\u003e Setting Up the Backend\n\n**1. Database Setup**\n\n- Create a database named `ftms` in MySQL (XAAMP).\n\n**2. Table Creation**\n\n- Copy the codes inside `allTables.txt` file from the `Database` folder.\n- Paste the contents of `allTables.txt` into your MySQL client (XAAMP) and execute the script to create the necessary tables.\n\n**3. Running the Backend**\n\n- Open the project in VS Code.\n- Run the `main.go` file to start the backend server.\n\n**Congratulations! You're now ready to work with the backend.**\n\n---\n\nThank you for reviewing the documentation for My RESTful API. This API is designed to provide a comprehensive and user-friendly interface for managing tournaments, players, teams, referees, and other essential components for the SUST Football Tournament Management System.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffahadpathan7%2Fsust-ftms-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffahadpathan7%2Fsust-ftms-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffahadpathan7%2Fsust-ftms-backend/lists"}