Image hosting and sharing web application.
Commands to install Node.JS and NPM on ubuntu:
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt-get install -y nodejs
- Download and extract ImageUp_v0.1-alpha.zip
- Edit the
.env
file to configure server options (optional) - Run the command
npm run start
in the root directory - The server should now be up and running on http://localhost:8080
The port will vary if altered in .env
.
Keep in mind that running port 80
may require root privileges
Download project files
git clone https://github.com/Onusai/ImageUp.git
Install backend dependencies
cd ImageUp
npm install
Create a copy of the .env_sample
file (ImageUp/.env_sample
) and rename it to .env
(ImageUp/.env
)
Edit and configure the .env
file.
NODE_ENV
- The envirnoment where the application is located can be set to either development or production.
- When set to
production
(orprod
orp
), the entire application will be served. This includes the static front-end files located inImageUp/server/public
along with the back-end API - When set to
developoment
(or anything other than production), only the back-end API will be served.
DEV_PORT
- The port on which the application will be served when NODE_ENV
is set to development.
PROD_PORT
- The port on which the application will be served when NODE_ENV
is set to production.
DB_DIALECT
- Determines the database dialect. Set to sqlite
by default so that no additional setup is required, however you may also use: mysql
, mariadb
, postgres
, or mssql
. However, if using any of these you must setup the database server yourself.
The following variables are only required for mysql
, mariadb
, postgres
, or mssql
. Skip this section if using sqlite
.
DB_HOST
- Address to database server
DB_USER
- DB Username
DB_PASSWORD
- DB Password
DB_NAME
- DB Name
Install frontend dependenices
cd ImageUp/client
sudo npm i -g @vue/cli
npm install
Build
npm run build
The files will output into ImageUp/server/public
If NODE_ENV
is set to production
then it is expected that you have already built the static front-end files as described in the previous section.
npm run start
The application server should now be up and running.
If NODE_ENV
is set to development
then you must also simultaneously host the front-end in another terminal session. This is useful for debugging and development because changes to the front-end code update in the browser automatically.
cd ImageUp/client
npm run serve