Sportify
Finding individuals or groups with similar sports interests and organizing events can be challenging, especially for those new to a city or seeking partners with specific skill levels. Traditional methods of connecting, such as word of mouth or social media, are often inefficient and lack tailored options for event management. This gap leads to missed opportunities for engagement, limited access to recreational or competitive activities, and reduced motivation to stay active. The lack of a centralized platform that combines event creation, user matching, and seamless communication highlights the need for a solution to bring sports enthusiasts together efficiently and effectively.
Sportify is a web-based platform designed to connect individuals with similar sports interests, making it easier for people to engage in recreational or competitive activities. Users can create and join sports events in their area, customize event details like location, time and interact with others through integrated chat features. The platform includes user profiles for event browsing and location-based filtering to find nearby events. By fostering an active community, the platform encourages social connections and healthy lifestyles while providing an intuitive interface for seamless event management and communication among sports enthusiasts.
- Abdul Kalam Azad Shaik - Backend Engineer
- Hamsini Sivalenka - Backend Engineer
- Manav Mishra - Frontend Engineer
- Sonika Goud Yeada - Frontend Engineer
This project is focused on building the backend for Sportify, a platform to connect individuals through sports events and activities. We are using Go for backend development and PostgreSQL as the database. The backend will manage various features such as user profiles, event management, and communication between users.
You can track the status on our project page: GitHub Project Board.
backend/
bin/ # Contains files required by air for live reloading
cmd/
api/ # All API implementation code
migrate/ # Database migrations
internal/
db/ # Database connection and configurations
env/ # Environment configuration management
store/ # CRUD and other DB operations
Makefile # Handles migration and other commands
.envrc # Environment variable loader for direnv
-
bin/: This folder contains files necessary for air to perform its live reloading functionality.
-
cmd/: This folder contains the core application code. Subfolders include:
api/: Implements the API endpoints.migrate/: Contains database migration scripts.
-
internal/: Houses internal application logic that is isolated from the external API. Subfolders include:
db/: Manages the database connection and related tasks.env/: Manages loading and handling environment variables.store/: Implements CRUD operations and other database queries.
Here are the primary tools and packages we use to streamline development and maintain code quality:
-
go-chi
- Description: Lightweight and idiomatic HTTP router for Go.
- Purpose: Used for routing and middleware management.
- URL: go-chi/chi
-
air
- Description: Live server reloading tool.
- Purpose: Automatically reloads the server when changes are detected.
- URL: air
-
go-validator
- Description: A powerful request validation package for Go.
- Purpose: Used to validate incoming request fields.
- URL: go-playground/validator
-
direnv
- Description: Environment variable manager that loads variables from
.envrcfiles. - Purpose: Simplifies the loading and handling of environment variables.
- URL: direnv
- Description: Environment variable manager that loads variables from
-
TablePlus
- Description: Database management tool.
- Purpose: Allows easy creation of tables and insertion of dummy data for development.
- URL: TablePlus
-
Docker
- Description: Containerization platform.
- Purpose: Used to run PostgreSQL locally during development.
Ensure the following are installed on your machine:
Create an .envrc file in the root directory with the necessary environment variables. Example:
POSTGRES_USER=your_db_username
POSTGRES_PASSWORD=your_db_password
POSTGRES_DB=your_database_name
APP_PORT=8080Run direnv allow to load the environment variables automatically.
Run the following command to start the PostgreSQL container:
docker compose up --buildUse the following command to install project dependencies:
go mod tidyInstall postgres and setup the database by running the migrations listed in the backend folder
For live reloading, use the air tool:
airIf you don't have air installed, use:
go run cmd/api/main.goFor the frontend first do
npm installthen
npm startThe Makefile provides common commands to simplify development tasks.
-
Create Migrations:
make migration some_file_name
-
Run Migrations:
make migrate-up
-
Rollback Migrations:
make migrate-down
Feel free to add more commands as needed.
- Clone the repository and set up your environment using the steps outlined above.
- Use air for live reloading or go run for manual server restarts.
- Implement features in the appropriate folders under
internal/andcmd/. - Validate API requests using go-validator.
- Connect to the database using TablePlus to inspect and manage data.
- Use Makefile commands to handle database migrations.
- Coding Standards: Follow Go's idiomatic best practices.
- Branching: Use feature branches for new work.
- Commit Messages: Write clear, concise commit messages.
- Pull Requests: Ensure all pull requests are reviewed before merging.
- Testing: Write unit tests for all new features and bug fixes.
If you have any questions or run into issues, please create an issue and track the status on our GitHub project page: GitHub Project Board.
Happy coding!