Installation en US - rocambille/start-express-react GitHub Wiki

Discover StartER

StartER is a web application framework for educational purposes. A web framework provides a structure and starting point for creating an application, allowing you to focus on completing a project. Based on React / Express, StartER strives to provide a seamless and educational development experience while still enabling powerful features.

Whether you're a beginner or a novice with experience, we'll guide you through your first steps with StartER.

Why StartER?

Many tools and frameworks exist for creating a web application. However, we believe StartER is a good choice for prototyping modern, full-stack web applications while remaining a learning tool.

If you're new to web development, this guide will help you get familiar with the tools without feeling overwhelmed.

If you're at a more advanced stage, StartER will provide you with a solid foundation to deepen your knowledge and a playground for your own experiments.

StartER combines what we believe to be the best packages in the JS ecosystem to build a robust and enjoyable environment. However, we welcome discussions and suggestions. Who knows, maybe you'll join the StartER development team?

Create a StartER application

Requirements

Before creating your first StartER application, make sure you have Git, Node.js, and Docker Engine installed on your local machine. You must also have a GitHub account to use the StartER repository as a template.

Creating an application

The StartER GitHub repository is a template repository. To use it:

  1. On GitHub, go to the StartER main page (https://github.com/rocambille/start-express-react).

  2. Above the file list, click Use this template and select Create a new repository.

  1. Use the Owner drop-down menu to select the account you want to assign the repository to.
  1. Enter a name for your repository and an optional description.
  1. Choose the repository's visibility. For more information, see About repositories.

  2. Click Create repository.


Now you can clone your repository.

  1. On GitHub, navigate to your repository's main page.

  2. Above the file list, click <> Code.

  1. Copy the repository URL under "HTTPS", "SSH", or "GitHub CLI", depending on your preference.
  1. Open the terminal on your machine.

  2. Change the current working directory to the location where you want to clone your repository.

  3. Type git clone, then paste the URL you copied earlier.

git clone [email protected]:YOUR-USERNAME/YOUR-REPOSITORY
  1. Press Enter to create your local clone.
$ git clone [email protected]:YOUR-USERNAME/YOUR-REPOSITORY
> Cloning into `Spoon-Knife`...
> remote: Counting objects: 10, done.
> remote: Compressing objects: 100% (8/8), done.
> remove: Total 10 (delta 1), reused 10 (delta 1)
> Unpacking objects: 100% (10/10), done.
  1. Change the current working directory to your local clone.
cd YOUR-REPOSITORY

Now you can install the dependencies into the local node_modules directory.

npm install

Initial configuration

Depending on the application's runtime environment, you may find it useful to have different configuration values.

To achieve this, StartER uses a .env file to separate environment variables from the code. During a fresh installation of StartER, your application's root directory will contain a .env.sample file that defines the current environment variables. After installing StartER, copy this .env.sample file under the name .env.

cp .env.sample .env

Here are the required variables that you must fill in with your own values:

Variable Description
APP_SECRET Secret key used to generate the signature for authentication
MYSQL_ROOT_PASSWORD Password for the MySQL root superuser account
MYSQL_DATABASE Name of your application's database

Keep in mind

  • You can include additional variables in your application's .env.sample file. By adding entries to the .env.sample file, other members of your team can clearly identify the environment variables required to run your application.

  • Your .env file should never be added in a Git commit, as each workstation (local machine or server) running your application may require a different environment configuration. Furthermore, this would pose a security issue if intruders accessed your repository, as your sensitive credentials would be exposed.


Start the application

Once the application is built and configured, you can start the development server and other StartER services with docker compose.

docker compose up --build

Once the development server is started, your application will be accessible in your web browser at http://localhost:5173.

Also, the database management tool Adminer will be accessible in your web browser at http://localhost:8080. Log in with the following credentials:

  • System: MySQL
  • Server: database
  • User: root
  • Password: (value of MYSQL_ROOT_PASSWORD in your .env file)
  • Database: (value of MYSQL_DATABASE in your .env file)

Where to go next

Now that you've created your StartER application, you might be wondering what you need to learn next. We strongly recommend that you familiarize yourself with how StartER works by consulting the following documentation:

⚠️ **GitHub.com Fallback** ⚠️