This project is a modern frontend web application built with React, TypeScript, Vite, and Tailwind CSS.
Make sure you have Node.js (v16 or newer) and npm installed.
Clone the repository and install dependencies:
git clone <your-repo-url>
cd frontend-react-ts
npm installTo start the development server:
npm run devThe app will be available at http://localhost:5173 (or the port shown in your terminal).
npm run buildnpm run preview-
Configure API Endpoint:
- Edit the API base URL in
src/services/api.tsxor your relevant API config file. - Example:
// src/services/api.tsx const API_BASE_URL = 'http://localhost:8000/api'; // Change to your backend URL
- Edit the API base URL in
-
Start your backend server (make sure it is running and accessible from the frontend).
-
Environment Variables (Optional):
- You can use a
.envfile to store API URLs or secrets. Example:VITE_API_BASE_URL=http://localhost:8000/api
- Access it in your code with
import.meta.env.VITE_API_BASE_URL.
- You can use a
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
MIT This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptionsproperty like this:
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}- Replace
plugin:@typescript-eslint/recommendedtoplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked - Optionally add
plugin:@typescript-eslint/stylistic-type-checked - Install eslint-plugin-react and add
plugin:react/recommended&plugin:react/jsx-runtimeto theextendslist