Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rayyan-Oumlil/Taskify

Repository files navigation

Task Management Application

A full-stack distributed task management system built with Go microservices backend and Next.js frontend.

Architecture Overview

┌─────────────┐
│   Client    │
└──────┬──────┘
       │
       ▼
┌─────────────────┐
│   API Gateway   │ (Port 8080)
└────────┬─────────┘
         │
    ┌────┴────┬──────────────┐
    │         │              │
    ▼         ▼              ▼
┌────────┐ ┌────────┐ ┌──────────────┐
│  Task  │ │  User  │ │ Notification │
│Service │ │Service │ │   Service   │
│ :8081  │ │ :8082  │ │    :8083     │
└───┬────┘ └───┬────┘ └──────┬───────┘
    │          │             │
    ▼          ▼             ▼
┌────────┐ ┌────────┐ ┌──────────────┐
│Task DB│ │User DB │ │Notification  │
│ :5433  │ │ :5434  │ │    DB :5435  │
└────────┘ └────────┘ └──────────────┘

Microservices

  • API Gateway (cmd/api-gateway/) - Port 8080
  • Task Service (cmd/task-service/) - Port 8081
  • User Service (cmd/user-service/) - Port 8082
  • Notification Service (cmd/notification-service/) - Port 8083
  • Project Service (cmd/project-service/) - Port 8084
  • Team Service (cmd/team-service/) - Port 8085
  • Document Service (cmd/document-service/) - Port 8086
  • Chat Service (cmd/chat-service/) - Port 8087

Technology Stack

Backend:

  • Go 1.21+
  • PostgreSQL 15
  • Gin-Gonic
  • Docker & Docker Compose

Frontend:

  • Next.js 16
  • TypeScript
  • React 19
  • Tailwind CSS
  • shadcn/ui

Project Structure

TaskAPP/
├── cmd/              # Microservices entry points
├── internal/         # Service logic (handler, service, repository)
├── pkg/              # Shared packages (database, config, middleware)
├── taskapp/          # Next.js frontend
├── docker-compose.yml
└── Dockerfile.*

Setup

Using Docker Compose

  1. Start all services:

    docker-compose up --build
  2. Verify services:

    docker-compose ps
  3. Check logs:

    docker-compose logs -f [service-name]

Running Locally

  1. Set environment variables (see env.example)

  2. Run services:

    go run cmd/task-service/main.go
    go run cmd/user-service/main.go
    go run cmd/notification-service/main.go
    go run cmd/api-gateway/main.go

Running Frontend

  1. Navigate to frontend:

    cd taskapp
    npm install
  2. Set environment variables: Create .env.local:

    NEXT_PUBLIC_API_URL=http://localhost:8080
    
  3. Run development server:

    npm run dev

API Documentation

All requests go through the API Gateway at http://localhost:8080.

User Service

  • POST /users/register - Register new user
  • POST /users/login - User login
  • GET /users - Get all users
  • GET /users/:id - Get user by ID

Task Service

  • GET /tasks - Get all tasks
  • GET /tasks/:id - Get task by ID
  • POST /tasks - Create task
  • PUT /tasks/:id - Update task
  • DELETE /tasks/:id - Delete task

Notification Service

  • POST /notifications - Create notification
  • GET /notifications/:userId - Get notifications by user

Health Check

  • GET /health - Service health status

Database Schema

Tasks:

CREATE TABLE tasks (
    id SERIAL PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    description TEXT,
    status VARCHAR(50) NOT NULL DEFAULT 'pending',
    user_id INTEGER NOT NULL,
    created_at TIMESTAMP NOT NULL DEFAULT NOW(),
    updated_at TIMESTAMP NOT NULL DEFAULT NOW()
);

Users:

CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    username VARCHAR(100) NOT NULL UNIQUE,
    email VARCHAR(255) NOT NULL UNIQUE,
    password_hash VARCHAR(255) NOT NULL,
    created_at TIMESTAMP NOT NULL DEFAULT NOW()
);

Notifications:

CREATE TABLE notifications (
    id SERIAL PRIMARY KEY,
    user_id INTEGER NOT NULL,
    message TEXT NOT NULL,
    task_id INTEGER,
    read BOOLEAN NOT NULL DEFAULT FALSE,
    created_at TIMESTAMP NOT NULL DEFAULT NOW()
);

Development

Build services:

go build -o bin/task-service ./cmd/task-service
go build -o bin/user-service ./cmd/user-service
go build -o bin/notification-service ./cmd/notification-service
go build -o bin/api-gateway ./cmd/api-gateway

Run tests:

go test ./...

Stop services:

docker-compose down

Troubleshooting

  • Port conflicts: Change PORT environment variable
  • Database errors: Verify PostgreSQL is running and credentials are correct
  • Service unreachable: Check Docker network configuration

About

Microservices task management application built with Go backend and Next.js frontend. Features include task management, user authentication, project tracking, document management, and real-time chat.

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages