Skip to content

aziz-codes/codebook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CodeBook πŸ“š

A vibrant community platform built exclusively for developers. Share your code snippets, engage in technical discussions, and connect with fellow developers from around the world.

CodeBook Next.js Express MongoDB TypeScript

🌟 Overview

CodeBook is a modern, full-stack social platform designed specifically for developers. It provides a space where developers can share code snippets, participate in technical discussions, showcase their work, and build meaningful connections within the developer community.

✨ Features

πŸ” Authentication

  • GitHub OAuth Integration - Secure login with GitHub
  • User Profiles - Customizable developer profiles with bio, tagline, and expertise
  • Verified Accounts - Special verification badges for notable developers

πŸ’» Code Sharing

  • Code Snippets - Share and discover code snippets with syntax highlighting
  • Monaco Editor - Rich code editing experience with language support
  • Multiple Languages - Support for various programming languages
  • Code Formatting - Automatic syntax highlighting and formatting

πŸ’¬ Community Features

  • Posts & Discussions - Create and engage in technical discussions
  • Comments & Replies - Threaded comment system for better conversations
  • Likes & Bookmarks - Save and appreciate content
  • Developer Discovery - Find and connect with developers worldwide

πŸ‘₯ Social Features

  • Follow System - Follow developers you admire
  • Developer Cards - Beautiful, interactive developer profile cards
  • Search & Filter - Advanced search and filtering capabilities
  • Activity Feed - Stay updated with community activity

🎨 User Experience

  • Modern UI/UX - Beautiful, responsive design with smooth animations
  • Dark Mode - Full dark mode support
  • Real-time Updates - Live updates using React Query
  • Toast Notifications - User-friendly notifications for actions

πŸ› οΈ Additional Features

  • Bounties - Post and discover coding bounties
  • Reports & Moderation - Community-driven content moderation
  • Block System - Block unwanted users
  • Expertise Tags - Showcase your skills and expertise

πŸ—οΈ Tech Stack

Frontend

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS
  • UI Components: Radix UI, shadcn/ui
  • State Management: React Query (TanStack Query), Redux Toolkit
  • Animations: Framer Motion
  • Code Editor: Monaco Editor
  • Authentication: NextAuth.js
  • Icons: Lucide React

Backend

  • Runtime: Node.js
  • Framework: Express.js
  • Database: MongoDB with Mongoose
  • Authentication: JWT, GitHub OAuth
  • File Upload: Express file upload handling

Development Tools

  • Package Manager: npm
  • Linting: ESLint
  • Type Checking: TypeScript
  • Dev Tools: React Query Devtools

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/yourusername/codebook.git
cd codebook

2. Install Dependencies

Install client dependencies:

cd client
npm install

Install server dependencies:

cd ../server
npm install

3. Environment Variables

Create a .env.local file in the client directory:

# NextAuth Configuration
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-nextauth-secret-here

# GitHub OAuth
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret

# API URL
NEXT_PUBLIC_API_URL=http://localhost:8000

Create a .env file in the server directory:

# MongoDB Connection
MONGODB_URI=mongodb://localhost:27017/codebook
# or for MongoDB Atlas
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/codebook

# JWT Secret
JWT_SECRET=your-jwt-secret-here

# Server Port
PORT=8000

4. Run the Development Servers

Start the backend server:

cd server
npm start

In a new terminal, start the frontend:

cd client
npm run dev

The application will be available at:

πŸ“ Project Structure

codebook/
β”œβ”€β”€ client/                 # Next.js frontend application
β”‚   β”œβ”€β”€ app/               # Next.js app router pages
β”‚   β”œβ”€β”€ components/        # React components
β”‚   β”œβ”€β”€ modals/           # Modal components
β”‚   β”œβ”€β”€ types/            # TypeScript type definitions
β”‚   β”œβ”€β”€ services/         # API service functions
β”‚   β”œβ”€β”€ hooks/            # Custom React hooks
β”‚   └── utils/            # Utility functions
β”‚
β”œβ”€β”€ server/                # Express.js backend application
β”‚   β”œβ”€β”€ controllers/      # Route controllers
β”‚   β”œβ”€β”€ routes/           # API routes
β”‚   β”œβ”€β”€ schemas/          # MongoDB schemas
β”‚   β”œβ”€β”€ middlewares/      # Express middlewares
β”‚   └── utils/            # Utility functions
β”‚
└── README.md             # This file

πŸ”§ Available Scripts

Client Scripts

npm run dev      # Start development server
npm run build    # Build for production
npm run start    # Start production server
npm run lint     # Run ESLint

Server Scripts

npm start        # Start server with nodemon

🎯 Key Features in Detail

Code Snippets

  • Create and share code snippets with syntax highlighting
  • Support for multiple programming languages
  • Monaco editor for a rich editing experience
  • Copy code functionality
  • Like, comment, and bookmark snippets

Developer Profiles

  • Beautiful profile cards with animations
  • Follow/unfollow functionality
  • Display follower and following counts
  • Showcase bio, tagline, and expertise
  • Verified account badges

Discussions

  • Create technical discussions
  • Threaded comment system
  • Like and reply to comments
  • Search and filter discussions

🀝 Contributing

Contributions are welcome! However, please note that this is a personal project. If you'd like to contribute:

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

πŸ“ License

Copyright (c) 2024 Aziz

All rights reserved.

This project and its source code are proprietary and confidential. Unauthorized copying, modification, distribution, or use of this software, via any medium, is strictly prohibited without the express written permission of the owner.

πŸ‘€ Author

Aziz

πŸ™ Acknowledgments

πŸ“ž Support

For support, email [aziz.codes44@gmail.com] or open an issue in the repository.


Made with ❀️ by Aziz

About

Developer only focused social media app build in Next & Node JS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published