Reactjs Flask Ldap Boilerplate screenshot

Reactjs Flask Ldap Boilerplate

Author Avatar Theme by Flavienbwk
Updated: 16 Mar 2023
17 Stars

ReactJS + Flask + Docker (+K8S) boilerplate using an LDAP and token-based authentication.

Categories

Overview

The Dockerized ReactJS, Flask & LDAP boilerplate is a comprehensive template that allows developers to quickly set up a web application with features like Docker architecture, LDAP authentication, token-based API authentication, automatic token renewal, Swagger documentation, Flask-Migrate for database management, and more. The template also provides options for customizing the user interface with the choice between a sidebar or navbar, responsive design, and different build options for development, production, and Kubernetes environments.

Features

  • Docker architecture: The template is built using Docker containers, making it easy to set up and deploy the application.
  • LDAP authentication: The template provides support for LDAP authentication, allowing users to authenticate using their LDAP credentials.
  • Token-based API authentication: The template includes token-based API authentication, ensuring secure access to the API endpoints.
  • Automatic token renewal: A Flask middleware is included to automatically renew tokens, providing a seamless experience for users.
  • Swagger documentation: The API is documented using Swagger, making it easy for developers to understand and use the available endpoints.
  • Flask-Migrate: The template uses Flask-Migrate for database management, allowing for easy database setup and migration.
  • Flask-SQLAlchemy: PostgreSQL is chosen as the database and Flask-SQLAlchemy is used for interacting with the database.
  • Logging and logs rotation: The template provides robust logging capabilities with rotation to manage log files effectively.
  • Responsive design: The user interface is designed to be responsive and adapt to different screen sizes and devices.
  • Development, production, and Kubernetes builds: The template offers different build options for different environments, making it easy to deploy to development, production, or Kubernetes environments.
  • State-of-the-art Python packaging: The template follows best practices for Python packaging, ensuring a clean and organized codebase.
  • API documentation: Swagger is used for documenting the API, providing clear documentation for developers to understand the available endpoints.

Installation

To install the Dockerized ReactJS, Flask & LDAP boilerplate, follow these steps:

  1. Copy the .env.example file to .env to create your environment configuration file.
  2. Start the authentication services by running the following commands:
    docker-compose up phpLDAPAdmin
    docker-compose up adminer
    
  3. Access phpLDAPAdmin at https://localhost:8081 and follow the LDAP user creation guide to create your first user.
  4. Start the API by running the following command:
    docker-compose up api
    
  5. Wait for the database to be set up and navigate to http://localhost:5000 to access the API documentation.
  6. Stop and re-launch docker-compose up app if you want to add a new NPM package.
  7. Access the web app at http://localhost:8080 and enjoy!

To deploy to production or Kubernetes, follow the additional steps provided in the documentation.

Summary

The Dockerized ReactJS, Flask & LDAP boilerplate is a powerful template that provides a complete set of features for building web applications. With support for Docker architecture, LDAP authentication, token-based API authentication, and automatic token renewal, developers can quickly set up secure and robust web services. The inclusion of Swagger documentation, Flask-Migrate, and Flask-SQLAlchemy further enhances the development experience. Whether deploying to development, production, or Kubernetes environments, the template offers flexibility and reliability. Overall, the boilerplate simplifies the development process and allows developers to focus on building corporate-ready services without the hassle of handling user registration and authentication code.