Hireable LogoHireable
Getting Started

Installation

Step-by-step guide to set up the Hireable development environment

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js 20.x or higher (Download)
  • npm 10.x or higher (comes with Node.js)
  • MongoDB (local installation or MongoDB Atlas)
  • Git for version control

Quick Start

1. Clone the Repository

git clone <repository-url>
cd hireable-monorepo

2. Install Dependencies

npm install

This installs dependencies for all workspaces (apps and packages) using npm workspaces.

3. Set Up Environment Variables

# Copy the example environment file
cp .env.example .env.local

Edit .env.local with your configuration:

# Application
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_APP_NAME="Hireable PH"
 
# Backend API
NEXT_PUBLIC_API_URL=http://localhost:3001/api
NEXT_PUBLIC_API_TIMEOUT=30000
 
# MongoDB Database
MONGODB_URI=mongodb://localhost:27017/hireable

4. Set Up Git Hooks (Optional)

Initialize Husky for pre-commit hooks:

npm run prepare

5. Start Development Server

npm run dev

This starts all applications via TurboRepo:

To run a specific app only:

# Run only the web app
npx turbo dev --filter=web
 
# Run only the API
npx turbo dev --filter=api

Available Scripts

Development

CommandDescription
npm run devStart all apps in development mode
npm run buildBuild all apps and packages
npm run startStart production servers

Code Quality

CommandDescription
npm run lintRun ESLint across all workspaces
npm run formatFormat code with Prettier
npm run validateRun type-check, lint, and format check

Testing

CommandDescription
npm run testRun tests once
npm run test:watchRun tests in watch mode
npm run test:uiRun tests with Vitest UI
npm run test:coverageGenerate coverage report
npm run test:e2eRun Playwright E2E tests

Maintenance

CommandDescription
npm run check-unusedCheck for unused code with Knip

Troubleshooting

MongoDB Connection Issues

If you see "Database connection failed":

  1. Ensure MongoDB is running locally, or
  2. Update MONGODB_URI to point to your MongoDB Atlas cluster
# For MongoDB Atlas
MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/hireable

Port Already in Use

If port 3000 or 3001 is already in use:

# Find and kill the process (Windows)
netstat -ano | findstr :3000
taskkill /PID <PID> /F
 
# Or change the port in the respective app's configuration

Node Version Issues

Ensure you're using Node.js 20.x:

node --version
# Should output v20.x.x or higher

Consider using nvm to manage Node versions.

Next Steps