Skip to content

turso-extended/app-find-me-on-python-htmx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FindMeOn ⚡️

A social links listing app built with Flask, HTMX, and Turso.

Technologies used


Project Structure

This project is using Flask as the back-end and HTMX as the front-end.

Inside your project, you'll see the following directory structure: templates/404.html templates/base.html templates/icons.html templates/index.html templates/username.html

├── templates/
│   └── 404.html
│   └── base.html
│   └── icons.html
│   └── index.html
│   └── username.html
└── app.py
└── models.py
  • /templates: Here is where our app's templates reside.

  • app.py: This is where our Flask app & route source code lives.

  • models.py: Here are where our database models reside.

Install dependencies

Create and activate a virtual environment.

# create virtual environment
# MacOS/Linux
python3 -m venv .venv
# Windows
py -3 -m venv .venv

# activate virtual environment
# MacOS/Linux
.venv/bin/activate
# Windows
.venv\Scripts\activate

Install Flask and other project dependencies.

(.venv) pip install Flask python-dotenv Flask-Assets

Install TailwindCSS and download its binary.

(.venv) pip install pytailwindcss
(.venv) tailwindcss

Install SQLAlchemy and its LibSQL dialect.

(.venv) pip install sqlalchemy-libsql

Setting up the database

Install the Turso CLI.

Create a new turso database.

turso db create find-me-on

Create a ".env" file at the root of the project, this is where our database credentials will be stored.

Get the database url.

turso db show --url find-me-on

Assign the database url to the "TURSO_DB_URL" key inside the ".env" file.

TURSO_DB_URL=<obtained-db-url>

Create a database authentication token.

turso db tokens create find-me-on-fh

Assign the database authentication token to the "TURSO_DB_AUTH_TOKEN" key inside the ".env" file.

TURSO_DB_AUTH_TOKEN=<obtained-db-auth-token>

Run the development server

python3 app.py

Note

You can opt to visit the "127.0.0.1:5000/seed" route to seed one account whose information can be viewed by visiting "127.0.0.1:5000/u/turso" afterwards.

About

A social links listing app built with Flask, HTMX, and Turso

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published