Skip to content

boonbaluri/react-fastapi-postgresql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Local development

Required:

  1. Python 3.8
  2. NodeJS 18 or higher
  3. Postgresql

Frontend

Run Frontend

cd frontend
# Skip if node modules are already installed
npm i
# Start the app
npm start

Now app will run on http://localhost:3000

Build Frontend

cd frontend
# Skip if node modules are already installed
npm i
# Build the app
npm run build

The build package will be created under the folder build.

Backend

Before starting the app, make sure Postgresql server is up and running and set the environment variable on the terminal by running the command.

Linux/Mac :

export DATABASE_URL="postgresql://postgres:123456789@20.101.160.159:5432/blogData"

Windows Powershell :

$Env:DATABASE_URL = "postgresql://postgres:123456789@20.101.160.159:5432/blogData"

Start Backend

cd backend
# Skip if already installed python required packages
pip install -r ./requirements.txt
# Run backend
uvicorn blog.main:app --host 0.0.0.0 --port 8000 --reload

Now app will run on http://localhost:8000

In case, if terminal throws an error unvicorn is not found, try adding python -m in beginning of the command

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 57.7%
  • Python 32.9%
  • HTML 5.8%
  • CSS 3.1%
  • Dockerfile 0.5%