Skip to content

josueguido/TaskFlow-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TaskFlow App

Status Node.js React TypeScript PostgreSQL Docker License

A comprehensive full-stack project and task management system built with modern web technologies. TaskFlow provides an intuitive interface for managing projects, tasks, team members, and business workflows.

πŸ“‹ Table of Contents

🎯 Overview

TaskFlow is a full-stack application designed to streamline project and task management. It consists of:

  • Frontend: A modern React application with TypeScript and Vite for fast development
  • Backend: A robust Node.js API with Express.js and PostgreSQL
  • Database: PostgreSQL for reliable data persistence
  • Infrastructure: Docker Compose for easy deployment and development

πŸš€ Features

Core Functionality

  • Project Management: Create, organize, and manage multiple projects
  • Task Management: Full CRUD operations for tasks with detailed tracking
  • User Assignment: Assign team members to tasks with role-based permissions
  • Task History: Track changes and history of tasks over time
  • Business Management: Organize tasks within business units
  • Reports: Generate reports on task progress and team performance
  • Calendar View: Visualize tasks and deadlines in a calendar interface
  • Kanban Board: Drag-and-drop interface for task management

Technical Features

  • Type Safety: Full TypeScript implementation across frontend and backend
  • Authentication: JWT-based authentication with secure password hashing
  • Security: Helmet, CORS, rate limiting, SQL injection prevention
  • Validation: Zod schema validation and express-validator
  • API Documentation: Swagger/OpenAPI documentation
  • Logging: Structured logging with Winston
  • Testing: Jest testing framework
  • Code Quality: ESLint and Prettier integration
  • Hot Reload: Development server with instant refresh
  • Responsive Design: Mobile-friendly UI with Tailwind CSS

πŸ› οΈ Tech Stack

Frontend

  • React 19 - UI library
  • TypeScript - Type-safe development
  • Vite - Next generation build tool
  • Tailwind CSS - Utility-first CSS framework
  • Zustand - State management
  • React Router - Client-side routing
  • React Hook Form - Form management
  • Axios - HTTP client
  • Lucide React - Icon library
  • Zod - Schema validation
  • DnD Kit - Drag and drop functionality
  • React Big Calendar - Calendar component

Backend

  • Node.js - Runtime environment
  • Express.js - Web framework
  • TypeScript - Type-safe development
  • PostgreSQL - Relational database
  • JWT - Authentication tokens
  • Bcrypt - Password hashing
  • Zod - Schema validation
  • Winston - Logging
  • Jest - Testing framework
  • Swagger - API documentation

Infrastructure

  • Docker - Containerization
  • Docker Compose - Multi-container orchestration
  • PostgreSQL 15 - Database
  • PgAdmin - Database management

πŸ“‹ Prerequisites

  • Node.js v20 or higher
  • PostgreSQL v15 or higher (or Docker)
  • npm or yarn
  • Git
  • Docker & Docker Compose (optional, for containerized deployment)

πŸš€ Quick Start

Option 1: Development with Docker Compose (Recommended)

# Clone the repository
git clone https://github.com/josueguido/TaskFlow-App
cd TaskFlow-App

# Create environment file
cp .env.example .env

# Start the application
docker-compose up -d

# Access the application
# Frontend: http://localhost:5173
# Backend: http://localhost:3000
# Backend API Docs: http://localhost:3000/api-docs

Option 2: Local Development

Backend Setup

cd backend

# Install dependencies
npm install

# Create environment file
cp .env.example .env

# Update .env with your database credentials
# DB_HOST=localhost
# DB_PORT=5432
# DB_NAME=taskflow

# Run database migrations
psql -U postgres -d taskflow -f ../db/init.sql
psql -U postgres -d taskflow -f ../db/seed.sql

# Start development server
npm run dev

# Server runs on http://localhost:3000

Frontend Setup

cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

# Application runs on http://localhost:5173

πŸ“ Project Structure

