This repository contains a Symfony project configured to work with CodeSpaces, making it easy to get started with Symfony development.
Before setting up this project lozally, make sure you have the following dependencies installed on your system:
- PHP (version 8.2 or higher)
- Composer
- Symfony CLI
To set up this Symfony project locally, follow these steps:
- Clone this repository to your local machine:
git clone https://github.com/your-username/symfony-codespaces.git
- Navigate to the project's directory:
cd symfony-codespaces
- Setup a symfony project
symfony new my_project --version="6.3.*" --webapp
- Install the project dependencies using Composer:
composer install
- Start the Symfony development server:
symfony server:start
- Open your web browser and visit http://localhost:8000 to see the Symfony application running.
This repository is pre-configured to work with CodeSpaces, allowing you to easily develop in a cloud-based development environment. To set up CodeSpaces for this project, follow these steps:
- Create a CodeSpace from this GitHub repository by clicking on the green "Code" button and selecting "Open with CodeSpaces."
- you can also fork the repository and commit your project changes there as well)
- you can also create a separate repository for your project and clone it inside the codespace so you can develop and still commit your code
-
Wait for the CodeSpace to be created and initialized.
-
Once the CodeSpace is ready, you can start developing right away in the cloud.
-
Example setup in the CodeSpaces
symfony new my_project --version="6.3.*" --webapp
Then cd new_project
and symfony server:start
- now you can access you symfony instance and start developing.
To display the symfony profiler (very useful), in your symfony project, go to config/packages/framework.yaml
and add the following under framework
:
trusted_proxies: '127.0.0.1'
trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-prefix']
Here are some useful commands that you can use while working with this Symfony project:
- Run PHPUnit tests:
php bin/phpunit
- Generate the database schema (if using Doctrine):
php bin/console doctrine:schema:create
- Clear the cache:
php bin/console cache:clear
For more information about Symfony and its commands, refer to the Symfony documentation.
If you'd like to contribute to this project, please follow these guidelines:
-
Fork this repository.
-
Create a new branch for your feature or bug fix:
git checkout -b my-feature
-
Make your changes and commit them with descriptive commit messages.
-
Push your changes to your forked repository:
git push origin my-feature
- Open a pull request in this repository and provide a detailed description of your changes.
This project is licensed under the MIT License.
You can copy this markdown content and use it as your README.md file for your Symfony CodeSpaces GitHub repository.