Skip to main content

Get up and running quickly

This guide will help you clone the repository, install dependencies, and start both the frontend and backend servers.
Before you begin, ensure you have Node.js 20 (LTS) or higher and npm installed on your system. PostgreSQL must also be installed and running.
1

Clone the repository

Clone the F1 PitLane Predict repository to your local machine:
git clone https://github.com/P4ND4P0W3R/f1-pit-lane-predict.git
cd f1-pit-lane-predict
This creates a local copy of the project and navigates into the project directory.
2

Install frontend dependencies

Install all required dependencies for the Vue.js frontend:
npm install
This installs packages including:
  • Vue.js 3 and Vue Router
  • Vuex for state management
  • Prisma Client for database access
  • Axios for HTTP requests
  • TypeScript and Vite build tools
The installation may take a few minutes depending on your internet connection.
3

Install backend dependencies

Navigate to the server directory and install backend dependencies:
cd server
npm install
cd ..
This installs:
  • Nitropack for the server framework
  • bcrypt for password hashing
4

Configure the database

Set up your PostgreSQL database connection by creating a .env file in the root directory:
.env
DATABASE_URL="postgresql://username:password@localhost:5432/f1_pitlane_predict"
Replace username and password with your PostgreSQL credentials.
Never commit your .env file to version control. It contains sensitive credentials.
5

Generate Prisma Client

Generate the Prisma Client based on your schema:
npx prisma generate
Optionally, run migrations to create the database tables:
npx prisma migrate dev --name init
6

Start the frontend server

Launch the Vue.js development server:
npm run dev
You should see output similar to:
VITE v5.4.20  ready in 342 ms

➜  Local:   http://localhost:5173/
➜  Network: use --host to expose
➜  press h + enter to show help
The frontend is now accessible at http://localhost:5173.
7

Start the backend server

Open a new terminal window and start the Nitro.js backend:
cd server
npm run dev
You should see output indicating the server is running:
Nitro 2.x.x

ℹ Building Nitro Server (preset: node-server)
✔ Nitro built in X ms

ℹ Listening on http://localhost:3000
The API is now available at http://localhost:3000.

Verify your setup

Once both servers are running, you can verify the setup:
curl http://localhost:5173
Prisma Studio provides a visual interface to browse your database at http://localhost:5555.

Common issues

If port 5173 or 3000 is already in use, you can either:
  • Stop the process using that port
  • Change the port in vite.config.ts (frontend) or nitro.config.ts (backend)
Verify that:
  • PostgreSQL is running on your system
  • The DATABASE_URL in your .env file is correct
  • The database exists (create it with createdb f1_pitlane_predict)
  • Your PostgreSQL user has the necessary permissions
Try deleting node_modules and reinstalling:
rm -rf node_modules server/node_modules
npm install
cd server && npm install

Next steps

Detailed installation

Learn more about each component and configuration option

API reference

Explore available API endpoints and their usage

Database schema

Understand the data models and relationships

Development guide

Best practices for developing with F1 PitLane Predict

Build docs developers (and LLMs) love