Skip to content

tom-turner/files

Repository files navigation


Files v0.2

Description

A self hosted file hosting and sharing app with light and dark modes. Written in React, using a Node.js back end.

Installation

  1. Clone this repo
  2. Install Node
  3. Install Python
  4. npm install
  5. create database
  6. install Nginx
  7. configure Nginx
  8. use pm2 to keep it running 7.1 set to run on startup
  9. setup domain
  10. setup ssl

Building The App

  1. create a back end .env file using this template in the root directory:
# The port you want the api to run on.
PORT=5001

#A secret key used for signing user sessions with JWT. This is just an example, use something else.
TOKEN_SECRET="secret-jwt-token"

#A registration secret new users will need to create accounts. Again, this is just an example, use something else
REGISTER_SECRET="secret-register-token"

#Add your environment, development or production. 
NODE_ENV="production"
  1. create a client side .env using this template in the /client directory.
# The port you want to serve the application from.
PORT=5002

# The port your api is running on. This should match your back end .env.
REACT_APP_SERVER_PORT=5001

# The API URL you have setup if connecting from outside your network. 
REACT_APP_API="api.yourdomain.com"
  1. run 'npm run build' in the apps root directory. This should install and build the back end and front end with all their dependancies.
npm run build
  1. migrate the database to the latest version with 'npx db-migrate up -e production'
px db-migrate up -e production

Notes on development.

Adding Database Migration:

npx db-migrate create add-whatever with —sql

Then add the sql to make the change to the up file followed by:

npx db-migrate up or npx db-migrate up -e production 

Get into the database locally Your database name should be development.db if in development or production.db if in production.

sqlite3 development.db

About

A self hosted file hosting and sharing app written in React, using a Node.js back end.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •