Skip to content

a habit tracking app built with python3 fastapi, htmx, alpinejs

License

Notifications You must be signed in to change notification settings

yunz-dev/spnw-api

Repository files navigation

SPNW - Simple, Personal, and New Way to Track Habits

Welcome to SPNW, a modern, lightweight habit tracker designed to help you stay on top of your goals. Built with FastAPI on the backend, and HTMX, Alpine.js, and TailwindCSS on the frontend, SPNW combines powerful functionality with a sleek, responsive design.


Features

  • Dynamic Habit Tracking: Add and remove habits with ease.
  • Streak Management: Visualize your habit streaks to stay motivated.
  • Real-Time Updates: Interact with the app seamlessly using HTMX and Alpine.js.
  • Customizable UI: Enjoy a clean and minimalist interface powered by TailwindCSS.
  • Secure and Scalable: Built with FastAPI for a robust and performant backend.
  • MongoDB Integration: Store and manage data efficiently with MongoDB.
  • Nix Support: Easy environment setup with reproducible builds.
  • Docker Support: Containerize and deploy the app effortlessly.

Tech Stack

Backend

  • FastAPI: A modern web framework for building APIs with Python.
  • MongoDB: A NoSQL database for flexible and scalable data storage.

Frontend

  • HTMX: Enables seamless, AJAX-like updates for dynamic interactions.
  • Alpine.js: Lightweight JavaScript framework for interactivity.
  • TailwindCSS: Utility-first CSS framework for a responsive and beautiful design.

Tools

  • Nix: For reproducible and consistent development environments.
  • Docker: For containerized development and deployment.

Installation and Setup

Prerequisites

  • Python 3.9+
  • MongoDB (local or cloud instance)
  • Nix
  • Docker (optional, for containerised deployment)

Using Nix

  1. Clone the repository:
    git clone https://github.com/yunz-dev/spnw.git
    cd spnw
  2. Enter nix-shell via flake:
    nix develop
  1. Install Python dependencies inside the Nix environment:
    pip install -r requirements.txt
  1. Run the development server:
   uvicorn app.main:app --reload

Environment Variables

Make sure to set up a .env file in the root directory with the following variables:

MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<database_name>?retryWrites=true&w=majority

Replace , , , and <database_name> with your MongoDB credentials. e

Screenshots

screenshot

License

This project is licensed under the GPL License.

About

a habit tracking app built with python3 fastapi, htmx, alpinejs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published