Skip to content

Arbaz0001/eh-labs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

# Community Platform

A full-stack web application for managing communities, posts, comments, likes, and chat functionalities. Built with **Prisma**, **TypeScript**, **Node.js**, and **React**.

## Table of Contents

- [Features](#features)
- [Tech Stack](#tech-stack)
- [Installation](#installation)
  - [Backend Setup](#backend-setup)
  - [Frontend Setup](#frontend-setup)
- [Prisma Workflow](#prisma-workflow)
- [Folder Structure](#folder-structure)
- [License](#license)

---

## Features

- User Authentication (Registration, Login, Password Hashing)
- Create and manage communities
- Post creation, commenting, and likes
- Real-time chat with rooms and messaging
- Call functionality (audio and video)
- Zod-based form validation

---

## Tech Stack

### Backend
- **Node.js** with **TypeScript**
- **Prisma** (ORM for PostgreSQL)
- **Express.js**
- **bcrypt** for password hashing
- **Zod** for validation

### Frontend
- **React** with **TypeScript**
- **Redux** for state management
- **TailwindCSS** for styling
- **React Router** for navigation

---

## Installation

### Backend Setup

1. Clone the repository and navigate to the backend directory:
   ```bash
   git clone https://github.com/your-repo-name.git
   cd backend
  1. Install dependencies:

    npm install
  2. Create a .env file in the backend directory with the following content:

    DATABASE_URL="postgresql://<user>:<password>@<host>:<port>/<database>"
    PORT=5000
    JWT_SECRET="your_jwt_secret"
  3. Generate the Prisma Client:

    npx prisma generate
  4. Apply migrations to the database:

    npx prisma migrate dev --name init
  5. Start the backend server:

    npm run dev

The backend server will run at http://localhost:5000.


Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Create a .env file in the frontend directory with the following content:

    REACT_APP_API_URL=http://localhost:5000
  4. Start the frontend development server:

    npm start

The frontend server will run at http://localhost:3000.


Prisma Workflow

  1. Modify the schema file located at prisma/schema.prisma.
  2. Generate the Prisma Client after modifying the schema:
    npx prisma generate
  3. Apply migrations to the database:
    npx prisma migrate dev --name migration_name
  4. (Optional) Open Prisma Studio to view and manage your database:
    npx prisma studio

Folder Structure

Backend

backend/
├── prisma/
│   ├── schema.prisma
│   └── migrations/
├── src/
│   ├── middlewares/
│   ├── controllers/
│   ├── routes/
│   ├── utils/
│   └── server.ts
└── package.json

Frontend

frontend/
├── src/
│   ├── components/
│   ├── pages/
│   ├── features/
│   ├── hooks/
│   ├── utils/
│   └── App.tsx
└── package.json

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute it as you like.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 65.2%
  • JavaScript 32.9%
  • HTML 1.6%
  • CSS 0.3%