- π Table of Contents
- π Overview
- π« Features
- π Project Structure
- 𧩠Modules
- π Getting Started
- πΊ Roadmap
- π€ Contributing
- π License
- π Acknowledgments
The project is a LAN reverse proxy that allows users to host multiple web applications on a local server and access them through a single point of entry. It utilizes Nginx to handle routing and SSL/TLS certificate settings, while the front-end is built using React and React Router. The project provides a user-friendly interface for managing and accessing hosted applications, as well as authentication and user profile functionality. The LAN reverse proxy is a valuable tool for developers and small businesses looking to host multiple applications on a single server while maintaining security and ease of access.
Feature | Description |
---|---|
π Structure and Organization | The codebase follows a traditional web application structure with a homepage containing a carousel of apps and individual pages for each app. The code is organized into appropriate directories and files with clear naming conventions. |
π Code Documentation | The codebase has sufficient documentation and comments in each file and function to ensure a clear understanding of the code's functionality and purpose. |
𧩠Dependency Management | Dependencies are managed through npm lock files with clear version specifications, ensuring consistency across environments. |
β»οΈ Modularity and Reusability | The codebase is organized with modular components, allowing for easy reuse and maintainability. The use of React and React Router libraries further promotes modularity and component-based development. |
βοΈ Testing and Quality Assurance | The codebase lacks automated tests for the moment |
β‘οΈ Performance and Optimization | The codebase includes the use of state management for the React app, which can boost performance by minimizing unnecessary re-renders. |
π Security Measures | The codebase includes SSL certificate and private key for secure communication with the Nginx server. |
π Version Control and Collaboration | The codebase is hosted on GitHub and follows a clear version control system with frequent commits and clear commit messages, promoting effective team collaboration. |
π External Integrations | The codebase includes external libraries for React, React Router, and Nginx, enabling extended functionality and integration with other systems. |
π Scalability and Extensibility | The code structure with small components allows for easy expansion and scalability in handling additional apps and features. |
repo
βββ Dockerfile
βββ LICENSE
βββ README.md
βββ config
βΒ Β βββ nginx.conf
βββ homepage
βΒ Β βββ package.json
βΒ Β βββ public
βΒ Β βΒ Β βββ css
βΒ Β βΒ Β βΒ Β βββ main.css
βΒ Β βΒ Β βββ favicon.ico
βΒ Β βΒ Β βββ index.html
βΒ Β βββ src
βΒ Β βββ App.js
βΒ Β βββ assets
βΒ Β βΒ Β βββ media
βΒ Β βΒ Β βββ appframe
βΒ Β βΒ Β βΒ Β βββ flask_logo.png
βΒ Β βΒ Β βΒ Β βββ project_architecture.png
βΒ Β βΒ Β βΒ Β βββ psql_logo.png
βΒ Β βΒ Β βΒ Β βββ python_logo.png
βΒ Β βΒ Β βββ carousel
βΒ Β βΒ Β βΒ Β βββ clipboards-app.png
βΒ Β βΒ Β βΒ Β βββ go-auth.png
βΒ Β βΒ Β βΒ Β βββ my-app-3.png
βΒ Β βΒ Β βββ footer
βΒ Β βΒ Β βΒ Β βββ github_logo.png
βΒ Β βΒ Β βΒ Β βββ nginx_logo.png
βΒ Β βΒ Β βΒ Β βββ reacjs_logo.png
βΒ Β βΒ Β βββ header
βΒ Β βΒ Β βββ header_logo.png
βΒ Β βββ components
βΒ Β βΒ Β βββ AppFrame.css
βΒ Β βΒ Β βββ AppFrame.js
βΒ Β βΒ Β βββ Carousel.css
βΒ Β βΒ Β βββ Carousel.js
βΒ Β βΒ Β βββ Footer.css
βΒ Β βΒ Β βββ Footer.js
βΒ Β βΒ Β βββ Header.css
βΒ Β βΒ Β βββ Header.js
βΒ Β βββ index.js
βΒ Β βββ pages
βΒ Β βββ Home.js
βββ scripts
βββ docker_deploy.sh
βββ prepare_env.sh
14 directories, 32 files
Components
File | Summary | Module |
---|---|---|
AppFrame.js | The code snippet is a React component that renders an app's technical sheet with details such as name, description, URL, frontend/backend technologies, author, and Github URL. The component allows for editing and saving changes with authentication using JWT tokens. It also displays a project architecture diagram and logos of technologies used in the app. | homepage/src/components/AppFrame.js |
Header.js | This code snippet defines a React component called Header, which provides authentication and user profile editing functionality. It includes state variables to track login status and various forms for logging in, signing up and updating user profile, each with their own handlers. It also makes use of Cookies library to store JWT tokens and user information. The component is rendered at the top of the application's UI, displaying logo and login/sign up buttons, as well as forms that are conditionally displayed based on user interaction. | homepage/src/components/Header.js |
Carousel.css | The code snippet defines the styles for a carousel component, including the wrapper, buttons, and images. It also includes the styling for app thumbnails that can be used within the carousel. The code uses flexbox and background images to achieve the desired appearance. | homepage/src/components/Carousel.css |
Carousel.js | This is a React component that renders a carousel of images, with each image displaying the name of an app and linked to an onClick event. The component imports React, Carousel, Link, and AppContext from their respective modules and uses them to render the carousel. | homepage/src/components/Carousel.js |
AppFrame.css | The provided code snippet contains CSS styling rules for different elements of a web page, including buttons, tables, logos, and media queries for different screen sizes. The CSS styling includes specifications for the height, width, padding, border, and background color of various elements. There are also rules for the display, alignment, and spacing of elements using flexbox. | homepage/src/components/AppFrame.css |
Header.css | The code snippet provides styling for a header element. It includes properties for styling the background color, font size, and button styles. The header also includes elements for displaying a logo, links, and buttons, and is designed to be responsive with a minimum and maximum width of 100%. | homepage/src/components/Header.css |
Footer.css | The provided code snippet styles the footer of a webpage using flexbox, sets the font size, background color, and border radius. It also includes logos for GitHub, React, and NGINX, which have varying widths and are styled with a white background color, border radius, and minimum/maximum width properties. Finally, a copyright statement is included with white text on the same background color as the footer. | homepage/src/components/Footer.css |
Footer.js | The code imports logos and a CSS file, and defines a Footer component that returns a JSX element containing HTML. This footer displays logos for GitHub, React.Js, and Nginx, as well as a copyright notice. The component is exported for use in other parts of the app. | homepage/src/components/Footer.js |
Config
File | Summary | Module |
---|---|---|
nginx.conf | This is a configuration file for the Nginx web server. It includes SSL/TLS certificate settings and various location blocks for different apps and static content. Requests to each location are proxied to specific ports on the server. The file also automatically redirects all HTTP requests to HTTPS. | config/nginx.conf |
Css
File | Summary | Module |
---|---|---|
main.css | The code snippet provides styles for a web application. The #app element is styled to be a column layout with a specific font, width, and height, while the body has a background color. The #home section has a column layout and the link class has no text decoration. The code also includes responsive styles. | homepage/public/css/main.css |
Pages
File | Summary | Module |
---|---|---|
Home.js | The code imports components such as Header, Carousel, AppFrame, and Footer, which are then rendered within a function called Home. The Home function takes in a single parameter called apps and returns a JSX element that contains all the imported components within a div element with an id of "home". Finally, the Home function is exported as the default export of the module. | homepage/src/pages/Home.js |
Public
File | Summary | Module |
---|---|---|
index.html | The code snippet is an HTML file that includes the necessary metadata and links to an external CSS file and favicon. It also includes a container div with the ID "app", suggesting it is intended to be used in conjunction with JavaScript to build a dynamic web application. Additionally, it includes a message for users who have disabled JavaScript. The title of the page is "Khaled's Local Server". | homepage/public/index.html |
Root
File | Summary | Module |
---|---|---|
Dockerfile | The provided code snippet consists of two stages. The first stage uses Node.js to build a ReactJS app and installs the necessary dependencies before generating a build and removing unused files. The second stage uses Nginx to set up a server that serves the content generated in the first stage and exposes it on both port 80 and port 443. | Dockerfile |
Scripts
File | Summary | Module |
---|---|---|
docker_deploy.sh | This code snippet prepares the environment variables, cleans the docker container and images named LAN-PROXY-LOCAL and negan/lan-proxy:local, configures the nginx proxy to the same network as the host, builds and pushes the image to the remote, and eventually runs the proxy on port 80 and 443 with the environment variable AUTH_SERVER and with the name LAN-PROXY-LOCAL. | scripts/docker_deploy.sh |
prepare_env.sh | The provided code snippet is a bash script that exports the hostname environment variable and sets the auth server address based on that hostname. It then writes this address to a.env file located in the "homepage" directory. This script is likely used as part of a larger application deployment or configuration process. | scripts/prepare_env.sh |
Src
File | Summary | Module |
---|---|---|
index.js | This code snippet imports the React and createRoot libraries and an App component. It renders the App component to an HTML element with the ID "app" using the createRoot.render method from the React DOM library. This allows the App component to be displayed as a web page. | homepage/src/index.js |
App.js | The code snippet utilizes React and the React Router library to create a web application. An app context is created and used to store an array of apps and the ID of the currently selected app. The component is used to define the page routes, with the component used to specify the component to render for a given URL path. The component is rendered for the root URL path. | homepage/src/App.js |
- Clone the lan-reverse-proxy repository:
git clone ../lan-reverse-proxy
- Change to the project directory:
cd lan-reverse-proxy
- Install the dependencies:
npm install
node app.js
- Task 1: Implement Unit Tests
Contributions are always welcome! Please follow these steps:
- Fork the project repository. This creates a copy of the project on your account that you can modify without affecting the original project.
- Clone the forked repository to your local machine using a Git client like Git or GitHub Desktop.
- Create a new branch with a descriptive name (e.g.,
new-feature-branch
orbugfix-issue-123
).
git checkout -b new-feature-branch
- Make changes to the project's codebase.
- Commit your changes to your local branch with a clear commit message that explains the changes you've made.
git commit -m 'Implemented new feature.'
- Push your changes to your forked repository on GitHub using the following command
git push origin new-feature-branch
- Create a pull request to the original repository. Open a new pull request to the original project repository. In the pull request, describe the changes you've made and why they're necessary. The project maintainers will review your changes and provide feedback or merge them into the main branch.
This project is licensed under the Apache-2.0
License. See the LICENSE file for additional info.
- Personal Project
This awesome documentation was automatically generated using the README-AI Project