Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/iDevRanjan/lws-ra-b4-assignment-five/llms.txt

Use this file to discover all available pages before exploring further.

LWS Job Portal runs as two separate processes — an Express 5 backend API and a React 19 + Vite frontend — both of which must be started before you can use the application. This guide walks you through every step required to get a fully functional local environment, from cloning the repository to registering your first account.

Prerequisites

Before you begin, make sure the following are available on your machine:
RequirementMinimum VersionNotes
Node.js18+Required by both frontend and backend
npmBundled with Node.jspnpm or yarn also work
GitAny recent versionFor cloning the repository
Both the backend API server and the frontend Vite dev server must be running simultaneously. Open two separate terminal windows — one for each process — before navigating to the app in your browser.

Setup Steps

1

Clone the Repository

Clone the project to your local machine and navigate into the project directory.
git clone <repository-url>
cd <repository-name>
2

Configure and Start the Backend

The backend lives in the /backend subdirectory. Install its dependencies, create its environment file, and start the development server.
cd backend
npm install
Create a .env file inside the backend/ directory:
PORT=5000
NODE_ENV=development
Start the backend with nodemon for automatic restarts on file changes:
npm run dev
You should see the following output when the server starts successfully:
Database connected successfully.
Database synced.
Server is running on port 5000
Sequelize automatically creates and syncs the SQLite database file on first start — no manual migration step is required.
3

Configure and Start the Frontend

Open a new terminal window and navigate back to the project root (not the backend/ subdirectory). Install frontend dependencies and create the frontend environment file.
# From the project root
npm install
Create a .env file in the project root directory:
VITE_API_BASE_URL=http://localhost:5000
Start the Vite development server:
npm run dev
Vite will print a local URL once it is ready:
VITE ready in Xms

  ➜  Local:   http://localhost:5173/
4

Open the Application

Open your browser and navigate to:
http://localhost:5173
The LWS Job Portal home page will load, showing the public job listings feed. If the page is blank or shows an API error, confirm that the backend server is running on port 5000 and that VITE_API_BASE_URL matches the backend address.
5

Register Your First Account

Click Register in the navigation bar to choose your account type.
Navigate to /jobseeker-register or click “Register as Job Seeker” on the login page. Fill in your name, email, and password to create a USER-role account. After registration you will be redirected to the Job Seeker Dashboard.
The two roles — USER and COMPANY — have entirely separate dashboards and feature sets. A single email address can only be registered under one role.

Environment Variables

Frontend (project root .env)

VariableRequiredDefaultDescription
VITE_API_BASE_URL✅ YesFull base URL of the backend API, e.g. http://localhost:5000
Vite only exposes variables prefixed with VITE_ to browser code. Do not store secrets in the frontend .env file — they are visible in the compiled bundle.

Backend (backend/.env)

VariableRequiredDefaultDescription
PORTNo5000Port the Express server listens on
NODE_ENVNodevelopmentControls error verbosity in the global error handler
JWT_SECRETYesSecret key used to sign and verify JSON Web Tokens

Available npm Scripts

Frontend (project root)

ScriptCommandDescription
devnpx kill-port 5173 && viteKills any existing process on port 5173, then starts the Vite dev server
buildvite buildCompiles and bundles the app for production
linteslint .Runs ESLint across all source files
previewvite previewServes the production build locally for testing

Backend (backend/)

ScriptCommandDescription
devnodemon server.jsStarts the Express server with hot-reload via nodemon

What to Do Next

Architecture

Understand the monorepo layout, frontend folder structure, and backend routing patterns.

API Reference

Browse all available REST endpoints with request and response schemas.

Build docs developers (and LLMs) love