Skip to content
OsmanYusuf edited this page Dec 24, 2024 · 1 revision

Mystical Object Emporium

Welcome to the Mystical Object Emporium wiki! This is the central hub for all documentation related to the project. Here you'll find information on getting started, contributing, and understanding the architecture of the platform.

Overview

Mystical Object Emporium is a social platform built with Next.js that allows users to share and catalog mystical and unique objects. It serves as a comprehensive database and social space for collectors and enthusiasts.

Table of Contents

Getting Started

Prerequisites

  • Node.js 18.x or higher
  • npm/yarn/pnpm

Installation

  1. Clone the repository:

    git clone [repository-url]
  2. Install dependencies:

    npm install
  3. Create a .env.local file:

    NEXT_PUBLIC_API_URL=your_api_url
  4. Start the development server:

    npm run dev

Visit http://localhost:3000 to see the application.

Development Tips

  • Use npm run lint to check for code style issues.
  • Use npm run test to run the test suite.

Architecture

Tech Stack

  • Frontend Framework: Next.js 14
  • Language: TypeScript
  • Styling: Tailwind CSS, PostCSS
  • State Management: React Context
  • API Communication: Axios

Project Structure

├── app/                  # App router pages
├── components/          # Reusable components
├── contexts/           # React contexts
├── hooks/              # Custom React hooks
├── utils/              # Utility functions
└── public/            # Static assets

Key Files

  • next.config.js: Configuration for Next.js
  • tailwind.config.js: Tailwind CSS configuration
  • tsconfig.json: TypeScript configuration
  • postcss.config.js: PostCSS configuration

Features

Core Features

  • Post Creation & Management
    • Share objects with detailed specifications
    • Upload media attachments
    • Add physical properties (dimensions, weight)
    • Tag materials, colors, and shapes
    • Integrate WikiData labels for semantic categorization
    • Custom tagging system

Social Interaction

  • Nested commenting system
  • Like/unlike posts
  • User profiles
  • Activity tracking

Search & Discovery

  • Advanced search functionality
  • Paginated post listings
  • Personalized home feed

Contributing

We welcome contributions to Mystical Object Emporium! Please follow these steps to contribute:

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

Please ensure your code adheres to our coding standards and includes tests where applicable.

Code of Conduct

Please read our Code of Conduct to understand the expectations for contributors.

Deployment

Vercel Deployment

This project can be deployed on Vercel with zero configuration:

  1. Push your code to a Git repository
  2. Import your project to Vercel
  3. Configure environment variables
  4. Deploy

Other Hosting Options

  • Netlify: Follow similar steps as Vercel.
  • AWS Amplify: Requires additional configuration for serverless functions.

API Documentation

Authentication

  • POST /auth/login: User login
  • POST /auth/register: User registration

Posts

  • GET /posts/main: Retrieve home posts
  • GET /posts/{id}: Retrieve a post by ID
  • POST /posts/create: Create a new post
  • PUT /posts/{id}: Update a post

Comments

  • POST /comments/create: Create a comment
  • GET /comments/post/{postId}: Retrieve comments for a post

Profiles

  • GET /users/profile/{userId}: Retrieve user profile
  • POST /users/{userId}/avatar: Update user avatar

Component Library

TagInput

  • Custom tag input component
  • Supports adding/removing tags
  • Auto-completion support

WikiDataSearch

  • Integration with WikiData API
  • Semantic label search
  • Auto-suggestions

WikiTagDropdown

  • Dropdown component for WikiData labels
  • Search and select functionality