Skip to content

Files

Latest commit

7a050d8 · Sep 15, 2024

History

History
98 lines (57 loc) · 3.02 KB

README.md

File metadata and controls

98 lines (57 loc) · 3.02 KB

Installation Guide

Prerequisites

Before you begin, ensure you have the following installed:

  • Docker
  • Docker Compose

Setup

  1. Clone the repository:

    git clone https://github.com/Abdev1205/21BCE11045_Backend.git
  2. Build and start the application:

    Use Docker Compose to build and start the application along with its dependencies.

    docker-compose up --build

    This command will:

    • Build the Docker images for the Go application, PostgreSQL, and Redis and then project will start
  3. Verify the setup:

    Once the containers are up, you can verify that the application is running by accessing the server's endpoint. By default, it should be available at http://localhost:8080.

Project Structure

  • /server: Contains the entry point for the server.
    • main.go: Starts and configures the server.
  • /internal: non-exportable packages.
    • /adapters: Infrastructure layer (database, file handling, caching).
      • /database: PostgreSQL database.
      • /cache: Redis caching.
    • /application: Application layer.
      • /file_service: File service logic (Upload, Retrieve, etc.).
      • /auth_service: JWT authentication logic (Login, Register, etc.).
  • /pkg: Shared utilities.
    • /middleware: Middleware for JWT authentication and other purposes.
    • /config: Configuration management (DB, Redis, JWT, etc.).
  • docker-compose.yml and Dockerfile: Configuration for Docker Compose and Docker build.
  • go.mod: Go module dependencies.

Demo

Postman Api Endpoints

Project Starting

image

Register User

image

Login User

image

  • also getting jwt cookies

image

File Upload

  • Authenticated Route requires Authorization Bearer Token

image

  • After passing Token files upload successfully locally in upload folder

image

  • We can see our files from /upload routes

image

  • Getting All files

image

  • Getting shareable link by passing file id

image

  • Searching Files based on Query Params

image