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
- Host: GitHub
- URL: https://github.com/itsawa/img_hosting
- Owner: ITSawa
- Created: 2024-09-28T12:51:59.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-03T08:21:36.000Z (over 1 year ago)
- Last Synced: 2025-03-31T19:12:49.764Z (about 1 year ago)
- Topics: hosting, images, server, service
- Language: JavaScript
- Homepage:
- Size: 20.7 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
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.