Git Product home page Git Product logo

app-find-me-on-python-htmx's Introduction

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

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.

app-find-me-on-python-htmx's People

Contributors

xinnks avatar rehket avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.