Skip to content
 
 

Repository files navigation

SwiftChat Frontend

Next.js 14 React 18 TypeScript TailwindCSS License Website

A production-ready, real-time chat frontend built with Next.js. Powers SwiftChat — a modern messaging platform with friends, rooms, file sharing and live presence.


Overview

SwiftChat Frontend is the web client of SwiftChat, built with Next.js 14 (App Router), TypeScript and Tailwind CSS. It talks to the SwiftChat Backend over REST and Socket.IO for real-time messaging, friend requests and presence.

Screenshots

Login

Login

Chat

Chat

Friends

Friends

Profile

Profile

Features

  • Real-time messaging powered by Socket.IO
  • Google OAuth sign-in and email/password sign-up
  • Friends system — send, accept and reject requests, block users
  • Chat rooms with persisted history and live updates
  • File uploads for profile photos and attachments
  • Responsive UI built with Tailwind CSS and Radix primitives
  • Dark mode via next-themes
  • State management with Redux Toolkit

Tech Stack

Layer Technology
Framework Next.js 14 (App Router)
Language TypeScript 5
UI Tailwind CSS, Radix UI, shadcn/ui
State Redux Toolkit, React Redux
Forms React Hook Form + Zod
Auth NextAuth (v5 beta), JWT
Real-time socket.io-client
Animations Framer Motion
HTTP Axios

Getting Started

Prerequisites

  • Node.js 18+ and npm / pnpm / yarn / bun
  • A running instance of the SwiftChat Backend

1. Clone the repository

git clone https://github.com/kwa0x2/SwiftChat-Frontend.git
cd SwiftChat-Frontend

2. Install dependencies

npm install

3. Configure environment variables

Create a .env.local file in the project root:

# Backend API
BASE_URL=http://localhost:9000/api/v1
SOCKET_IO_URL=http://localhost:9000/chat

# NextAuth — generate with: npx auth secret
AUTH_SECRET=your_auth_secret

# Uncomment in production / behind a proxy
# AUTH_TRUST_HOST=true

4. Run the development server

npm run dev

Open http://localhost:3000 in your browser.

Available Scripts

npm run dev      # start the dev server
npm run build    # production build
npm run start    # run the production build
npm run lint     # run ESLint

Project Structure

SwiftChat-Frontend/
├── app/             # Next.js App Router pages, layouts & API routes
│   ├── (pages)/     # Route groups
│   ├── api/         # Route handlers
│   └── redux/       # Redux store setup
├── actions/         # Server actions
├── components/      # Reusable UI components
│   ├── dialogs/     # Modal dialogs
│   └── ui/          # shadcn/ui primitives
├── hooks/           # Custom React hooks
├── lib/             # Utilities & helpers
├── models/          # Shared types & data models
├── schemas/         # Zod validation schemas
├── public/          # Static assets
├── auth.ts          # NextAuth configuration
├── middleware.ts    # Route protection middleware
└── routes.ts        # Route definitions

Related Repositories

License

Distributed under the MIT License. See LICENSE for more information.

About

SwiftChat Frontend is a real-time chat application built with AuthJS, ShadCN UI, and Tailwind CSS. It integrates seamlessly with the SwiftChat Backend to provide authentication, session management, and real-time communication, offering a smooth and responsive user experience.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages