Skip to content

ps600779/Knowledge-Garden

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Knowledge Garden

A modern, microservices-based knowledge management platform built to facilitate document sharing, searching, and collaboration.

Project Overview

Knowledge Garden is a comprehensive knowledge management system that enables users to upload, organize, search, and share various knowledge resources. The application is built using a microservices architecture with a React frontend and a Node.js backend.

Architecture

Architecture Diagram

The system consists of two main components:

Frontend

  • Single-page application built with React, TypeScript, and Redux
  • Modern UI with Tailwind CSS
  • Responsive design for optimal experience on all devices

Backend

  • Microservices architecture with four main services:
    • API Gateway: Entry point for all client requests
    • Authentication Service: Manages user authentication and authorization
    • Resources Service: Handles file uploads, storage, and management
    • Search Service: Provides advanced search functionality

Key Features

  • 🔐 User authentication and authorization
  • 📁 Resource management (upload, download, update, delete)
  • 🔍 Advanced search with Elasticsearch
  • 🏷️ Resource categorization and tagging
  • 📊 User profiles and resource analytics
  • 🌐 Service discovery with Consul
  • 📨 Event-driven architecture with Kafka

Technology Stack

Frontend

  • Framework: React 19
  • Language: TypeScript
  • State Management: Redux with Redux Toolkit
  • Styling: Tailwind CSS
  • Routing: React Router v7
  • HTTP Client: Axios
  • Build Tool: Vite

Backend

  • Runtime: Node.js (v16+)
  • API Framework: Express
  • Languages: JavaScript and TypeScript
  • Databases:
    • PostgreSQL (user data)
    • MongoDB (document metadata)
    • Elasticsearch (search index)
  • Authentication: JWT
  • Storage: S3-compatible (MinIO or AWS S3)
  • Service Discovery: Consul
  • Message Broker: Kafka
  • Containerization: Docker (optional)

Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js v16+
  • npm v8+
  • PostgreSQL v14+
  • MongoDB v5+
  • Elasticsearch v8+
  • Consul v1.14+
  • Kafka v3.3+ and ZooKeeper v3.8+
  • MinIO or AWS S3 access

Setup and Installation

Backend Services

  1. Clone the repository:

    git clone https://github.com/your-username/knowledge-garden.git
    cd knowledge-garden/backend
  2. Install Consul for Service Discovery:

    # macOS
    brew install consul
    consul agent -dev
    
    # Linux
    # Download and extract Consul
    wget https://releases.hashicorp.com/consul/1.14.4/consul_1.14.4_linux_amd64.zip
    unzip consul_1.14.4_linux_amd64.zip
    sudo mv consul /usr/local/bin/
    consul agent -dev
  3. Install Kafka and ZooKeeper:

    # Using Docker (recommended for development)
    docker-compose up -d zookeeper kafka
    
    # macOS
    brew install kafka
    brew services start zookeeper
    brew services start kafka
    
    # Linux
    # See backend/README.md for detailed instructions
  4. Set up S3-compatible Storage:

    # Using MinIO
    docker run -p 9000:9000 -p 9001:9001 --name minio \
      -v ~/minio/data:/data \
      -e "MINIO_ROOT_USER=minioadmin" \
      -e "MINIO_ROOT_PASSWORD=minioadmin" \
      quay.io/minio/minio server /data --console-address ":9001"
  5. Configure environment variables:

    # Create environment files for each service
    cp .env.example api-gateway/.env
    cp .env.example authentication/.env
    cp .env.example resources/.env
    cp .env.example search/.env
    
    # Edit each file to configure your specific environment
  6. Install dependencies and start services:

    # Install API Gateway dependencies
    cd api-gateway && npm install
    
    # Install Authentication Service dependencies
    cd ../authentication && npm install
    
    # Install Resources Service dependencies
    cd ../resources && npm install
    
    # Install Search Service dependencies
    cd ../search && npm install
    
    # Start all services (in separate terminal windows)
    cd api-gateway && npm run dev
    cd ../authentication && npm run dev
    cd ../resources && npm run dev
    cd ../search && npm run dev

Frontend

  1. Navigate to the frontend directory:

    cd ../frontend
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev
  4. Open http://localhost:5173 in your browser

API Documentation

The API documentation is available at:

http://localhost:5000/api-docs

Testing

Backend

# Run unit tests
npm run test:unit

# Run integration tests
npm run test:integration

# Run E2E tests
npm run test:e2e

# Run performance tests
npm run test:performance

Frontend

# Run unit tests
npm test

# Run E2E tests with Cypress
npm run cypress:run

Performance Requirements

  • API Gateway: Must handle 100 requests/second with <500ms response time
  • Authentication Service: Must handle 50 logins/second with <1s response time
  • Search Service: Must handle 20 search queries/second with <2s response time

Debugging and Troubleshooting

See the detailed troubleshooting guides in the backend and frontend README files for common issues and solutions.

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

License

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

About

Resource sharing platform for students and faculties.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors