Skip to main content

Prerequisites

Before installing the project, ensure you have the following installed:
  • Node.js (version 18 or higher)
  • npm (comes with Node.js)
  • PostgreSQL (version 12 or higher)
  • Git

Installation Steps

1

Clone the repository

Clone the project from GitHub to your local machine:
git clone https://github.com/AndreRuperto/portfolio-AndreRuperto.git
cd portfolio-AndreRuperto
2

Install frontend dependencies

Install all required dependencies for the React frontend:
npm install
This will install all packages listed in package.json including:
  • React & React DOM
  • Vite (build tool)
  • TailwindCSS
  • shadcn/ui components
  • React Query for data fetching
  • React Hook Form for forms
3

Install backend dependencies

Install dependencies for the Express backend:
npm run backend:install
Or manually:
cd backend
npm install
cd ..
This installs:
  • Express.js server
  • Prisma ORM
  • PostgreSQL client
  • Resend (email service)
  • JWT authentication
4

Set up PostgreSQL database

Create a PostgreSQL database for the project:
# Login to PostgreSQL
psql -U postgres

# Create database
CREATE DATABASE portfolio;

# Exit psql
\q
5

Configure environment variables

Copy the example environment file and configure it:
cp backend/.env.example backend/.env
See Environment Setup for detailed configuration.
6

Generate Prisma client

Generate the Prisma client to interact with your database:
npm run backend:generate
7

Run database migrations

Apply database migrations to set up your schema:
npm run backend:migrate
This creates the Project table and other necessary database structures.
8

Seed the database (optional)

Optionally populate your database with sample project data:
npm run backend:seed
9

Verify installation

Verify everything is set up correctly:
npm run lint
npm test

Next Steps

After installation, proceed to:

Troubleshooting

Node version issues

If you encounter Node.js version issues, use nvm to install the correct version:
nvm install 18
nvm use 18

PostgreSQL connection errors

Ensure PostgreSQL is running:
# On Linux/macOS
sudo service postgresql status

# On macOS with Homebrew
brew services list

Permission errors

If you encounter permission errors during npm install, avoid using sudo. Instead, configure npm to use a different directory:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'

Build docs developers (and LLMs) love