Skip to content

Siva010/collab-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SyncSpace - Multi-User Collaboration App / Project Collaboration Platform

Next.js Express TypeScript PostgreSQL TailwindCSS Node.js JWT Socket.IO Stripe SMTP Docker

Overview

SyncSpace is a sophisticated project collaboration platform designed to streamline team workflows and enhance productivity through intuitive project management tools. This full-stack application provides teams with a centralized workspace to create, track, and complete projects with ease.

Accounts created with email/password require activation before login. You can sign up with Google or GitHub for instant verification.

Key Features

  • Project Management: Create, edit, and organize projects
  • Team Collaboration: Invite team members, assign roles, and track contributions
  • Role-Based Access Control: Three-tiered permission system (Admin, Editor, Member) for secure collaboration
  • Task Management: Create, assign, and track tasks with priority levels, due dates, and status tracking
  • Real-time Communication: Integrated real-time chat system for both direct messaging and team discussions
  • Email Service: Email system for account verification, password reset, project invitations, security notifications and much more
  • File Management: Upload, organize, and share files within projects and tasks
  • Comprehensive Dashboard: Visual overview of projects, tasks, and recent activities
  • Calendar & Deadlines: Track important project milestones and deadlines
  • Kanban Board View: Drag-and-drop task management with visual workflow stages
  • Responsive Design: Fully mobile-responsive interface for collaboration on any device

Subscription & Payment System

  • Flexible Subscription Plans: Three-tiered pricing (Starter, Pro, Enterprise) with different limits and features
  • Stripe Integration: Secure payment processing with Stripe Checkout and Billing Portal
  • Usage-Based Limits: Project and team member limits based on subscription tier
  • Real-time Billing: Automatic subscription management with webhook integration

Subscription Tiers

Plan Projects Team Members Storage Price
Starter 5 4 100MB Free
Pro 100 15 10GB ₹2,499/month
Enterprise Unlimited Unlimited 100GB ₹6,499/month

Auto-Accept Team Invitation

For demo and testing purposes, any invitation sent to "demo@syncspace.com" to join a project as a member will be automatically accepted.

🛠️ Technology Stack

Frontend

  • Framework: Next.js 15 with App Router
  • UI: TailwindCSS with customized UI components
  • Authentication: NextAuth.js with email/password and social authentication (Google, Github)
  • Form Handling: React Hook Form with Zod validation
  • File Uploads: UploadThing integration

Backend

  • Server: Node.js with Express
  • Database: PostgreSQL with Prisma ORM
  • Authentication: JWT with bcrypt password hashing
  • Real-time Communication: Socket.IO server
  • Email Service: Integrated with Resend/SMTP for notifications
  • Payment Processing: Stripe integration with webhooks for subscription management

DevOps

  • Docker with multi-container setup
  • Docker Compose for local development and deployment

Testing

SyncSpace includes a comprehensive testing suite demonstrating modern testing practices and code quality assurance:

Test Coverage

  • Backend Tests: 40 tests covering authentication, validation, and utility functions
  • Frontend Tests: 47 tests covering components, forms, and user interactions
  • Total Coverage: 87 tests ensuring reliability and maintainability

Testing Technologies

  • Backend: Jest, Supertest, TypeScript testing with mocked dependencies
  • Frontend: Jest, React Testing Library, user event simulation
  • Coverage Reporting: Detailed coverage analysis with HTML and LCOV reports

Running Tests

# Backend tests
cd backend
npm test
npm run test:coverage

# Frontend tests
cd frontend
npm test
npm run test:coverage

# Watch mode for development
npm run test:watch

Test Categories

  • Unit Tests: Individual function and component testing
  • Integration Tests: API endpoint testing with mocked dependencies
  • Component Tests: React component rendering and user interaction testing
  • Security Tests: Input validation, sanitization, and authentication testing

Architecture

SyncSpace is built on a modern, microservices-oriented architecture:

  • Frontend Container: Next.js application serving the user interface
  • Backend Container: Express API providing business logic and data access
  • Database Container: PostgreSQL instance for persistent storage

The application uses a RESTful API for most operations, with Socket.io for real-time features like messaging and status updates.

Subscription System Architecture

Payment Flow

  1. Plan Selection: Users choose from Starter, Pro, or Enterprise plans
  2. Stripe Checkout: Secure payment processing through Stripe Checkout
  3. Webhook Processing: Real-time subscription updates via Stripe webhooks
  4. Database Sync: Automatic subscription status and limits updates
  5. Billing Portal: Self-service billing management for customers

Security Features

Authentication & Authorization

  • Email Verification: Required account activation for email/password registrations
  • Password Security: Enforced strong password requirements with bcrypt hashing

Data Protection

  • Input Validation: Comprehensive request validation using Joi schemas
  • HTML Sanitization: Protection against XSS attacks through input sanitization
  • SQL Injection Prevention: Prisma ORM provides built-in protection against SQL injection
  • CORS Configuration: Properly configured cross-origin resource sharing

Rate Limiting & DDoS Protection

  • Global Rate Limiting: 1000 requests per 15 minutes per IP
  • Authentication Rate Limiting: 10 login attempts per 15 minutes per IP
  • Message Rate Limiting: 300 messages per minute per IP
  • Targeted Protection: Specific limits for sensitive endpoints

Security Headers

  • Helmet.js Integration: Comprehensive security headers including:
    • Content Security Policy (CSP)
    • X-Frame-Options (Clickjacking protection)
    • X-Content-Type-Options (MIME sniffing protection)
    • Referrer Policy controls
    • Permissions Policy restrictions

Getting Started

Prerequisites

  • Docker and Docker Compose
  • Node.js (v18 or higher)
  • npm or yarn

Installation

  1. Clone the repository:
git clone https://github.com/syncspace-admin/syncspace-app.git
cd syncspace-app
  1. Set up environment variables:
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env

Required Environment Variables:

Backend (.env):

# Database
DATABASE_URL="postgresql://username:password@localhost:5432/SyncSpace_db"

# JWT
JWT_SECRET="your-jwt-secret"

# Email (Resend/SMTP)
EMAIL_FROM="noreply@yourdomain.com"
RESEND_API_KEY="your-resend-api-key"

# Stripe
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
FRONTEND_URL="http://localhost:3000"

# Server
PORT=4000

Frontend (.env.local):

# API
NEXT_PUBLIC_API_URL="http://localhost:4000"

# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-nextauth-secret"

# OAuth Providers
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET="your-github-client-secret"

# UploadThing
UPLOADTHING_SECRET="your-uploadthing-secret"
UPLOADTHING_APP_ID="your-uploadthing-app-id"
  1. Start the application with Docker:
docker-compose up
  1. Set up Stripe (for subscription features):
# Install Stripe CLI
# macOS
brew install stripe/stripe-cli/stripe

# Linux/Windows - Download from https://stripe.com/docs/stripe-cli

# Login to Stripe
stripe login

# Forward webhooks to local development
stripe listen --forward-to localhost:4000/api/subscriptions/webhook

# Copy the webhook secret to your backend .env file
  1. Access the application:

Local Development

For local development without Docker:

  1. Install dependencies:

    # Frontend
    cd frontend
    npm install
    
    # Backend
    cd backend
    npm install
  2. Set up the database:

    cd backend
    npx prisma migrate dev
  3. Start the development servers:

    # Frontend
    cd frontend
    npm run dev
    
    # Backend
    cd backend
    npm run dev

© 2025 SyncSpace. All rights reserved.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages