Skip to main content

Prerequisites

Before you begin, ensure you have the following installed:
  • Node.js (v18 or higher)
  • npm or yarn
  • PostgreSQL (v12 or higher)
  • Git

Installation

1

Clone the repository

git clone <repository-url>
cd nest-uber-app-backend
2

Install dependencies

npm install
This will install all required packages including:
  • NestJS framework
  • TypeORM for database management
  • Socket.io for WebSocket support
  • JWT and Passport for authentication
  • PostgreSQL driver
3

Configure environment variables

Copy the example environment file:
cp .env.example .env
See Configuration for detailed environment setup.
4

Set up the database

Ensure PostgreSQL is running and create the database:
CREATE DATABASE rodando;
See Database Setup for more details.
5

Run the application

Start the development server:
npm run start:dev
The server will start on http://localhost:3000 (or the port specified in your .env file).

Verify Installation

1

Check API health

Visit http://localhost:3000/api in your browser or use curl:
curl http://localhost:3000/api
2

Access Swagger documentation

If Swagger is enabled in your environment, access the API documentation at:
  • Main API: http://localhost:3000/api/docs
  • Auth Docs: http://localhost:3000/docs/auth
  • Users Docs: http://localhost:3000/docs/users

Available Scripts

ScriptDescription
npm run startStart the application
npm run start:devStart in watch mode for development
npm run start:debugStart in debug mode
npm run start:prodStart in production mode
npm run buildBuild the application
npm run lintRun ESLint
npm run lint:fixFix ESLint issues
npm run testRun tests
npm run test:watchRun tests in watch mode
npm run test:covRun tests with coverage

Next Steps

Configuration

Configure environment variables and application settings

Database Setup

Set up database connections and migrations

WebSockets

Learn about real-time communication

API Reference

Explore the API endpoints

Build docs developers (and LLMs) love