TaskFlow-App/
β”œβ”€β”€ backend/                     # Express.js API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/        # Route controllers
β”‚   β”‚   β”œβ”€β”€ models/             # Database models
β”‚   β”‚   β”œβ”€β”€ routes/             # API routes
β”‚   β”‚   β”œβ”€β”€ services/           # Business logic
β”‚   β”‚   β”œβ”€β”€ schemas/            # Zod validation schemas
β”‚   β”‚   β”œβ”€β”€ middlewares/        # Custom middlewares
β”‚   β”‚   β”œβ”€β”€ interfaces/         # TypeScript interfaces
β”‚   β”‚   β”œβ”€β”€ config/             # Configuration files
β”‚   β”‚   β”œβ”€β”€ utils/              # Utility functions
β”‚   β”‚   β”œβ”€β”€ validators/         # Validation logic
β”‚   β”‚   └── app.ts              # Express app setup
β”‚   β”œβ”€β”€ tests/                  # Test files
β”‚   β”œβ”€β”€ Dockerfile              # Production Docker image
β”‚   β”œβ”€β”€ Dockerfile.dev          # Development Docker image
β”‚   β”œβ”€β”€ jest.config.js          # Jest configuration
β”‚   β”œβ”€β”€ tsconfig.json           # TypeScript configuration
β”‚   └── package.json            # Dependencies
β”‚
β”œβ”€β”€ frontend/                    # React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/                # API client methods
β”‚   β”‚   β”œβ”€β”€ components/         # React components
β”‚   β”‚   β”œβ”€β”€ contexts/           # React Context API
β”‚   β”‚   β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ services/           # Business logic services
β”‚   β”‚   β”œβ”€β”€ store/              # Zustand store
β”‚   β”‚   β”œβ”€β”€ types/              # TypeScript types
β”‚   β”‚   β”œβ”€β”€ utils/              # Utility functions
β”‚   β”‚   β”œβ”€β”€ assets/             # Static assets
β”‚   β”‚   β”œβ”€β”€ App.tsx             # Main component
β”‚   β”‚   └── main.tsx            # Entry point
β”‚   β”œβ”€β”€ nginx/                  # Nginx config for Docker
β”‚   β”œβ”€β”€ public/                 # Static files
β”‚   β”œβ”€β”€ Dockerfile              # Production Docker image
β”‚   β”œβ”€β”€ Dockerfile.dev          # Development Docker image
β”‚   β”œβ”€β”€ vite.config.ts          # Vite configuration
β”‚   β”œβ”€β”€ tsconfig.json           # TypeScript configuration
β”‚   └── package.json            # Dependencies
β”‚
β”œβ”€β”€ db/                         # Database files
β”‚   β”œβ”€β”€ init.sql               # Database initialization
β”‚   └── seed.sql               # Sample data
β”‚
β”œβ”€β”€ infra/                      # Infrastructure configuration
β”‚   └── pgadmin/               # PgAdmin configuration
β”‚
β”œβ”€β”€ docker-compose.yml          # Development docker-compose
β”œβ”€β”€ docker-compose.prod.yml     # Production docker-compose
└── README.md                   # This file

πŸ”§ Environment Configuration

About .env Files

The backend uses environment variables in two scenarios:

  • Local Development (without Docker): Environment variables are loaded from backend/config/DB/.env.dev
  • Docker Environment: Environment variables are passed through docker-compose.yml and the root .env file (no need to use config/DB/.env files)

The backend automatically detects the environment and loads the appropriate configuration:

// In backend/src/config/DB/index.ts
dotenv.config({
  path: process.env.NODE_ENV === 'production'
    ? './config/DB/.env.production'
    : './config/DB/.env.dev',
});

Backend Environment Variables (.env)

# Server Configuration
NODE_ENV=development
PORT=3000

# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=taskflow
DB_USERNAME=postgres
DB_PASSWORD=your_secure_password

# JWT Configuration
JWT_SECRET=your_jwt_secret
JWT_EXPIRATION=24h

# CORS Configuration
CORS_ORIGIN=http://localhost:5173

# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100

# Logging
LOG_LEVEL=debug

Frontend Environment Variables (.env)

VITE_API_URL=http://localhost:3000
VITE_API_BASE_PATH=/api

πŸ’» Development

Backend Development

cd backend

# Install dependencies
npm install

# Start development server with hot reload
npm run dev

# Run tests
npm run test

# Run linter
npm run lint

# Format code
npm run format

# Build for production
npm run build

Frontend Development

cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

# Run linter
npm run lint

🐳 Docker Deployment

Development Environment

# Build and start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

# Stop and remove volumes
docker-compose down -v

Production Environment

# Build and start with production configuration
docker-compose -f docker-compose.prod.yml up -d

