Skip to content

devtalksgroup/resume-api

Repository files navigation

Resume API

A NestJS-based REST API for resume management built by Devtalks Group.

Table of Contents

Prerequisites

For Docker Development

For Local Development

Quick Start

  1. Clone the repository

    git clone <repository-url>
    cd resume-api
  2. Set up environment variables

    cp .env.example .env
    # Edit .env with your configuration
  3. Start with Docker (Recommended for development)

    # For development (database only)
    docker-compose -f docker-compose.local.yml up -d
    
    # Install dependencies and start the app locally
    pnpm install
    pnpm run start:dev

Development Setup

Option 1: Docker Development (Recommended)

This approach runs PostgreSQL and pgAdmin in Docker while running the NestJS app locally for better development experience.

  1. Start the database services

    docker-compose -f docker-compose.local.yml up -d
  2. Install dependencies

    pnpm install
  3. Start the development server

    pnpm run start:dev
  4. Access the services

Option 2: Local Development (Non-Docker)

  1. Install PostgreSQL

    # Ubuntu/Debian
    sudo apt update
    sudo apt install postgresql postgresql-contrib
    
    # macOS (with Homebrew)
    brew install postgresql@17
    brew services start postgresql@17
    
    # Arch Linux
    sudo pacman -S postgresql
    sudo systemctl enable postgresql
    sudo systemctl start postgresql
  2. Create database and user

    sudo -u postgres psql

    In PostgreSQL shell:

    CREATE DATABASE resume_api;
    CREATE USER postgres WITH PASSWORD 'postgres123';
    GRANT ALL PRIVILEGES ON DATABASE resume_api TO postgres;
    \q
  3. Install dependencies

    pnpm install
  4. Configure environment variables Create a .env file with local database settings:

    # Application
    NODE_ENV=development
    APP_PORT=3000
    
    # Database
    DATABASE_HOST=localhost
    DATABASE_PORT=5432
    DATABASE_USER=postgres
    DATABASE_PASSWORD=postgres123
    DATABASE_NAME=resume_api
  5. Start the development server

    pnpm run start:dev

Environment Configuration

Create a .env file in the root directory with the following variables:

# Application Configuration
NODE_ENV=development
APP_PORT=3000

# Database Configuration
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USER=postgres
DATABASE_PASSWORD=postgres123
DATABASE_NAME=resume_api

# pgAdmin Configuration (for Docker setup)
PGADMIN_EMAIL=admin@example.com
PGADMIN_PASSWORD=admin123
PGADMIN_PORT=5050

Available Scripts

# Development
pnpm run start:dev      # Start with hot reload
pnpm run start:debug    # Start with debug mode

# Building
pnpm run build          # Build the application
pnpm run start:prod     # Run production build

# Testing
pnpm run test           # Run unit tests
pnpm run test:watch     # Run tests in watch mode
pnpm run test:cov       # Run tests with coverage
pnpm run test:e2e       # Run end-to-end tests

# Code Quality
pnpm run lint           # Run ESLint
pnpm run format         # Format code with Prettier

API Documentation

Once the application is running, you can access the Swagger API documentation at:

The API documentation includes:

  • All available endpoints
  • Request/response schemas
  • Authentication requirements
  • Interactive API testing interface

Production Deployment

Full Docker Setup

For production deployment, use the main docker-compose file:

# Build and start all services
docker-compose up -d

# View logs
docker-compose logs -f app

# Stop services
docker-compose down

This setup includes:

  • NestJS application container
  • PostgreSQL database
  • pgAdmin for database management
  • Proper networking and volume management

Environment Variables for Production

Ensure you set secure values for production:

NODE_ENV=production
DATABASE_PASSWORD=<secure-password>
PGADMIN_PASSWORD=<secure-password>

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes
  4. Run tests: pnpm run test
  5. Commit your changes: git commit -am 'Add feature'
  6. Push to the branch: git push origin feature-name
  7. Submit a pull request

Built with ❤️ by Devtalks Group

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •