Skip to content

Commit

Permalink
πŸ™†β€β™‚οΈ README.md Setup locally
Browse files Browse the repository at this point in the history
  • Loading branch information
jiisanda committed Dec 31, 2023
1 parent 642ac58 commit b6528b9
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ DocFlow is a powerful Document Management API designed to streamline document ha


## πŸ“– API Documentation and Image

Explore the [API Documentation](https://documenter.getpostman.com/view/20984268/2s9YRGxUcp) for detailed information on how to use DocFlow's features.

Download docker image from [docker-hub](https://hub.docker.com/r/jiisanda/docflow).
Expand All @@ -37,6 +38,10 @@ Or just run
docker pull jiisanda/docflow:1
```

## πŸ”Έ Setup Docflow

Follow the steps outlined in the [setup.md](app/docs/setup.md) file

## 🧩 Implementation Detail


Expand Down Expand Up @@ -88,4 +93,4 @@ For detailed instructions, visit the [Document Preview Documentation](https://gi

For any questions or support, please [contact](mailto:[email protected]).

Enjoy using DocFlow to manage your documents seamlessly!
Test DocFlow to manage documents seamlessly!
2 changes: 1 addition & 1 deletion app/docs/commands/sample_env.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ S3_BUCKET=<s3_bucket>
S3_TEST_BUCKET=<s3_test_bucket>

# User Env
ACCESS_TOKEN_EXPIRE_MIN=30
ACCESS_TOKEN_EXPIRE_MIN=300
REFRESH_TOKEN_EXPIRE_MIN=30
ALGORITHM=<algorithm>
JWT_SECRET_KEY=<jwt_secret_key>
Expand Down
74 changes: 74 additions & 0 deletions app/docs/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# πŸš€ Setting up Docflow Locally

Just a 3-step process to get Docflow up and running on your local machine! 🌐

### 1️⃣ Clone the repository

```bash
git clone https://www.github.com/jiisanda/docflow.git
```

### 2️⃣ Configure Your Environment

Start by creating your environment file using the provided [sample_env.txt](commands/sample_env.txt). This file contains all the necessary
environment variables for Docflow. Save it inside the app/ directory.

#### PostgreSQL Setup

Set up your PostgreSQL environment variables:

- `DATABASE_HOSTNAME`: By default, set to `postgres`.
- `POSTGRES_USER`, `POSTGRES_PASSWORD` and `POSTGRES_PORT`: Enter your PostgreSQL username, password, and port
(default is `5432`).
- `POSTGRES_DB` and `POSTGRES_DB_TESTS`: Specify your database names (`POSTGRES_DB_TESTS` can be left blank).

#### AWS Setup
For AWS credentials (`AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`), follow these steps:

>1. Sign in to the [AWS Management Console]() using your AWS account's root user credentials.
>2. Navigate to Security Credentials and create an access key.
>3. Copy the access key ID and secret key securely.
>4. For S3 bucket setup, refer to creating a [bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html).
>
> Source: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user_manage_add-key.html
#### User Environment

Keep `ACCESS_TOKEN_EXPIRE_MIN` and `REFRESH_TOKEN_EXPIRE_MIN` as default. Update the `ALGORITHM` of your choice (e.g., `HS256` or `RS256`).

Generate `JWT_SECRET_KEY` and `JWT_REFRESH_SECRET_KEY` using Python:
```bash
docflow$ python
>> import secrets
>> secrets.token_urlsafe(length=32)
'some-random-secret-of-length-32'
>> secret.token_hex(length=32)
'some-random-secret-of-length-32'
```
#### Email Service

This section explains how to set up the email service using Gmail. Configure the following variables:

`SMTP_SERVER`: `smtp.gmail.com`
`SMTP_PORT`: `587`
`EMAIL`: `Your email address used to create the app`.
`APP_PASSWORD`: `Generate an app password from your Google Account`.
Before starting, ensure you have enabled "Two-Factor Authentication" and "Less secure app access" for your Gmail account.

>For a deeper understanding of environment variables in Python, check out this article:
>[@dev.to/jiisanda](https://dev.to/jiisanda/how-does-python-dotenv-simplify-configuration-management-3ne6)

### 3️⃣ Run with Docker-Compose

Ensure Docker is installed, then run:

```commandline
docker-compose up --build
```

That's it! Docflow is now running on localhost:8000.

## ⏭️ Next Step
To test it, use Postman following the steps in
[postman.md](features/postman.md).

0 comments on commit b6528b9

Please sign in to comment.