Skip to content

A chat application built with Next.js (Frontend) and Express.js (Backend), using Redux Toolkit, TailwindCSS, Prisma, and PostgreSQL

Notifications You must be signed in to change notification settings

EmmanuelVictor62/chat-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Here's the properly ordered and formatted README.md:

# Chat Application

A real-time chat application built with Next.js, Express.js, Prisma, and PostgreSQL. This project includes features such as chatbot interactions and API validation using Zod.

The chatbot mimics a typical chatbot interaction but currently sends a hardcoded response for testing purposes instead of generating dynamic replies.

## 🚀 Technologies Used

- **Frontend:** Next.js, TailwindCSS, Redux Toolkit
- **Backend:** Express.js, Prisma, PostgreSQL
- **API Validation:** Zod
- **Documentation:** Swagger
- **State Management:** Redux Toolkit

## 📁 Project Structure
chat-app/
│── client/ # Next.js frontend
│ ├── components/ # Reusable UI components
│ ├── hooks/ # Reusable Hook functions
│ ├── pages/ # Application pages
│ ├── store/ # Redux store setup
│ │ ├── slices/ # Redux toolkit slices
│ │ ├── services/ # API call functionality
│ ├── styles/ # Global styles
│ ├── utils/ # Utility functions
│
│── server/ # Express.js backend
│ ├── config/ # Database and environment configurations
│ ├── controllers/ # API request handlers
│ ├── middleware/ # Middleware (e.g., validation, authentication)
│ ├── routes/ # API routes
│ ├── schemas/ # Zod validation schemas
│ ├── services/ # Business logic
│ ├── swagger/ # API documentation
│ ├── prisma/ # Prisma schema and migrations
│
│── .env # Environment variables
│── README.md # Project documentation
│── package.json # Project dependencies
│── tsconfig.json # TypeScript configuration

🔧 Setup and Installation

1️⃣ Clone the repository

git clone https://github.com/EmmanuelVictor62/chat-app.git
cd chat-app

2️⃣ Set up environment variables

Create a .env file in the server/ directory and add:

DATABASE_URL="postgresql://user:password@localhost:5334/chat_db?schema=public"

You should include your postgres username and password

3️⃣ Install dependencies

Run the following command in the root directory:

npm install

4️⃣ Run database migrations

cd server
npx prisma migrate dev

5️⃣ Start the backend server

cd server
npm run dev

6️⃣ Start the frontend

cd client
npm run dev

📝 API Documentation

Swagger documentation is available at:

http://localhost:5334/api/docs

✅ Validation

All API requests are validated using Zod. If the request does not meet the schema requirements, the server returns a 400 response with error details.

📌 Contributing

  1. Fork the repository
  2. Create a new branch (git checkout -b feature-name)
  3. Commit changes (git commit -m "Add feature")
  4. Push to the branch (git push origin feature-name)
  5. Open a Pull Request

Made with ❤️ by Emmanuel Victor

About

A chat application built with Next.js (Frontend) and Express.js (Backend), using Redux Toolkit, TailwindCSS, Prisma, and PostgreSQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published