Skip to content

gdaroch/next-mini-jira-v2

Repository files navigation

Mini Jira v2 – Architecture Practice Project

Overview

Mini Jira v2 is a personal learning project focused on improving my backend and Next.js architecture skills.

This is not a full Jira clone.
The goal is to practice:

  • Clean architecture
  • BFF (Backend for Frontend) pattern
  • Clear separation of responsibilities
  • Runtime validation with Zod
  • Server vs Client logic in Next.js

This project helps me understand how modern full-stack applications should be structured.


Main Architecture Goals

In this version, I focus on:

  • UI does not access the database directly
  • All data goes through /app/api (BFF layer)
  • Clear separation between:
    • HTTP layer
    • Application logic
    • Database access
    • Shared contracts (schemas)

The main goal is writing clean, organized, and maintainable code.


Technologies Used

  • Next.js (App Router, Route Handlers, Server Components)
  • React
  • TypeScript
  • MongoDB
  • Mongoose
  • Zod (validation and typed schemas)
  • Tailwind CSS
  • Docker (local database)

Planned improvements

  • Authentication (Auth.js)
  • Unit tests (Jest)
  • E2E tests (Playwright)
  • OpenAPI documentation

Project Structure (Simplified)

app/
  api/
    projects/route.ts      # HTTP endpoint (BFF)
  projects/
    page.tsx               # Server Component (UI)

lib/
  server/
    db/                    # Database connection

  projects/
    server/
      service.ts           # Application logic
      repository.ts        # Database queries
      model.ts             # Mongoose model
    shared/
      schemas.ts           # Output DTOs (Zod)
      inputs.ts            # Input validation
    client/
      api.ts               # Fetch wrapper for BFF

  shared/
    http/
      helpers.ts           # URL helpers

Layer Responsibilities

Route Handler (app/api)

  • Validates input
  • Calls the service layer
  • Returns structured responses

No business logic here.


Service Layer

  • Handles use cases
  • Transforms database data into DTOs
  • Calculates pagination metadata

Repository Layer

  • Handles all database queries
  • Applies pagination and sorting
  • Ensures database connection

Shared Layer

  • Defines API contracts with Zod
  • Types are generated from schemas

Client API Layer

  • Wraps fetch calls
  • Validates responses
  • Works in both Server and Client Components

Current Features

  • Paginated project list
  • Sorting (name, createdAt, updatedAt)
  • Query parameter handling
  • Input validation
  • Clean layered architecture

Running Locally

Requirements

  • Node.js
  • Docker

Start MongoDB

docker compose up -d

Environment Variables

Create a .env.local file:

MONGODB_URI=mongodb://127.0.0.1:27017/mini-jira

Start the App

npm install
npm run dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors