Skip to content

Erennn7/socially

Repository files navigation

🌟 Socially

A modern, full-stack social media platform built with Next.js 14

Next.js TypeScript Prisma TailwindCSS


✨ Features

  • 🔐 Secure Authentication - Powered by Clerk with social login support
  • 📝 Create & Share Posts - Express yourself with text and images
  • 💬 Real-time Interactions - Like, comment, and engage with posts
  • 👥 Follow System - Connect with other users and build your network
  • 🔔 Smart Notifications - Stay updated on likes, comments, and follows
  • 🎨 Dark Mode - Beautiful UI with light/dark theme switching
  • 📱 Fully Responsive - Seamless experience across all devices
  • Optimized Performance - Server-side rendering and image optimization
  • 🖼️ Image Uploads - Upload and share photos with UploadThing integration
  • 👤 User Profiles - Customizable profiles with bio, location, and website

🛠️ Tech Stack

Frontend

Backend & Database

Authentication & Storage

UI Components

  • Radix UI - Unstyled, accessible component primitives
  • React Hot Toast - Beautiful notifications
  • Next Themes - Dark mode implementation

🚀 Getting Started

Prerequisites

  • Node.js 18+ and npm
  • PostgreSQL database (or Neon account)
  • Clerk account for authentication
  • UploadThing account for file uploads

Installation

  1. Clone the repository
git clone https://github.com/Erennn7/socially.git
cd socially
  1. Install dependencies
npm install
  1. Set up environment variables

Create a .env file in the root directory:

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key

# Database
DATABASE_URL=your_postgresql_connection_string

# UploadThing
UPLOADTHING_TOKEN=your_uploadthing_token
  1. Set up the database
npx prisma generate
npx prisma db push
  1. Run the development server
npm run dev

Open http://localhost:3000 to see the app! 🎉


📁 Project Structure

socially/
├── prisma/
│   └── schema.prisma          # Database schema
├── src/
│   ├── actions/               # Server actions
│   │   ├── post.action.ts
│   │   ├── user.action.ts
│   │   ├── profile.action.ts
│   │   └── notification.action.ts
│   ├── app/                   # Next.js App Router
│   │   ├── api/               # API routes
│   │   ├── notifications/     # Notifications page
│   │   ├── profile/           # User profiles
│   │   └── page.tsx           # Home page
│   ├── components/            # React components
│   │   ├── ui/                # shadcn/ui components
│   │   ├── CreatePost.tsx
│   │   ├── PostCard.tsx
│   │   ├── Navbar.tsx
│   │   └── ...
│   ├── lib/                   # Utilities
│   │   ├── prisma.ts          # Prisma client
│   │   ├── utils.ts           # Helper functions
│   │   └── uploadthing.ts     # Upload config
│   └── middleware.ts          # Clerk middleware
└── package.json

🎯 Key Features Breakdown

📮 Posts

  • Create text and image posts
  • Edit and delete your own posts
  • Like and unlike posts
  • View post engagement metrics

👤 User Profiles

  • Customizable profile information
  • View user's posts and activity
  • Follow/unfollow users
  • See follower and following counts

🔔 Notifications

  • Get notified when someone:
    • Likes your post
    • Comments on your post
    • Follows you
  • Mark notifications as read

🎨 UI/UX

  • Clean, modern design
  • Smooth animations and transitions
  • Responsive mobile-first layout
  • Dark mode support
  • Loading states and skeletons

🗄️ Database Schema

The app uses a relational database with the following main models:

  • User - User accounts and profiles
  • Post - User-generated posts
  • Comment - Comments on posts
  • Like - Post likes
  • Follows - User follow relationships
  • Notification - User notifications

🔧 Scripts

npm run dev          # Start development server
npm run build        # Build for production
npm start            # Start production server
npm run lint         # Run ESLint
npx prisma studio    # Open Prisma Studio (database GUI)

🚀 Deployment

Deploy to Vercel

  1. Push your code to GitHub
  2. Import your repository to Vercel
  3. Add your environment variables in the Vercel dashboard
  4. Deploy! ✨

The app will automatically build and deploy on every push to the main branch.


📝 Environment Variables

Variable Description Required
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY Clerk publishable key
CLERK_SECRET_KEY Clerk secret key
DATABASE_URL PostgreSQL connection string
UPLOADTHING_TOKEN UploadThing API token

🤝 Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create a 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 open source and available under the MIT License.


👨‍💻 Author

Eren


Built with ❤️ using Next.js

If you found this project helpful, please consider giving it a ⭐!

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published