Code Monkey home page Code Monkey logo

dropbox-clone-with-go's Introduction

Dropbox/Google Drive Clone With Go

Dropbox/Google drive clone with Go is a side project inspired by Nikhil Gupta article titled Design Dropbox/Google Drive . Following the design architecture described in the article and the Hexagonal architecture, I learnt how to develop and design micro services and cloud native applications using Go. Everything was not covered in this project and a lot more challenges and improvements will be tackled as I continue working on this project.

Challenges & Solutions

  • Generating random unique number between 1 - 1000 per multi upload parts: Using recursion I traversed through a map containing previously generated/stored values to check if the current generated number already exists and if it does I regenerate another to ensure the numbers are not generated twice.
  • Running Database Migration in CMD without running application server: Using Go command-line flags package, I programmed arguments and options which enables me to check if a user is trying to run the application server or DB migration via the command line.
  • Service Discovery: Using Docker-compose and consul, I ensured each service is running on the same network and each has the CONSUL_HTTP_ADDR environment variable created during containerization. Each service has a service registration function which registers them in consul for other services to be able to send requests and receive responses. This pattern of communication is only being used by the API Gateway service as I aim to use gRPC for service to service communication.

Technologies/Tools

  • Languages: Golang
  • Web Frameworks: Gin
  • Databases: DynamoDB
  • Tools: Git, Docker, Consul, Redis
  • Cloud Services: AWS (S3)
  • Frontend Technologies: HTML, CSS, JavaScript (Vue.js)
  • Problem-solving and algorithmic skills

Running The Application

To run this application clone this repository down to your local machine and follow the below instructions. This application requires you to have docker setup and running in your machine

  • CD into working directory
  • In each service folder create a .env file following the .env-example and ensure you have all the values setup in it
  • In the root directory of the application where you have the go.work file run go mod tidy to download all required packages
  • Run migrations in each service folder using go run . create -table_name='name' -primary_key='primary_key' -range_key='range_key'. Add the -mt=update flag to update table.
  • Use docker-compose up --build to run and build all services once.
  • Test endpoints using postman or any client service of your choice

Required Tables

  • API_GATEWAY: table_name=users, primary_key=ID, range_key=email, secondary_Index=email
  • FILE_META_DATA_SERVICE: table_name=files, primary_key=id, range_key=userid,folderid, secondary_Index=userid,folderid; table_name=folders, primary_key=id, range_key=userid, secondary_Index=userid
  • FILE_UPLOAD_SERVICE: table_name=upload_parts -primary_key=uploadid -range_key=userid
  • USER_SERVICE: table_name=users, primary_key=ID, range_key=email, secondary_Index=email

Design Screenshot

Service Design Screenshot

dropbox-clone-with-go's People

Contributors

chibuikeig avatar

Watchers

 avatar

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.