{"id":26704396,"url":"https://github.com/eniompw/flaskpostgresvercel","last_synced_at":"2026-02-15T08:34:47.595Z","repository":{"id":192928944,"uuid":"687756485","full_name":"eniompw/FlaskPostgresVercel","owner":"eniompw","description":"Flask Login on Vercel Example","archived":false,"fork":false,"pushed_at":"2025-02-24T23:42:44.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T04:43:47.918Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://w3login.vercel.app","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eniompw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-06T00:14:26.000Z","updated_at":"2025-03-10T12:38:03.000Z","dependencies_parsed_at":"2023-09-06T01:48:22.336Z","dependency_job_id":"656675d7-6238-4502-a302-031a82cbc10a","html_url":"https://github.com/eniompw/FlaskPostgresVercel","commit_stats":null,"previous_names":["eniompw/vercel-flask-login","eniompw/flaskpostgresvercel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eniompw/FlaskPostgresVercel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eniompw%2FFlaskPostgresVercel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eniompw%2FFlaskPostgresVercel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eniompw%2FFlaskPostgresVercel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eniompw%2FFlaskPostgresVercel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eniompw","download_url":"https://codeload.github.com/eniompw/FlaskPostgresVercel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eniompw%2FFlaskPostgresVercel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264010960,"owners_count":23543717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-27T04:43:01.137Z","updated_at":"2026-02-15T08:34:47.588Z","avatar_url":"https://github.com/eniompw.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vercel Flask Login\n\nA simple Flask web application with PostgreSQL database integration, designed for deployment on Vercel.\n\n## Live Demo\n\n[w3login.vercel.app](https://w3login.vercel.app)\n\n## Features\n\n- Flask web framework\n- PostgreSQL database integration\n- User authentication system with session management\n- Login/logout functionality\n- Flash messages for user feedback\n- Secure parameterized SQL queries\n- Serverless deployment on Vercel\n\n## Prerequisites\n\n- Python 3.x\n- PostgreSQL database\n- Vercel account (for deployment)\n\n## Environment Variables\n\nCreate a `.env` file or set the following environment variables:\n\n```\nPOSTGRES_URL=your_postgresql_connection_string\nSECRET_KEY=your_secret_key_for_sessions\n```\n\nThe PostgreSQL connection string should be in the format:\n```\npostgresql://user:password@host:port/database\n```\n\n**Note:** If `SECRET_KEY` is not set, a default development key will be used (not recommended for production).\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/eniompw/FlaskPostgresVercel.git\ncd FlaskPostgresVercel\n```\n\n2. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\n3. Set up your environment variables:\n```bash\nexport POSTGRES_URL=\"your_postgresql_connection_string\"\nexport SECRET_KEY=\"your_secret_key\"\n```\n\n## Local Development\n\nRun the Flask application locally:\n```bash\npython app.py\n```\n\nOr using Flask CLI:\n```bash\nflask run\n```\n\n## Usage\n\n1. **Initialize the database:**\n   - Visit `/create` to create the Users table\n\n2. **Add a test user:**\n   - Visit `/insert` to add a test user (Username: Bob, Password: 123)\n\n3. **Login:**\n   - Navigate to `/` (home page)\n   - Enter credentials (Bob / 123)\n   - Click \"Login\"\n\n4. **After successful login:**\n   - You'll be redirected to the success page\n   - Your username will be displayed\n   - Click \"Logout\" to end the session\n\n5. **View all users (optional):**\n   - Visit `/select` to see all users in the database\n\n## API Endpoints\n\n### Main Routes\n- `GET /` - Home page (login interface)\n- `POST /login` - Authenticate user credentials\n- `GET /success` - Success page (requires active session)\n- `GET /logout` - Logout and clear session\n\n### Database Management Routes (for testing/setup)\n- `GET /create` - Creates the Users table in the database\n- `GET /insert` - Inserts a test user (Bob/123)\n- `GET /select` - Retrieves and displays all users\n\n## Database Schema\n\n**Users Table:**\n- `Username` VARCHAR(20) - Primary Key\n- `Password` VARCHAR(20)\n\n## Deployment\n\nThis application is configured for deployment on Vercel using the `vercel.json` configuration file.\n\n```bash\nvercel deploy\n```\n\n## References\n\n* [Based on Vercel Flask](https://github.com/eniompw/vercel-flask)\n* [Based on Flask Login](https://github.com/eniompw/FlaskLogin)\n* [PostgreSQL Tutorial](https://www.postgresqltutorial.com/postgresql-python/query/)\n* [Flask Postgres](https://github.com/eniompw/FlaskPostgres)\n\n## Security Note\n\n⚠️ This is a demo application. For production use, implement additional security measures:\n- **Hash passwords** (use bcrypt or similar) - currently passwords are stored in plain text\n- ✅ Parameterized queries are used to prevent SQL injection\n- ✅ Session management is implemented\n- Add comprehensive input validation and sanitization\n- ✅ Environment variables are used for sensitive data\n- Implement HTTPS in production\n- Add CSRF protection\n- Implement rate limiting for login attempts\n- Add password strength requirements\n- Consider using an ORM like SQLAlchemy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feniompw%2Fflaskpostgresvercel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feniompw%2Fflaskpostgresvercel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feniompw%2Fflaskpostgresvercel/lists"}