Project provides a basic structure for building a RESTful API using Flask, a popular Python web framework and React.JS (TypeScript) to make modern and flexible application.
This README will guide you through setting up a virtual environment, installing the required dependencies, and activating it on a Windows system, setting up and running React.JS project.
Before you begin, make sure you have the following installed on your system:
- Python 3.x (You can download it from Python's official website)
- Node.JS 18.x (You can download it from Node.JS's official website)
A virtual environment is a clean, isolated environment for your project's dependencies. It's highly recommended to use a virtual environment to manage dependencies for your Flask API project.
-
Open a command prompt or PowerShell in the project's root directory.
-
Install the
virtualenv
package if you haven't already. Run the following command:pip install virtualenv
-
Create a virtual environment by running the following command:
python -m venv venv
This will create a virtual environment named
venv
in your project directory.
Before you can run the Flask API, you need to activate your virtual environment.
-
Navigate to your project directory in the command prompt or PowerShell.
-
Activate the virtual environment by running the following command:
.\venv\Scripts\Activate
You should now see the virtual environment name in your command prompt or PowerShell, indicating that it's active.
To install the required dependencies for this project, you can use the requirements.txt
file.
-
Make sure your virtual environment is activated (see the next section on how to activate it).
-
Run the following command to install the dependencies:
pip install -r requirements.txt
To start the Flask API, run the following command within the activated virtual environment:
flask --app index.py run --debug
This will start the development server, and your API will be accessible at http://localhost:5000/
.
This project was bootstrapped with Vite.
Before you begin, ensure you have Node.js and npm installed on your machine.
To install the necessary dependencies, run:
npm install
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
We welcome contributions to this Flask API project. Please feel free to open issues, submit pull requests, and help us improve this project.
This project is licensed under the MIT License. See the LICENSE file for details.