Giter Site home page Giter Site logo

ssahibsingh / rapidfort-file-server-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 1.69 MB

A Node.js app using Azure Blob Storage for seamless file upload, storage, and retrieval. Deployed with Docker and Kubernetes for scalability.

Home Page: https://fileserver.sahibsingh.dev

JavaScript 85.18% CSS 10.28% Dockerfile 4.54%
azure-blob-storage docker expressjs file-upload-server github-actions kubernetes mongodb nextjs nodejs rest-api

rapidfort-file-server-api's Introduction

Project Documentation: File Upload and Hosting Web Server - Rapid Fort

Introduction

File Upload and Hosting Web Server project demonstrates the creation of a REST API-based web server that allows users to upload files, provides information about uploaded files, and hosts the files on a Kubernetes cluster.

Table of Contents

Project Overview

The project aims to create a web server that facilitates file uploading and hosting, providing users with an API to upload files, view file information, and access hosted files. The project comprises several key components:

  • Backend Server: Built using Node.js and Express.js, the backend handles file uploads, metadata storage in MongoDB, and interactions with Azure Blob Storage for file hosting.

  • Frontend Interface: A basic frontend interface is created to demonstrate file upload and file information retrieval via API requests.

  • Azure Blob Storage: Files uploaded by users are stored in Azure Blob Storage, ensuring secure and scalable file hosting.

  • MongoDB: Metadata about uploaded files, including filename, size, and content type, is stored in MongoDB.

  • Docker: Docker images are built for the frontend and backend components to ensure consistency and ease of deployment.

  • Kubernetes: Kubernetes manifest files define the deployment and service configurations for hosting the application on a Kubernetes cluster.

Getting Started

To run the project locally, follow these steps:

  1. Clone the GitHub repository:

    git clone https://github.com/ssahibsingh/rapidfort-file-server-api.git
  2. Navigate to the frontend directory and run npm install to install frontend dependencies.

  3. Navigate to the backend directory and run npm install to install backend dependencies.

  4. Create an Azure Blob Storage account and obtain the connection string.

  5. Set up a MongoDB instance and obtain the connection URI.

  6. Create a .env file in the backend directory with the following environment variables:

    PORT=8000
    AZURE_STORAGE_CONNECTION_STRING=[Azure Blob Storage Connection String]
    MONGODB_URI=[MongoDB Connection URI]
    
  7. Start the backend server: npm start in the backend directory.

  8. Create a .env.local file in the frontend directory with the following environment variables:

    NEXT_PUBLIC_BACKEND_URL=`${backend-server-url}/api`
    
  9. Start the frontend server: npm start in the frontend directory.

  10. Access the application in your browser at http://localhost:3000.

API Endpoints

The API provides the following endpoints:

  • POST /upload: Uploads a file to Azure Blob Storage and stores metadata in MongoDB.
  • GET /file/:name: Retrieves metadata for a specific file.
  • GET /download/:name: Downloads the specified file.

User Interface

The basic frontend interface allows users to:

  • Upload a file.
  • View metadata for a specific file.
  • Download a file.

Frontend Interface

Continuous Integration and Deployment

GitHub Actions is used for continuous integration and deployment. The following tasks are automated using GitHub Actions:

  1. Building Docker images for the frontend and backend components.
  2. Pushing Docker images to Docker Hub.
  3. Deploying the application to an Azure VM's Kubernetes cluster.

Deploying to Kubernetes

The application is deployed to a Kubernetes cluster using Kubernetes manifest files located in the azure-deployment directory. The deployment includes the frontend and backend components, along with appropriate service configurations.

To deploy:

  1. Configure Kubernetes context using Azure credentials.
  2. Ensure kubectl is installed.
  3. Run the GitHub Actions workflow to deploy the application.

Deployed Links

Conclusion

The "File Upload and Hosting Web Server" project demonstrates the creation of a REST API-based web server, leveraging Azure Blob Storage and MongoDB for file hosting and metadata storage. The integration of Docker and Kubernetes streamlines deployment, ensuring scalability and flexibility.

rapidfort-file-server-api's People

Contributors

ssahibsingh avatar

Watchers

 avatar

Forkers

gurtaransingh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.