# View logs
docker-compose -f docker-compose.prod.yml logs -f

# Stop services
docker-compose -f docker-compose.prod.yml down

Service Management

# View running containers
docker-compose ps

# Access backend logs
docker-compose logs backend

# Access frontend logs
docker-compose logs frontend

# Access database logs
docker-compose logs db

# Execute command in backend container
docker-compose exec backend npm run lint

# Connect to database
docker-compose exec db psql -U postgres -d taskflow

πŸ—„οΈ Database

Database Schema

The application uses PostgreSQL with the following main entities:

  • users - User accounts and authentication
  • roles - User roles and permissions
  • businesses - Business units
  • projects - Project management
  • tasks - Task tracking
  • task_history - Task change history
  • assignments - User-task assignments
  • status - Task status definitions
  • refresh_tokens - JWT token management

Database Initialization

The database is automatically initialized using SQL scripts:

  1. 01-init.sql - Creates tables and schema
  2. 02-seed.sql - Populates sample data

Database Management

Access PgAdmin at http://localhost:5050 (if running with Docker Compose)

# Backup database
docker-compose exec db pg_dump -U postgres taskflow > backup.sql

# Restore database
docker-compose exec -T db psql -U postgres taskflow < backup.sql

# Connect directly
psql -h localhost -U postgres -d taskflow

πŸ“š API Documentation

Swagger/OpenAPI Documentation

Once the backend is running, access the interactive API documentation:

http://localhost:3000/api-docs

Main API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user
  • POST /api/auth/refresh - Refresh JWT token
  • POST /api/auth/logout - Logout user

Users

  • GET /api/users - Get all users
  • GET /api/users/:id - Get user by ID
  • PUT /api/users/:id - Update user
  • DELETE /api/users/:id - Delete user

Projects

  • GET /api/projects - Get all projects
  • POST /api/projects - Create project
  • GET /api/projects/:id - Get project by ID
  • PUT /api/projects/:id - Update project
  • DELETE /api/projects/:id - Delete project

Tasks

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

Assignments

  • GET /api/assignments - Get all assignments
  • POST /api/assignments - Create assignment
  • DELETE /api/assignments/:id - Delete assignment

Reports

  • GET /api/reports - Generate reports

For complete API documentation, see the Backend README and the Swagger documentation.

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Workflow

  1. Create a new branch from main or develop
  2. Make your changes
  3. Run tests and linting: npm run test && npm run lint
  4. Commit with meaningful messages
  5. Submit a Pull Request

Code Quality

  • Follow the existing code style
  • Use TypeScript for type safety
  • Write tests for new features
  • Keep commits atomic and meaningful

πŸ“ License

This project is licensed under the ISC License - see the LICENSE file for details.

πŸ—ΊοΈ Roadmap

TaskFlow is actively under development with the following planned features and improvements:

Phase 1: Core Features (In Progress)

  • βœ… Project and task management
  • βœ… User authentication and authorization
  • βœ… Kanban board interface
  • βœ… Calendar view
  • βœ… Reporting and analytics
  • βœ… Team management
  • πŸ”„ Enhanced error handling and validation

Phase 2: DevOps & Infrastructure (Upcoming)

  • ⏳ CI/CD Pipeline: GitHub Actions/GitLab CI for automated testing and deployment
  • ⏳ Terraform: Infrastructure as Code for AWS resource management
  • ⏳ AWS Deployment: Production deployment on AWS (EC2, RDS, S3)
  • ⏳ Kubernetes: Container orchestration for scalable deployments
  • ⏳ Observability: Monitoring, logging, and tracing (Prometheus, ELK Stack, Jaeger, cAdvisor)
  • ⏳ Makefiles: Simplified development and deployment workflows

Phase 3: Advanced Features (Future)

  • ⏳ Real-time notifications and WebSocket support (Using SNS, SQS and EventBridge)
  • ⏳ Advanced filtering and search capabilities
  • ⏳ Custom workflows and automation
  • ⏳ Integration with third-party services
  • ⏳ Mobile app support
  • ⏳ Audit logging and compliance features

πŸ‘₯ Contact

Project Owner: Josue Guido Repository: https://github.com/josueguido/TaskFlow-App

For questions or suggestions, please open an issue on GitHub.


Last Updated: December 2024 Current Branch: fix-bugs

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages