Skip to content

AkashBhuiyan/embedqa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EmbedQA - Professional API Testing Platform

Java 21 Spring Boot 3.5 PostgreSQL

REST API backend for the EmbedQA API testing platform.

🌐 Frontend Repository: embedqa-ui

πŸš€ Quick Start

Tech Stack

Technology Version
Java 21
Spring Boot 3.5.7
PostgreSQL 16
Apache HttpClient 5.x

Getting Started

Prerequisites

  • Java 21
  • Maven 3.9+
  • PostgreSQL 16 (Docker or local installation

Database Setup

Option 1: Using Docker (Recommended)

cd docker-compose/db
docker-compose up -d

This creates:

  • Database: embedqa
  • User: embedqa_user
  • Password: embedqa_pass
  • Port: 5432

To stop the database:

docker-compose down

To stop and remove data:

docker-compose down -v

or

docker run -d \
  --name embedqa-postgres \
  -e POSTGRES_DB=embedqa \
  -e POSTGRES_USER=embedqa_user \
  -e POSTGRES_PASSWORD=embedqa_pass \
  -p 5432:5432 \
  postgres:16

Option 2: Manual PostgreSQL Installation

Linux (Ubuntu/Debian)

# Install PostgreSQL
sudo apt update
sudo apt install postgresql postgresql-contrib

# Start PostgreSQL service
sudo systemctl start postgresql
sudo systemctl enable postgresql

# Create database and user
sudo -u postgres psql
CREATE DATABASE embedqa;
CREATE USER embedqa_user WITH ENCRYPTED PASSWORD 'embedqa_pass';
GRANT ALL PRIVILEGES ON DATABASE embedqa TO embedqa_user;
\c embedqa
GRANT ALL ON SCHEMA public TO embedqa_user;
\q

macOS

# Using Homebrew
brew install postgresql@16
brew services start postgresql@16

# Create database and user
psql postgres
CREATE DATABASE embedqa;
CREATE USER embedqa_user WITH ENCRYPTED PASSWORD 'embedqa_pass';
GRANT ALL PRIVILEGES ON DATABASE embedqa TO embedqa_user;
\c embedqa
GRANT ALL ON SCHEMA public TO embedqa_user;
\q

Windows

  1. Download PostgreSQL from postgresql.org
  2. Run the installer and set password for postgres user
  3. Open pgAdmin or psql and run:
CREATE DATABASE embedqa;
CREATE USER embedqa_user WITH ENCRYPTED PASSWORD 'embedqa_pass';
GRANT ALL PRIVILEGES ON DATABASE embedqa TO embedqa_user;
\c embedqa
GRANT ALL ON SCHEMA public TO embedqa_user;


The backend will start at `http://localhost:8085`

πŸ“ Project Structure

src/main/java/com/akash/embedqa/
β”œβ”€β”€ EmbedqaApplication.java
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ HttpClientConfig.java
β”‚   └── WebConfig.java
β”œβ”€β”€ controller/
β”‚   β”œβ”€β”€ ApiExecutorController.java
β”‚   β”œβ”€β”€ CollectionController.java
β”‚   β”œβ”€β”€ EnvironmentController.java
β”‚   └── RequestController.java
β”œβ”€β”€ service/
β”‚   β”œβ”€β”€ ApiExecutorService.java
β”‚   β”œβ”€β”€ CollectionService.java
β”‚   β”œβ”€β”€ EnvironmentService.java
β”‚   └── RequestService.java
β”œβ”€β”€ repository/
β”‚   β”œβ”€β”€ ApiCollectionRepository.java
β”‚   β”œβ”€β”€ ApiRequestRepository.java
β”‚   β”œβ”€β”€ ApiResponseRepository.java
β”‚   β”œβ”€β”€ EnvironmentRepository.java
β”‚   └── EnvironmentVariableRepository.java
β”œβ”€β”€ model/
β”‚   β”œβ”€β”€ dtos/
β”‚   β”‚   β”œβ”€β”€ request/
β”‚   β”‚   └── response/
β”‚   └── entities/
β”œβ”€β”€ enums/
β”‚   β”œβ”€β”€ HttpMethod.java
β”‚   β”œβ”€β”€ BodyType.java
β”‚   └── AuthType.java
β”œβ”€β”€ exception/
β”‚   β”œβ”€β”€ GlobalExceptionHandler.java
β”‚   β”œβ”€β”€ ApiExecutionException.java
β”‚   └── ResourceNotFoundException.java
β”œβ”€β”€ converter/
β”‚   β”œβ”€β”€ AuthConfigConverter.java
β”‚   └── EnvironmentVariablesConverter.java
└── utils/
    └── HashMapConverter.java

API Endpoints

Execute API

Method Endpoint Description
POST /api/v1/execute Execute HTTP request

Collections

Method Endpoint Description
GET /api/v1/collections Get all collections
GET /api/v1/collections/{id} Get collection by ID
POST /api/v1/collections Create collection
PUT /api/v1/collections/{id} Update collection

Environments

Method Endpoint Description
GET /api/v1/environments Get all environments
GET /api/v1/environments/{id} Get environment by ID
POST /api/v1/environments Create environment
PUT /api/v1/environments/{id} Update environment
DELETE /api/v1/environments/{id} Delete environment

Requests

Method Endpoint Description
GET /api/v1/requests Get all requests (paginated)
GET /api/v1/requests/{id} Get request by ID
POST /api/v1/requests Save request
PUT /api/v1/requests/{id} Update request
DELETE /api/v1/requests/{id} Delete request

πŸ”§ Configuration

Application Profiles

Profile Database Description
dev PostgreSQL Development configuration
prod PostgreSQL Production configuration
test PostgreSQL Testing configuration

Environment Variables

# Database Configuration (Production)
DATABASE_URL=jdbc:postgresql://localhost:5432/embedqa
DATABASE_USERNAME=embedqa_user
DATABASE_PASSWORD=embedqa_pass

πŸ“– API Documentation

Swagger UI is available at: http://localhost:8085/swagger-ui.html

OpenAPI spec: http://localhost:8085/api-docs

Contributing

We welcome contributions! Here's how you can help:

Getting Started

  1. Fork the repository

  2. Clone your fork

    git clone https://github.com/YOUR_USERNAME/embedqa.git
    cd embedqa
  3. Create a branch

    git checkout -b feature/your-feature-name
  4. Set up the development environment

    # Start database
    cd docker-compose/db
    docker-compose up -d
    cd ../..
    
    # Run application
    ./mvnw spring-boot:run

πŸ›£οΈ Roadmap

  • WebSocket support
  • GraphQL support
  • Automated test runner
  • Test assertions builder
  • Request chaining
  • Mock server
  • Team collaboration
  • Request documentation generator

πŸ‘¨β€πŸ’» Author

Akash - GitHub


Made with ❀️ for developers who need API testing tool