Skip to content

Abimael10/workhub-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements

  • Node.js v20+
  • npm 9+
  • Docker and Docker Compose

Installation

git clone https://github.com/Abimael10/workhub-app.git
cd workhub-app
cp .env.example.local .env.local
npm install

Running Locally

  1. Start services:
docker compose -f docker-compose.local.yml up -d db minio minio-setup redis web
# Or use: make dev-up
  1. Stop services:
make dev-down
  1. Configure database (Note: make sure to run this once for your environment, otherwise you will not be able to register to continue exploring the application):
npm run db:push
  1. Start the app (NOTE: not needed if the web image is already running):
npm run dev    # http://localhost:3000
  1. Create an account at http://localhost:3000/register

Features

  • Multi-tenant organizations: Data isolation per organization. Users can belong to an organization, invite existing users, and members/admins can update org projects, clients, and files.

  • Multi-organization switching: A user can belong to multiple orgs and switch from their profile with one click to manage projects, clients, and files for that org.

  • Kanban board: Visual project management with drag and drop for status changes. Members, admins, and owners can manage org projects.

  • Client management: Register and manage clients shared across an organization.

  • File storage: Upload and manage files shared by org users.

  • Authentication: NextAuth.js for registration and login.

Commands

npm run dev        # Development server
npm run build      # Build for production
npm run start      # Start production server
npm run test       # Unit/integration tests
npm run test:e2e   # Automated E2E tests (some tests are running correctly, needed to refactor some as a TODO)
npm run lint       # Lint codebase
npm run db:push    # Apply database schema

Observability

When running the application locally, you can use the following commands to observe the services:

Database Access

Connect to the PostgreSQL database running in Docker:

# Using the Makefile command
make db-shell

# Or directly with Docker
docker exec -it workhub-postgres psql -U postgres -d workhub

# List all tables
\dt

# Describe a table
\d table_name

# Query data from a table
SELECT * FROM users LIMIT 10;

Service Logs

View logs for all services or specific services:

# View logs for all services
make dev-logs

# View logs for specific service
docker logs workhub-postgres    # PostgreSQL logs
docker logs workhub-web         # Web application logs
docker logs workhub-minio       # MinIO storage logs
docker logs workhub-redis       # Redis logs

# Follow logs in real-time
docker logs -f workhub-web

MinIO Storage Access

Access the MinIO storage container:

# Using the Makefile command
make minio-shell

# Or directly with Docker
docker exec -it workhub-minio /bin/sh

# Access MinIO web console at http://localhost:9001
# Credentials: local-minio / local-minio-secret

Redis Access

Connect to the Redis instance:

# Connect to Redis CLI
docker exec -it workhub-redis redis-cli

# View all keys
KEYS *

# Get value of a specific key
GET key_name

E2E Tests

npm run test:e2e                    # Run all tests
npx playwright test --headed        # Visible browser mode
npx playwright test --ui            # Playwright UI runner

Schema Notes

  • Drizzle schema lives in src/server/db/schema and generates SQL under drizzle/.
  • The accounts table comes from NextAuth to support optional OAuth/OIDC providers; with email/password-only flows it stays empty. Token columns are plain text fields—add encryption/rotation if enabling external providers.
  • Apply schema changes with npm run db:push after updating the Drizzle models; review generated SQL before committing.

Considerations

  • Because this was built under time constraints, you may find some partial patterns that weren’t fully refactored. Functionality was prioritized over optimization.

Build Notes

When building the application, ensure that NEXTAUTH_URL and NEXT_PUBLIC_APP_URL environment variables are set to valid URLs, otherwise the build will fail during page data collection.

About

Multi-tenant Next.js workspace that lets organizations manage projects, clients, and shared files in one place.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages