This repository serves as a practical demonstration of the concepts outlined in the article about "How to Eliminate CORS Friction in a Cloud-Based Development Environment workflow?"
https://blog.dcadeau.com/monorepo-in-gitpod
The project is divided into two main parts:
- Frontend: A React application built with Vite and TypeScript
- Backend: A Symfony PHP application
The frontend is a React application created using Vite and TypeScript. It's located in the frontend
directory.
Key Features:
- React 18.3 with TypeScript
- Vite for fast development and building
- ESLint configuration for code quality
- Proxy setup to communicate with the backend
The backend is a Symfony 7.1 application located in the backend
directory.
Key Features:
- Symfony 7.1 framework
- Simple API endpoint for demonstration
- Composer for dependency management
The frontend is configured to proxy API requests to the backend. This is set up in the Vite configuration file.
This project is configured to work with Gitpod, a cloud development environment. The configuration is defined in the .gitpod.yml
file.
This configuration automatically sets up both the frontend and backend environments when you open the project in Gitpod.
- Click the "Open in Gitpod" button at the top of this README.
- Gitpod will automatically set up the development environment and start both the frontend and backend servers.
- Once the setup is complete, you can access the frontend application via the provided Gitpod URL (it will automatically open the preview, but it may be blocked by your web browser).
- Click the "Fetch Message from Symfony Backend" button to test the communication between frontend and backend.
- Clone the project
- Go to the
backend
folder, then you should generate a minimal .env file, e.g.
echo "APP_SECRET=$(openssl rand -hex 16)" >> .env
echo "APP_ENV=dev" >> .env`
- You may now run
composer install
andsymfony server:start
- Go to the
frontend
folder and runnpm run dev
- You should then be able to see the app at your http://localhost:5173
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any problems or have any questions, please open an issue in this repository or contact the maintainer at contact@dcadeau.com.
This project is licensed under the MIT License. See the LICENSE file for details.