Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB installation guide added (for macOS users) #140

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
/server/logs

/build
/start

package-lock.json
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ docker-compose up -d --build
```

### Without Docker
1. Ensure you have Node.js, PostgreSQL, MinIO and Redis installed on your system.
1. Ensure you have Node.js, PostgreSQL, MinIO and Redis installed on your system. Check out the [installation guide](./docs/DB%20installation%20guide.md) here!
2. Run the commands below
```
git clone https://github.com/getmaxun/maxun
Expand All @@ -50,6 +50,7 @@ cd maxun-core
npm install

# start frontend and backend together
cd ..
npm run start
```
You can access the frontend at http://localhost:5173/ and backend at http://localhost:8080/
Expand Down
112 changes: 112 additions & 0 deletions docs/DB installation guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
- [For MacOS](#for-macos)
- [Redis installation](#redis-installation)
- [Postgres Installation](#postgres-installation)
- [MinIO installation](#minio-installation)


<a name="for-macos"></a>
# For MacOS

<a name="redis-installation"></a>
## Redis installation
```
# installing redis from Homebrew
brew install redis

# start instance of redis server in background
brew services start redis

# Check if its running using
brew services info redis

# for closing it use
brew services stop redis

# alternatively, start redis instance in foreground of terminal, note that the server will close if the terminal is closed
redis-server
```

Redis runs default on Port: 6379, which is already written in the sample .env file

<a name="postgres-installation"></a>
## Postgres Installation
```
# Installing postgres from Homebrew
brew install postgresql

# Check if postgres is installed properly using
postgres -V
# >> postgres (PostgreSQL) 14.13 (Homebrew)

# Enter postgres CLI using
psql postgres

# After entering postgres CLI, which looks like "postgres=# "
# Create a role name with password for accessing db
CREATE ROLE maxun WITH LOGIN PASSWORD 'maxun';

# Check if role is successfully created
\du

# Create a DB for maxun usage
CREATE DATABASE maxundb;

# Give all permissions related to the DB to the user
GRANT ALL PRIVILEGES ON DATABASE maxundb TO maxun;

# Check if the database is connecting by user "maxun"
# Quit postgres cli using
\q

# Re-enter as the user maxun
psql postgres -U maxun

# Try to connect with above created db
\connect maxundb
# You should see the message "You are now connected to database "maxundb" as user "maxun"."
```

<a name="minio-installation"></a>
## MinIO installation
```
# Install minio using homebrew
brew install minio

# Start a minio server
minio server start

```

Minio Server information will then display on terminal like:
```
API: http://192.168.55.102:9000 http://127.0.0.1:9000
RootUser: minioadmin
RootPass: minioadmin

Console: http://192.168.55.102:49809 http://127.0.0.1:49809
RootUser: minioadmin
RootPass: minioadmin

Command-line: https://docs.min.io/docs/minio-client-quickstart-guide
$ mc alias set myminio http://192.168.55.102:9000 minioadmin
minioadminDocumentation: https://docs.min.io
```

- Copy the Console URL (the 2nd one), here i.e `http://127.0.0.1:49809` and open in a browser
- You will be welcomed with a login page, copy the RootUser and RootPass as mentioned above, here i.e `minioadmin`
![MinIO Login Page](./images/minio-1.png)
- After entering dashboard, select "buckets" on left navbar, select "create bucket", and create a bucket named "maxundb"
- After the creation of bucket, make sure to visit the bucket page and change the access policy to "Public"
![MinIO Select Bucket](./images/minio-2.png)
![MinIO Select Bucket](./images/minio-7.png)

- Once the bucket is created, Go to "identities" section from navbar and under "user" subsection click "create user" and create a user with name and password "minio-maxun" with below settings
![MinIO Create User](./images/minio-3.png)
- After the user is created, go to the newly created user page, go into Service account section and click "Create Access key"
![MinIO Access key](./images/minio-4.png)
- Click the Create button and a popup will appear from where you can copy the Access and Secret key to paste it the .env file
![MinIO Access key](./images/minio-5.png)
![MinIO Access key](./images/minio-6.png)

Also Check out the [Sample ENV](env_sample_without_docker.txt) for setting up Maxun without Docker
(Note that above variables names used in the example already)
22 changes: 22 additions & 0 deletions docs/env_sample_without_docker.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# App Setup
NODE_ENV=development # Set to 'development' or 'production' as required
JWT_SECRET=your_jwt_secret_key # Replace with a secure JWT secret key
DB_NAME=maxundb # Your PostgreSQL database name
DB_USER=maxun # PostgreSQL username
DB_PASSWORD=maxun # PostgreSQL password
DB_HOST=localhost # Host for PostgreSQL in Docker
DB_PORT=5432 # Port for PostgreSQL (default: 5432)
ENCRYPTION_KEY=your_encryption_key # Key for encrypting sensitive data (passwords and proxies)
MINIO_ENDPOINT=localhost # MinIO endpoint in Docker
MINIO_PORT=9000 # Port for MinIO (default: 9000)
MINIO_ACCESS_KEY= <paste key here> # MinIO access key
MINIO_SECRET_KEY= <paste key here> # MinIO secret key
REDIS_HOST=localhost # Redis host in Docker
REDIS_PORT=6379 # Redis port (default: 6379)

# Backend URLs
BACKEND_URL=http://localhost:8080 # Internal URL for backend service
VITE_BACKEND_URL=http://localhost:8080 # URL used by frontend to connect to backend

# Telemetry Settings - Please keep it enabled. Keeping it enabled helps us understand how the product is used and assess the impact of any new changes.
MAXUN_TELEMETRY=true
Binary file added docs/images/minio-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/minio-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/minio-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/minio-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/minio-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/minio-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/minio-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.