Skip to main content

AppScriptify CLI — create app templates instantly

Project description

AppScriptify — Login template (simple)

This small project provides a basic login/signup template using Flask and MongoDB (via Motor). It stores users in a MongoDB collection and uses secure password hashing (PBKDF2). The login can accept either username or email.

What it uses

  • Flask — web framework
  • Motor (async MongoDB driver) — async access to MongoDB
  • python-dotenv — load environment variables

Files of interest

  • appscriptify/appscriptify/templates/login/app.py — main Flask app used in this template
  • appscriptify/appscriptify/templates/login/database.py — async database helpers (Motor)
  • config.json — contains database/collection names (already present in the repo)
  • templates/ and static/ — UI HTML/CSS/JS

Environment variables

Create a .env file in the project root with at least:

MONGO_URI="your_mongo_connection_string"

Example .env content:

MONGO_URI="mongodb+srv://testuser:<password>@testdb.ktuizkl.mongodb.net/?appName=TestDB"

Also ensure config.json (already present) contains the database and collection names. Example values are:

{
  "users_database": "usersDB",
  "users_collection": "users"
}

Change config.json if needed.

Install

  1. (Optional) Create a virtual environment:
python -m venv .venv
.\.venv\Scripts\activate
  1. Install dependencies:
python -m pip install -r requirements.txt

Run (development)

Open a terminal and run the Flask app file used in the template. From the repository root you can run:

python app.py

This will start Flask's built-in server on http://127.0.0.1:5000 by default.

Alternatively, you can set FLASK_APP and use flask run after setting the working directory appropriately.

Cookies & Sessions

  • The app sets HTTP-only cookies for username/email by default (good for preventing JavaScript access).
  • In development the cookie secure flag is set to False to allow non-HTTPS testing. In production change it to True.
  • The app also stores minimal session info using Flask's session (server-side cookie signing). Make sure app.secret_key is set in production using an environment variable.

Notes and security

  • Passwords are hashed with PBKDF2 + SHA256 via Python's hashlib and stored as base64(salt + hash). This is reasonably secure for a small project but using a well-maintained library (like passlib) is recommended for production.
  • Motor is async; the example app uses a single event loop and runs async DB calls from synchronous routes. For production consider using an async-capable web server/framework (Quart/FastAPI) or rewrite routes as fully sync using pymongo.
  • Make sure your MongoDB connection string is secure and credentials are not committed to the repo.

Next steps (suggested)

  • Add a /logout route that clears cookies and session (I can add that for you).
  • Add CSRF protection (e.g., Flask-WTF or a middleware) for forms.
  • Replace manual cookie handling with Flask's session-related features or a secure server-side session store.
  • Add tests for signup/login flows.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

appscriptify-1.1.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

appscriptify-1.1.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file appscriptify-1.1.0.tar.gz.

File metadata

  • Download URL: appscriptify-1.1.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for appscriptify-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ab14a37d325e05deade1c0cc98a596d314da3604ea24d8591e4dd4ae9db192a7
MD5 a6ef770a58d8acd3967b04eb177f12fd
BLAKE2b-256 b46ff8dcd01568e19039399816cdc5abd33a7c21d86cd8048f608f8617d61e7c

See more details on using hashes here.

File details

Details for the file appscriptify-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: appscriptify-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for appscriptify-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4eff4ca2cb6d219060b7e36bb032f8224828f3e5badbca72f47c29b5d0e298dd
MD5 f740256ef64f8bfe72bec0455a8205a7
BLAKE2b-256 aafd7b6b20d69e3031f1af71f8aee84915cc3177da0b191d02ce3ad07ea19ac5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page