docs: Revise README.md for clarity and completeness, adding project overview, setup instructions, and contributing guidelines
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 7s
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 7s
This commit is contained in:
118
README.md
118
README.md
@@ -1,20 +1,116 @@
|
||||
# Bu resimde ne var?
|
||||
# 🔭 **Eye – A React Vite Image-Utility Demo**
|
||||
|
||||
[https://eye.almazlar.com](https://eye.almazlar.com)
|
||||
> A lightweight React starter built with Vite, featuring custom image helpers,
|
||||
> a simple REST API wrapper, ESLint + Prettier, Docker support, and a
|
||||
> ready-to-run Docker-Compose setup.
|
||||
|
||||
# React + Vite
|
||||
---
|
||||
|
||||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
||||
## 🚀 Quick Start
|
||||
|
||||
Currently, two official plugins are available:
|
||||
```bash
|
||||
# Clone the repo
|
||||
git clone https://github.com/<user>/eye.git
|
||||
cd eye
|
||||
|
||||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
||||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
||||
# Install dependencies (Node v18+ recommended)
|
||||
npm install
|
||||
|
||||
## React Compiler
|
||||
# Run the development server
|
||||
npm run dev
|
||||
# → Open http://localhost:5173
|
||||
|
||||
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
||||
# Build for production
|
||||
npm run build
|
||||
|
||||
## Expanding the ESLint configuration
|
||||
# Preview the production build
|
||||
npm run preview
|
||||
```
|
||||
|
||||
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
|
||||
> **Tip** – Use the VS Code *Open Folder* command for IntelliSense and auto-formatting.
|
||||
|
||||
---
|
||||
|
||||
## 📁 Project Structure
|
||||
|
||||
```
|
||||
src/
|
||||
├── App.jsx # Main React component
|
||||
├── main.jsx # Entry point for the React application
|
||||
├── services/
|
||||
│ └── api.js # Axios wrapper for API calls
|
||||
├── utils/
|
||||
│ └── imageUtils.js # Helpers for image scaling
|
||||
public/
|
||||
├── index.html # HTML template
|
||||
└── favicon.svg # Site icon
|
||||
vite.config.js # Vite configuration
|
||||
eslint.config.js # ESLint rules
|
||||
Dockerfile # Docker setup
|
||||
docker-compose.yml # Multi-service setup using Docker Compose
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Available Scripts
|
||||
|
||||
| Script | Description |
|
||||
|--------|-------------|
|
||||
| `dev` | Starts Vite dev server with HMR. |
|
||||
| `build` | Builds optimized assets for production. |
|
||||
| `preview` | Serves the built files locally. |
|
||||
| `lint` | Runs ESLint with auto-fix. |
|
||||
| `lint:check` | Checks linting without modifying files. |
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Configuration
|
||||
|
||||
| File | Purpose |
|
||||
|-----------------|----------------------------------------------|
|
||||
| `vite.config.js` | Core Vite config, integrates @vitejs/plugin-react. |
|
||||
| `eslint.config.js` | ESLint rules – see [ESLint docs](https://eslint.org). |
|
||||
| `Dockerfile` | Builds a minimal Node v18 image, serves the built bundle. |
|
||||
| `docker-compose.yml` | Orchestrates dev and prod services. |
|
||||
|
||||
---
|
||||
|
||||
## 📦 Docker & Docker-Compose
|
||||
|
||||
> The repo ships with a simple Docker setup that can be used for local dev or production deployment.
|
||||
|
||||
```bash
|
||||
# Build & run containers
|
||||
docker compose up --build
|
||||
# → App is available at http://localhost:5173
|
||||
|
||||
# Stop containers
|
||||
docker compose down
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📚 Contributing
|
||||
|
||||
1. Fork the repo and create a feature branch.
|
||||
2. Run `npm run lint` before submitting a PR.
|
||||
3. Follow the existing style and add unit tests where appropriate.
|
||||
4. Ensure all tests pass locally: `npm test`.
|
||||
|
||||
See `CONTRIBUTING.md` for more details.
|
||||
|
||||
---
|
||||
|
||||
## 📄 License
|
||||
|
||||
This project is licensed under the MIT License – see the `LICENSE` file for details.
|
||||
|
||||
---
|
||||
|
||||
## 🤔 FAQ / Troubleshooting
|
||||
|
||||
| Issue | Fix |
|
||||
|-------------------------------|-------------------------------------------|
|
||||
| **`vite: command not found`** | Ensure Node v18+ is installed and `npx vite` works. |
|
||||
| **CORS errors** | API calls are proxied via Vite (`/api`). Adjust `proxy` in `vite.config.js`. |
|
||||
| **Build fails on Docker** | Verify `Dockerfile` uses the correct `CMD` and ports. |
|
||||
|
||||
Reference in New Issue
Block a user