live version of the app here https://chatz-eta.vercel.app/
Chatz is a real-time social media application built with Next.js, utilizing both its frontend and backend capabilities. The app leverages Prisma as an ORM to interact with a MongoDB database. Real-time features are powered by Pusher. Below is a detailed overview of some of the app's features,
- User Registration and Authentication: Users can register, log in, and reset their passwords. Email verification is also supported.
- Profile Management: Users can update their profile information, including their profile picture, (username, email, profile picture, and other personal details are comming soon).
- User Roles: There are two user roles - ADMIN and USER. The default role for new users is USER.
-
Friendship: Users can send, receive, accept, or decline friendship requests. The status of a friendship can be PENDING, ACCEPTED, DECLINED, or BLOCKED.
-
Messaging: Users can chat with their friends and chats are updated in real-time. (read reciept available but requires refresh)
-
Group chat: comming soon.
-
Profile: Users can visit and view other peoples profile but wont see the users post unless they are friends
-
Posts: Users can create, (edit, and delete comming soon) posts. Posts can contain text content and images.
-
Comments and Replies: Users can comment on posts and reply to other comments. Comments and replies can be nested infinitely and are updated in real-time.
-
Likes and Shares: Users can like and share posts. Each like and share is associated with a specific user and post. The like count on posts is updated in real time.
Ensure you have the following installed on your machine:
- Node.js (>=14.x)
- npm
- An account with Pusher, Cloudinary and Edgstore
- Clone the repository:
git clone https://github.com/yourusername/chatz.git
cd chatz- Install dependencies:
npm install- Set up environment variables:
Create a .env file in the root directory and add the following variables:
DATABASE_URL=your_mongodb_url
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLIENT_URL=http://localhost:3000
EDGE_STORE_SECRET_KEY=your_edge_store_secret_key
EDGE_STORE_ACCESS_KEY=your_edge_store_access_key
AUTH_SECRET=your_auth_secret
NODEMAILER_APP_PASS=your_nodemailer_app_pass
NODEMAILER_EMAIL=your_nodemailer_email
NEXT_PUBLIC_PUSHER_APP_KEY=your_pusher_app_key
PUSHER_APP_ID=your_pusher_app_id
PUSHER_SECRET=your_pusher_secret
PUSHER_CLUSTER=your_pusher_cluster- Run the development server:
npm run devOpen http://localhost:3000 with your browser to see the result.
Run the following command to apply database migrations:
npx prisma migrate dev --name initTo view and manage your database, you can use Prisma Studio:
npx prisma studioIf you encounter any bugs or issues while using Chatz, please report them by following these steps:
-
Search for existing issues: Before reporting a new bug, check if it has already been reported in the issues section.
-
Create a new issue: If you do not find an existing issue, create a new one. Provide as much detail as possible, including:
- A clear and descriptive title.
- Steps to reproduce the issue.
- Expected and actual results.
- Screenshots or videos, if applicable.
- Any relevant logs or error messages.
We welcome contributions to improve Chatz! To contribute, follow these steps:
-
Fork the repository: Fork the Chatz repository to your GitHub account.
-
Clone your fork: Clone the forked repository to your local machine.
git clone https://github.com/justuche224/chatz.git
cd chatz- Create a new branch: Create a new branch for your feature or bugfix.
git checkout -b feature/your-feature-name-
Make your changes: Implement your feature or bugfix.
-
Commit your changes: Commit your changes with a clear and concise commit message.
git commit -m "Add new feature: your feature description"- Push to your branch: Push your changes to your forked repository.
git push origin feature/your-feature-name- Create a pull request: Open a pull request to the Master repository. Provide a detailed description of your changes and the problem they solve or the feature they add.
We will review your pull request and provide feedback. Once approved, your changes will be merged into the Master repository.
This readme provides an overview of the features of Chatz, a social media application built with Next.js and Prisma, with real-time capabilities powered by Pusher. The app supports a wide range of social interactions, including user management, friendships, posts, comments, likes, shares, and messaging. Each component is designed to work seamlessly together, providing a robust and engaging user experience with real-time updates.