Clone this repo
- cd into animal-adoption
Notes taken from the video - https://www.youtube.com/watch?v=ctQMqqEo4G8&t=629s
cd frontend npm install npm run dev
- npm install @mui/material @emotion/react @emotion/styled
- npm install react-router-dom
- npm install prop-types
This will live in a folder called 'server' just under the root.
cd server .env file - Add SECRET_KEY="SecretKeyHere"
Generate a secret key
import secrets secret_key = secrets.token_hex(32) print(secret_key)
python -m venv adoption-venv source adoption-venv/bin/activate
pip install -r requirements.txt
The /frontend/.env file contains a link to the server which will provide the underlying API services. You'll need to repoint this to your flask server.
cd /server/ directory
- ensure your python venv is activated touch .env
- ensure that the .env file is in your gitignore file
- Paste the following line into your .env file (change the relevant fields!!)
DATABASE_CONNECT = "postgresql://reza@localhost:5432/adoption" DATABASE_NAME = "adoption" DATABASE_HOST = "localhost" PHOTO_UPLOAD_LOCATION = "static/photo_uploads/"
ONE OFF INSTRUCTIONS to create the Postgres database. cd /server/db
-
activate your venv environment!
-
type in: createdb adoption # to create a new postgres database
-
run this file : python seed.py
-
run this file : python print_seed.py
cd server python -m flask run --port 8000
cd frontend npm run dev