This project provides a simple web application with login/logout functionality, image display, and modal interactions. It includes a front-end built with HTML, CSS, and JavaScript, and interacts with a mock backend server to handle authentication and image retrieval. It works with javascript enabled or disabled.
- Python 3.x
- A web browser (e.g., Chrome, Firefox)
To run the project, you'll need to start two Python servers. Follow the instructions below to set up and start the servers.
-
HTML Server
This server serves the static HTML, CSS, and JavaScript files required for the frontend of the application.
- Script Name:
html-server.py - Command to Run:
python html-server.py
- Alternative: Double-click the
html-server.pyfile to run it.
- Script Name:
-
Mock Web Server
This server provides mock endpoints for login, logout, and status checking. It simulates backend API responses.
- Script Name:
server.py - Command to Run:
python server.py
- Alternative: Double-click the
server.pyfile to run it.
- Script Name:
-
Start the HTML Server:
Open a terminal or command prompt, navigate to the directory containing
/public/html-server.py, and run:python html-server.py
-
Start the Mock Web Server:
Open a new terminal or command prompt, navigate to the directory containing
/mock-server/server.py, and run:python server.py
-
Access the Application:
Open your web browser and go to http://localhost:8001. You should see the application's frontend.
-
Login Credentials: Use the following credentials:
-
Username: testuser
-
Password: password123
-
Login: Use the login form to authenticate. On successful login, you will be redirected to the appropriate page with user-specific content.
-
Logout: Click the logout button to log out from the application.
-
Image Grid: The image grid will display different images based on the login state.
-
Disable Javascript: Disable your browsers use of javascript (Ctrl-Shift-P in chrome then type javascript). The site will continue to function after a ctrl=f5 refresh.
- Server Not Starting: Ensure that Python is installed and properly configured in your system's PATH.
- Network Issues: Verify that both servers are running and that no other application is using port 8000 or 8001.
Feel free to fork the repository and submit pull requests with improvements or bug fixes. For more details on contributing, please refer to the CONTRIBUTING.md file (if available).
For any questions or feedback, please contact Dave Buckley.