@@ -16,14 +16,36 @@ It generates QR Codes for the provided URL, the front-end is in NextJS and the A
1616The API code exists in the ` api ` directory. You can run the API server locally:
1717
1818- Clone this repo
19+ - Create a AWS User with AmazonS3FullAccess
20+ - Create a S3 Bucket and select ACL enable for public access, Uncheck block bucket.
1921- Make sure you are in the ` api ` directory
20- - Create a virtualenv by typing in the following command: ` python -m venv .venv `
21- - Install the required packages: ` pip install -r requirements.txt `
22+ - Create a virtualenv by typing in the following command: ` python3 -m venv .venv `
23+ - Run command ` source .venv/bin `
24+ - Run command ` source .venv/bin/activate `
25+ - Install the required packages: ` pip install -r requirements.txt ` 'or pip install fastapi uvicorn boto3 python-dotenv pytest qrcode'
2226- Create a ` .env ` file, and add you AWS Access and Secret key, check ` .env.example `
27+ - and Save the Access & secret key, cat the ` .env ` to verify.
2328- Also, change the BUCKET_NAME to your S3 bucket name in ` main.py `
2429- Run the API server: ` uvicorn main:app --reload `
2530- Your API Server should be running on port ` http://localhost:8000 `
2631
32+ ### optional- Troubleshoting S3 bucket
33+ ### you might add Bucket policy
34+
35+ {
36+ "Version": "2012-10-17",
37+ "Statement": [
38+ {
39+ "Sid": "PublicReadGetObject",
40+ "Effect": "Allow",
41+ "Principal": "* ",
42+ "Action": "s3: GetObject ",
43+ "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/* " # Add bucket name
44+ }
45+ ]
46+ }
47+
48+
2749### Front-end
2850
2951The front-end code exits in the ` front-end-nextjs ` directory. You can run the front-end server locally:
0 commit comments