Giter VIP home page Giter VIP logo

home-cloud's Introduction

Home Cloud

Host your own cloud at home

Table of Contents

Development Setup

First, clone the repo and cd into the project:

git clone https://github.com/antoniosarosi/home-cloud.git
cd home-cloud

Local setup (Linux & Windows)

Install dependencies:

cd server
npm i
cd ../client # ..\client on Windows
npm i
cd ..

Run locally

Backend

Move to the server directory:

cd server

Open sample.env and copy its content into a new file named .env, then set the correct value for HOME_CLOUD_STORAGE. Now start the server:

npm run dev

Frontend

Move to the client directory:

cd client

Open sample.env and copy its content into a new file named .env, then set the correct value for REACT_APP_API_URL. Finally, start the development server:

npm start

Backend will be running on port 5000 and frontend on port 3000 (if not already in use).

Docker (Linux)

First, set the correct value for HOME_CLOUD_STORAGE env variable:

export HOME_CLOUD_STORAGE="/home/user/example"

Then create a .env file in ./client/ and set this value:

REACT_APP_API_URL="http://localhost:8081"

Install dependencies:

docker-compose run express npm i
docker-compose run react npm i

Run on Docker containers

docker-compose up

Backend will be running on port 8081 and frontend on port 8080 (if not already in use).

Production Setup

Local (Linux & Windows)

Backend

Move to ./server/ and set the correct value for HOME_CLOUD_STORAGE in .env (see examples in sample.env), and then run npm start:

npm start

Frontend

Move to ./client/ and create a file named .env.production, set the correct value for REACT_APP_API_URL (see examples in sample.env). Then, install serve globaly:

npm i -g serve

Build the app:

npm run build # Or yarn build

Start the server:

serve -s build -l 3000 # Or another port of your choice

Docker (Linux)

First, set the correct value for HOME_CLOUD_STORAGE env variable:

export HOME_CLOUD_STORAGE="/home/user/example"

Then create a .env.production file in ./client/ and set the correct value for the API URL (your IP address and port 8081):

REACT_APP_API_URL="http://192.168.1.2:8081"

Build images and run containers:

docker-compose -f docker-compose.yml -f docker-compose.prod.yml up

home-cloud's People

Contributors

antoniosarosi avatar ca-santiago avatar dependabot[bot] avatar hhbaker 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.