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 templateappscriptify/appscriptify/templates/login/database.py— async database helpers (Motor)config.json— contains database/collection names (already present in the repo)templates/andstatic/— 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
- (Optional) Create a virtual environment:
python -m venv .venv
.\.venv\Scripts\activate
- 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
secureflag is set toFalseto allow non-HTTPS testing. In production change it toTrue. - The app also stores minimal session info using Flask's
session(server-side cookie signing). Make sureapp.secret_keyis set in production using an environment variable.
Notes and security
- Passwords are hashed with PBKDF2 + SHA256 via Python's
hashliband stored as base64(salt + hash). This is reasonably secure for a small project but using a well-maintained library (likepasslib) 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
/logoutroute 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file appscriptify-1.1.5.tar.gz.
File metadata
- Download URL: appscriptify-1.1.5.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3cc3d452042799068295eb8d8dce09f72d1b984fa84cc73ff71fee4b319338a
|
|
| MD5 |
35d42da410be7b25e799751925a6eabd
|
|
| BLAKE2b-256 |
b79c6d4e8eb3e7b7c3242e2e859ebebf6d9d722f4553bddc8c9aaa31922c04cd
|
File details
Details for the file appscriptify-1.1.5-py3-none-any.whl.
File metadata
- Download URL: appscriptify-1.1.5-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57a3c5e74747ec1e03e1b14b74121caa0c7b283777043828d01b059bb98d68ce
|
|
| MD5 |
de0440ac9793770f4530bf4c98ed9c25
|
|
| BLAKE2b-256 |
39237eef875bab053a966b8036a4d1263a7fadec41952f4fb512ea658b31de26
|