Skip to content

ValentinZoia/cuervored

Repository files navigation

🩡❀️ Cuervored | Social Network

Social platform connecting fans of San Lorenzo de Almagro

TypeScript Next.js Prisma MongoDB Tailwind CSS NextAuth.js React Query Zod

🎯 What & Why

What is Cuervored?

CuervoRed is a production-grade, full-stack social network tailored for San Lorenzo fans. It delivers a seamless, real-time experience for sharing posts, following users, tracking match attendance, and engaging with the community. Built with a modern, scalable architecture, it leverages the best of the React/Next.js ecosystem, robust authentication, and a flexible NoSQL backend.

Why I Built This

As a San Lorenzo fan, I thought about how to connect all supporters in an app dedicated exclusively to the club β€” a place to follow other fans, post updates, comment, debate, and even discover who you’ve shared the stadium with. When San Lorenzo plays at home, you can β€˜check in’ through the app to say you’re going to the match, and you can also see who else has checked in.

The Challenge

Build a interactive social plataform with maintainable code. And the most important thing is learn, learn and learn.

⚑ Highlights

  • πŸŸͺ Architecture
    • Modular Next.js App Router structure
    • Prisma ORM with MongoDB Atlas
    • Server/Client component separation
    • Centralized API route handling
  • 🟦 Performance
    • React Query for caching and background updates
    • Dynamic imports and memoized components
    • Optimized image uploads and transformations
  • 🟨 Security
    • NextAuth.js with JWT, OAuth, and credentials
    • Route-level middleware for access control
    • Zod-powered validation everywhere
  • 🟫 Real-Time & UX
    • Infinite scroll, skeleton loaders, and toasts
    • Responsive, accessible UI (Radix, Tailwind)
    • Optimistic UI for posts, likes, and comments
  • ⬜ Observability & Quality
    • Error boundaries for posts and async data
    • ESLint, strict TypeScript, and modular hooks

πŸ‘οΈ Pages Preview

'/auth/login'

'/auth/register'

'/'

'/' - Post Modal

'/:username' - My profile

'/:username' - Edit Profile

'/:username' - Other profile

'/matches'

'/settings'

'/match-attendance/:matchId'

'/search?q=:query'

πŸ› οΈ Technology Stack

Core Framework

Technology Version Purpose Key Packages
Next.js 14.x Full-stack framework next, next-auth, @next/bundle-analyzer
TypeScript 5.x Type safety typescript

API & Real-Time

Technology Version Purpose Key Packages
React Query 5.x Data fetching/caching @tanstack/react-query
Axios 1.x HTTP client axios

Database & Storage

Technology Version Purpose Key Packages
Prisma 5.x ORM, migrations prisma, @prisma/client
MongoDB Atlas NoSQL database mongodb (Atlas)
Cloudinary - Image storage browser-image-compression

Security

Technology Version Purpose Key Packages
NextAuth.js 5.x Auth (OAuth, JWT) next-auth, @auth/prisma-adapter
Zod 3.x Validation zod
bcryptjs 2.x Password hashing bcryptjs

UX/UI

Technology Version Purpose Key Packages
Tailwind CSS 3.x Utility-first CSS tailwindcss, tailwind-merge
Shadcn UI framework @radix-ui/react-\* , lucide-react

⭐ Features

Auth & User Management

  • βœ… OAuth (GitHub, Google) and credentials login
  • βœ… JWT session management
  • βœ… Profile editing with avatar upload and bio
  • βœ… Follow/unfollow users

Social Feed & Posts

  • βœ… Infinite scroll feed (For You, Following)
  • βœ… Create, edit, and delete posts with image upload
  • βœ… Like/unlike posts
  • βœ… Comment on posts (with validation)
  • βœ… Optimistic UI for likes/comments

Match Attendance

  • βœ… Track attendance for upcoming matches
  • βœ… View who is attending each match
  • βœ… Attendance expiration and status

Search & Discovery

  • βœ… User search with instant results
  • βœ… Who to follow suggestions

UI/UX & Quality

  • βœ… Responsive, accessible design
  • βœ… Skeleton loaders and toasts
  • βœ… Error boundaries for async data
  • βœ… Dark/light theme support

πŸš€ Quick Start

Prerequisites

  • Node.js >= 18.x
  • npm >= 9.x (or yarn/pnpm)
  • MongoDB Atlas account
  • Cloudinary account (for image uploads)

Installation

  1. Clone the repository
    git clone https://github.com/valentinzoia/cuervored.git
    cd next-prisma-auth
  2. Install dependencies
    npm install
    # or
    yarn install
  3. Copy and configure environment variables
    cp .env.example .env.local
    # Fill in MongoDB, Cloudinary, NextAuth, and OAuth credentials
  4. Run Prisma migrations and generate client
    npx prisma generate
    npx prisma migrate deploy
  5. Start the development server
    npm run dev

Optional: Docker Compose

  • Add your own docker-compose.yml for local MongoDB/Cloudinary emulation if needed.

πŸ“š Project Structure

cuervored/
β”œβ”€β”€ prisma/           # Prisma schema and migrations
β”œβ”€β”€ public/           # Static assets
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/          # Next.js app directory (routing, layouts, pages)
β”‚   β”œβ”€β”€ components/   # UI and feature components (modular, domain-driven)
β”‚   β”œβ”€β”€ data/         # Data fetching and API logic
β”‚   β”œβ”€β”€ hooks/        # Custom React hooks
β”‚   β”œβ”€β”€ lib/          # Utilities, Prisma client, validation schemas
β”‚   β”œβ”€β”€ routes/       # Route definitions and middleware
β”‚   β”œβ”€β”€ types/        # TypeScript types and Prisma payloads
β”‚   └── utils/        # Utility functions (image, date, etc.)
β”œβ”€β”€ tailwind.config.ts
β”œβ”€β”€ package.json
└── ...
  • app/: Next.js App Router, layouts, and route handlers
  • components/: Feature and UI components, grouped by domain
  • data/: API/data access logic, separated from UI
  • lib/: Prisma client, Zod schemas, and shared utilities
  • routes/: Route config and middleware for access control
  • types/: Centralized TypeScript types for strong typing

🀝 Contributing

  1. Fork repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add some AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open Pull Request

πŸ“ License

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

πŸ“§ Contact


Built with ❀️ and best practices

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •