Skip to content

File Sharing Application which is use go lang for backend , User can register and login , upload files single and multiple , files can be shared by sharing URL. Application is protected by JWT Auth middleware

Notifications You must be signed in to change notification settings

Abdev1205/file-sharing-app-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

File Sharing Application which is use go lang for backend , User can register and login , upload files single and multiple , files can be shared by sharing URL. Application is protected by JWT Auth middleware

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published