gagocarrilloedgar / flask-react-skeleton

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minimal flask-react-skeleton

This is a minimal unoppinionated skeleton that uses Flask with Pyhton and React with Vite, SWC & JS.

Technologies

Installation

Go to Pre requisites and make sure you have everything

#Clone the repo
git clone https://github.com/gagocarrilloedgar/flask-react-skeleton

Go to the project directory

  cd flask-react-skeleton

Run locally

Frontend

Go to the front-end folder

  cd frontend

Install dependencies

  npm install

Start the server

  npm run dev

Backend

Go to the backend folder

  cd Backend
  1. Install the python packages: $ pipenv install
  2. Create an .env file based on the .env.example: $ cp .env.example .env (the ones provided should be enough, you don't need to modify anything).
  3. Start the environment: $ pipenv shell
  4. Launch docker: $pipenv run launch_docker
  5. DB already initiated
    1. Migrate the migrations: $ pipenv run migrate (skip if you have not made changes to the models on the ./src/api/models.py)
    2. Run the migrations: $ pipenv run upgrade
    3. Run the application: $ pipenv run start
  6. DB not started
    1. Init the db: $ pipenv run init
    2. Go to step 5

Once you are done you can stop the docker container using:

docker compose down

Pre-requisites

Docker & Docker compose

In order to be able to start using this tempalte you need to docker installed.

We will use docker and docker componse in order to be able to have a local instance of a db (the one provided is a postgreSQL config).

Here you have the links to the oficial documentation:

Python & pipenv

You need to have at least python 3.8 and pipenv installed.

To install ptyhon follow:

Then install pipenv:

Mac:

python3 -m pip install pip --upgrade
python3 -m pip install pipenv
## Verify using
pipenv

Node

License

MIT

Authors

About

License:MIT License


Languages

Language:Python 60.2%Language:CSS 15.1%Language:HTML 13.5%Language:JavaScript 11.1%