This repository outlines the steps to create a basic app using the Reflex framework. Reflex is a library to build full-stack web apps in pure Python. Reflex packs around the following key features:
- Built your applications using pure Python - Write your app's frontend and backend all in Python, no need to learn Javascript.
- Reflex offers full Flexibility - Reflex is easy to get started with, but can also scale to complex apps.
- Reflex allows you to easily deploy your applications Instantly - After building, deploy your app with a single command or host it on your own server.
This project is a simple web application built with Reflex, a Python library. The app displays a "Hello World!" message and includes a button that, when clicked, fetches details about cat facts from a specified URL and displays the content.
To get started with this project, follow these steps:
- Make sure that you have Python installed on your local machine. Check your version using
python3 --version. If you do not receive your Python Version, please install Python for your respective operating system. - You now need to install Reflex using
pip install reflex. If you do not have "pip' installed you will have to install it by runningsudo apt install python3-pip
For the prerequisites you are now set to start 🚀
-
Clone the repository:
git@github.com:Nemwel-Boniface/python-reflex-app.git cd python-reflex-app -
Create a virtual environment and activate it:
python3 -m venv env source env/bin/activate # On Windows, use `env\Scripts\activate`
-
Install the required dependencies:
pip install reflex requests
-
Initialize your reflex application by running this cmd
reflex init
- Once that completes, you can run the application with the below command. If successful, your application can be found here:
http://localhost:3000/
reflex run
If you were successful above, you will see the following result in the browser when you open it:
Screencast.from.29-05-2024.07.40.13.ASUBUHI.webm
The app is configured using a Config object from Reflex:
config = rx.Config(
app_name="reflex_dev",
)Reflex offers an easy way to deploy your applications which can be checked out from their main docs here. I was able to deploy my own project and if you are interested in having a look at it online, please do so from this URL https://python-reflex-app.reflex.run/
If you would like to have a better view of each individual feature implemented, please visit the Pull Requests page and have a look at the closed PRs where you will be able to see what was changed at what specific point in time.
👤 Nemwel Boniface
- GitHub: @Nemwel Boniface
- Twitter: @Nemwel Boniface
- LinkedIn: @Nemwel Bonifacej
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
- To God be the Glory 🙏
- Me for believing that I can! 😎
This project is MIT licensed.
