TeamSync is a robust backend service built with Go (Golang) for managing collaborative team workflows. It features a complete system for users, teams, memberships, tasks, and comments, backed by a PostgreSQL database for relational data and Redis for high-performance caching/session management.
The project follows a clean, modular architecture, utilizing gorilla/mux for routing and separating concerns into controllers, models, and data access layers (store).
- Authentication: Secure registration and login with JWT-based session management.
- User Management: Create, view, update, and delete user profiles.
- Team & Membership: Create teams, assign leaders, and manage team members with specific roles.
- Task Management: Full lifecycle management for tasks (Create, Read, Update, Delete) with statuses (Todo, In Progress, Done) and priorities.
- Comments: Collaboration features allowing users to add comments to specific tasks.
- Performance: Redis integration for optimized data handling.
Before running the project, ensure you have the following installed:
- Go (version 1.22 or later)
- PostgreSQL
- Redis
-
Clone the Repository
git clone https://github.com/drumilbhati/teamsync.git cd teamsync -
Install Dependencies
go mod tidy
-
Database Configuration
- PostgreSQL: Create a database named
teamsyncand run your schema migration scripts.CREATE DATABASE teamsync;
- Redis: Ensure your Redis server is running (default:
localhost:6379).
- PostgreSQL: Create a database named
-
Environment Variables Create a
.envfile in the root directory and populate it with your configuration:# Server Configuration PORT=8080 # PostgreSQL Configuration DB_HOST=localhost DB_PORT=5432 DB_USER=your_postgres_user DB_PASSWORD=your_postgres_password DB_NAME=teamsync # Redis Configuration REDIS_ADDR=localhost:6379 REDIS_PASSWORD= REDIS_DB=0
Start the server using:
go run main.goThe server will start (default port: 8080).
For production deployment, this project is optimized to run using Docker Compose.
docker-compose up -d --buildFor detailed AWS setup (Security Groups, Swap Space, and Nginx proxying), refer to the AWS Deployment Guide.
Quick start on EC2 (Ubuntu 24.04):
- Prepare Server: Install Docker and Docker Compose.
- Transfer Code: Use
rsyncto upload the project. - Configure Environment: Create a production
.envfile on the server. - Launch:
sudo docker-compose up -d --build
POST /auth/register- Register a new userPOST /auth/login- Login and receive a JWTPOST /auth/verify- Verify user email
GET /api/users- List all usersGET /api/user/{id}- Get user detailsPUT /api/user/{id}- Update user detailsDELETE /api/user/{id}- Delete a user
POST /api/team- Create a new teamGET /api/team?user_id={id}- Get teams for a specific userGET /api/team/{id}- Get specific team detailsPUT /api/team/{id}- Update a teamDELETE /api/team/{id}- Delete a team
POST /api/member- Add a member to a teamGET /api/member?team_id={id}- Get all members of a teamGET /api/member/{id}- Get specific membership detailsPUT /api/member/{id}- Update membership roleDELETE /api/member/{id}- Remove a member
POST /api/task- Create a new taskGET /api/task?team_id={id}- Get all tasks for a teamGET /api/task/{id}- Get specific task detailsPUT /api/task/{id}- Update a task (status, assignee, etc.)DELETE /api/task/{id}- Delete a task
POST /api/comment- Add a comment to a taskGET /api/comment/{task_id}- Get all comments for a specific task