An open API service indexing awesome lists of open source software.

https://github.com/itsawa/img_hosting

A simple service image hosting
https://github.com/itsawa/img_hosting

hosting images server service

Last synced: about 1 year ago
JSON representation

A simple service image hosting

Awesome Lists containing this project

README

          

Project Setup and Launch Guide
Database Setup
Before using the application, you need to set up the required databases within Docker environments.

Initialize Docker Environments
Navigate to the Docker directory:

bash

cd ./docker/
Start the Docker environments:

bash

node docker_boot.js start
This command will start two Docker environments necessary for the project.

Auth Server Database Setup
Access the Docker container for the Auth Server:

bash

sudo docker-compose exec db psql -U imagehosting_users_admin -d imagehosting_users
Create the users table by executing the following SQL command:

sql

CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(255),
email VARCHAR(255),
password VARCHAR(255),
created_at TIMESTAMP,
client_id VARCHAR(255),
role VARCHAR(255)
);
Gallery Server Database Setup
Access the Docker container for the Gallery Server:

bash

sudo docker-compose exec db psql -U imagehosting_galery_admin -d imagehosting_galery
Create the gallery table by executing the following SQL command:

sql

CREATE TABLE gallery (
id SERIAL PRIMARY KEY,
owner_id INT,
owner_name VARCHAR(255),
image_address VARCHAR(255),
created_at TIMESTAMP,
views INT,
file_label VARCHAR(255),
public BOOLEAN
);
Environment Variables
You also need to create environment variable files (.env) for both the Auth Server and the Gallery Server.

For the Auth Server, create an .env file in the ./auth_server/ directory.
For the Gallery Server, create an .env file in the ./storage_server/controllers/ directory.
Configure Ports
You can configure the ports by editing the .env files or directly in the service_starter.js file located in the ./dev_ops/ directory. Note that the ports defined in service_starter.js have the highest priority.

Start the Project
To start the project, run the following command in the ./dev_ops directory:

bash

npm start
Alternatively, you can start it with:

bash

node services_starter.js
By following these steps, you will have your project environment set up and ready to run. Ensure all configurations are correctly applied to avoid any issues during runtime.