Environment Variables Concepts

Learning Objective: By the end of this lesson, students will understand the role and importance of environments in full-stack development.

Application environments

As a full-stack developer, your apps often interact with external databases, servers, and authentication services. Your apps also need to be aware of their local operating environment. This environment includes all the external systems and services your application communicates with and how they influence its functionality and behavior.

Multiple environments

The environment an application runs in will likely vary depending on the context in which it operates. Suppose we have an application that requires a database to store information.

The best practice would be to have two environments:

Environments

You wouldn’t want developers messing around with the data for actual users, as they might mess something up in the development process - impacting real users in detrimental ways.

The complexity, features of the app, and the size of the development team can significantly shape the number and types of environments used. Different projects may require different setups based on their specific needs and goals.

That said, development and production environments, as we’ve discussed, represent an appropriate starting point for any app.

📚 An application’s environment is all the external factors that impact its operation in a given circumstance. It includes things like the configuration for an application (such as what database it should connect to).