Skip to content

manoj-procore/task-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Task Management Application

A full-stack task management application built with React (Frontend) and Spring Boot (Backend), using PostgreSQL as the database.

πŸ—οΈ Architecture

  • Frontend: React 19 + TypeScript + Vite
  • Backend: Spring Boot 3.5.3 + Java 17
  • Database: PostgreSQL 16
  • Containerization: Docker & Docker Compose

πŸ“‹ Prerequisites

For Docker Setup (Recommended)

For Local Development Setup

πŸš€ Quick Start with Docker (Recommended)

1. Clone the Repository

git clone https://github.com/ansh-procore/full-stack-app.git
cd task-App

2. Build and Run with Docker Compose

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

# Or run in detached mode
docker-compose up --build -d

3. Access the Application

4. Stop the Application

# Stop all services
docker-compose down

# Stop and remove volumes (clears database data)
docker-compose down -v

πŸ› οΈ Local Development Setup

Database Setup

  1. Install and start PostgreSQL
  2. Create a database:
CREATE DATABASE taskDB;
CREATE USER postgres WITH PASSWORD 'postgres';
GRANT ALL PRIVILEGES ON DATABASE taskDB TO postgres;

Setup for Jar File Creation

# Navigate to backend directory
cd TaskTool

# Build the project
mvn clean package -DskipTests


**Backend will be available at**: http://localhost:8080

### Frontend Setup
```bash
# Navigate to frontend directory
cd task-ui

# Install dependencies
npm install

# Start development server
npm run dev

# Alternative commands
npm run build    # Build for production
npm run preview  # Preview production build
npm run lint     # Run ESLint

Frontend will be available at: http://localhost:5173

πŸ“ Environment Variables

Backend Environment Variables

When running locally, you can set these environment variables or modify application.properties:

export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/taskDB
export SPRING_DATASOURCE_USERNAME=postgres
export SPRING_DATASOURCE_PASSWORD=postgres

Docker Environment Variables

These are automatically configured in docker-compose.yml:

  • SPRING_DATASOURCE_URL: jdbc:postgresql://database:5432/taskDB
  • SPRING_DATASOURCE_USERNAME: postgres
  • SPRING_DATASOURCE_PASSWORD: postgres

πŸ—„οΈ Database

The application uses PostgreSQL with the following configuration:

  • Database Name: taskDB
  • Username: postgres
  • Password: postgres
  • Port: 5432

Database Initialization

The application automatically:

  • Creates database schema from schema.sql
  • Populates initial data from data.sql
  • Updates schema using Hibernate DDL auto-update

πŸ“š API Documentation

The backend provides Swagger/OpenAPI documentation:

πŸ“ Project Structure

task-App/
β”œβ”€β”€ docker-compose.yml          # Docker orchestration
β”œβ”€β”€ task-ui/                    # React Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/         # React components
β”‚   β”‚   β”œβ”€β”€ pages/             # Page components
β”‚   β”‚   β”œβ”€β”€ services/          # API services
β”‚   β”‚   └── hooks/             # Custom React hooks
β”‚   β”œβ”€β”€ package.json
β”‚   └── Dockerfile
β”œβ”€β”€ TaskTool/                   # Spring Boot Backend
β”‚   β”œβ”€β”€ src/main/java/         # Java source code
β”‚   β”‚   └── com/example/TaskTool/
β”‚   β”‚       β”œβ”€β”€ controller/    # REST controllers
β”‚   β”‚       β”œβ”€β”€ model/         # Entity models
β”‚   β”‚       β”œβ”€β”€ repository/    # Data repositories
β”‚   β”‚       └── service/       # Business logic
β”‚   β”œβ”€β”€ src/main/resources/    # Application resources
β”‚   β”œβ”€β”€ pom.xml               # Maven dependencies
β”‚   └── Dockerfile
└── README.md

πŸ”§ Common Commands

Docker Commands

# View running containers
docker ps

# View logs
docker-compose logs -f

# Rebuild a specific service
docker-compose build backend
docker-compose build frontend

# Remove all containers and volumes
docker-compose down -v

# Access container shell
docker exec -it task-backend bash
docker exec -it task-frontend sh

Development Commands

# Backend - Generate JAR file
cd TaskTool && ./mvnw clean package

# Frontend - Build for production
cd task-ui && npm run build

# Check application health
curl http://localhost:8080/actuator/health  # Backend health
curl http://localhost:5173                  # Frontend

πŸ› Troubleshooting

Common Issues

  1. Port already in use

    # Check what's using the port
    lsof -i :8080  # Backend
    lsof -i :5173  # Frontend
    lsof -i :5432  # Database
  2. Database connection issues

    • Ensure PostgreSQL is running
    • Check connection string and credentials
    • For Docker: ensure containers can communicate
  3. Docker build issues

    # Clean Docker cache
    docker system prune -a
    
    # Rebuild without cache
    docker-compose build --no-cache
  4. Frontend not loading

    • Check if Node.js version is 18+
    • Clear npm cache: npm cache clean --force
    • Delete node_modules and reinstall: rm -rf node_modules && npm install

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors