Skip to content

PECATHON/21_Works-on-my-machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation


# Project Setup Guide

This repository contains **frontend** and **backend** folders.  
Follow the steps below to clone, set up, and run the project.

---

##  Step 1: Clone the Repository

```bash
git clone https://github.com/PECATHON/21_Works-on-my-machine.git
cd 21_Works-on-my-machine/PECATHON

You will see:

/backend
/frontend

Backend Setup

Step 2: Navigate to Backend

cd backend

Step 3: Install Dependencies

npm install

Step 4: Create .env File

Create a file named .env inside the backend folder:

DATABASE_URL=postgresql://postgres:YOUR_PASSWORD@localhost:5432/realworld
JWT_SECRET=your-super-secret-jwt-key-change-this
NODE_ENV=development

Replace:

  • YOUR_PASSWORD → your PostgreSQL password
  • your-super-secret-jwt-key-change-this → any strong random key

Step 5: Setup the Database (PostgreSQL)

  1. Install PostgreSQL → https://www.postgresql.org/download/
  2. Create a database named realworld:
CREATE DATABASE realworld;

Step 6: Run Prisma Commands

# Generate Prisma client
npx prisma generate

# Apply migrations
npx prisma migrate deploy

# (Optional) Seed database
npx prisma db seed

Additional Migration (if needed)

npx prisma migrate dev --name add-voting-system
npx prisma generate

Step 7: Start Backend

npm start

Backend URL:

http://localhost:3000

Frontend Setup

Step 1: Navigate to Frontend

cd frontend

Step 2: Install Dependencies

npm install

Step 3: Start Frontend

npm start

Frontend will run on:

http://localhost:3001

(or whichever port React selects)


All Done!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors