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
- Install the python packages:
$ pipenv install
- 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). - Start the environment:
$ pipenv shell
- Launch docker:
$pipenv run launch_docker
- DB already initiated
- Migrate the migrations:
$ pipenv run migrate
(skip if you have not made changes to the models on the./src/api/models.py
) - Run the migrations:
$ pipenv run upgrade
- Run the application:
$ pipenv run start
- Migrate the migrations:
- DB not started
- Init the db:
$ pipenv run init
- Go to step 5
- Init the db:
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:
- Docker on mac
- Docker on windos
- Docker on linux
- Docker compose, this should be included with docker desktop.
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