-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f05b9f1
commit e40bce1
Showing
5 changed files
with
77 additions
and
7 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
FROM python:3.9-slim-buster | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y ffmpeg | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Sentiment Analysis FastAPI Project | ||
|
||
This is a sentiment analysis API developed with FastAPI | ||
|
||
### Prerequisites | ||
|
||
- Docker | ||
- Docker Compose | ||
- Google Cloud Platform | ||
- PostgreSQL | ||
|
||
### Configuration | ||
|
||
#### Environment Variables | ||
|
||
Create a file named `.env` in the project root directory and add your configurations, following the example below: | ||
|
||
```env | ||
POSTGRES_DB=sentimentanalysis_db | ||
POSTGRES_USER=username | ||
POSTGRES_PASSWORD=password | ||
HOST=localhost | db | IP | ||
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${HOST}:5432/${POSTGRES_DB} | ||
GCP_CREDENTIALS_FILE=gcp.json | ||
``` | ||
|
||
Google Cloud Credentials | ||
|
||
To authenticate with the Google Cloud Platform, you'll need to create a service account, download the JSON key file, and set the GCP_CREDENTIALS_FILE environment variable in your .env file to point to this key file. | ||
|
||
|
||
```json | ||
{ | ||
"type": "service_account", | ||
"project_id": "", | ||
"private_key_id": "", | ||
"private_key": "", | ||
"client_email": "", | ||
"client_id": "", | ||
"auth_uri": "", | ||
"token_uri": "", | ||
"auth_provider_x509_cert_url": "", | ||
"client_x509_cert_url": "", | ||
"universe_domain": "" | ||
} | ||
``` | ||
#### Installing | ||
|
||
```sh | ||
git clone https://github.com/WilliamSilveiraF/sentiment-analysis.git | ||
|
||
|
||
cd sentiment-analysis | ||
|
||
|
||
docker compose up | ||
``` | ||
|
||
#### Usage | ||
|
||
```sh | ||
The server is up and running at http://localhost:8080/ | ||
``` | ||
|
||
#### Flow Diagram | ||
|
||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters