-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moving README.md from frontend to root
- Loading branch information
Showing
1 changed file
with
168 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,172 @@ | ||
Ribka Sheikh ris20010 | ||
Muskan Ghetiya mag20035 | ||
Prince Rusweka Rwabongoya pdr21001 | ||
Sean Dombrofski sed19015 | ||
# Pet Adoption Portal - CSE2102 Group Project (Spring 2025) | ||
Group Members - Sean Dombrofski (sed19015), Muskan Ghetiya (mag20035), Ribka Sheikh (ris20010), Prince Rusweka Rwabongoya (pdr21001) | ||
|
||
Trello Board (Kanban) | ||
|
||
### Trello Board (Kanban) | ||
https://trello.com/b/1z9zUv2a/cse-2102-project | ||
|
||
Figma Prototype | ||
|
||
### Figma Prototype | ||
https://www.figma.com/design/ackeSbcEwP2kJQmJknsge5/Milestone3_Figma?node-id=0-1&t=ItY8uyCUknB0nwIz-1 | ||
# trigger cleanup | ||
|
||
--- | ||
|
||
## tech stack | ||
|
||
- **Backend**: Python, Flask, SQLite | ||
- **Frontend**: React, TypeScript, Vite | ||
- **Testing**: Pytest | ||
- **CI/CD**: GitHub Actions | ||
|
||
--- | ||
|
||
## running project locally | ||
|
||
### backend (flask api) | ||
|
||
```bash | ||
cd backend | ||
python -m venv venv | ||
|
||
# Activate virtual environment | ||
# Windows: | ||
venv\Scripts\activate | ||
# Mac/Linux: | ||
source venv/bin/activate | ||
|
||
pip install -r requirements.txt | ||
python main.py | ||
``` | ||
|
||
> server runs on: `http://127.0.0.1:5000` | ||
--- | ||
|
||
### frontend (react + vite) | ||
|
||
```bash | ||
cd frontend | ||
npm install | ||
npm run dev | ||
``` | ||
|
||
> frontend runs on: `http://localhost:5173` | ||
--- | ||
|
||
## steel thread | ||
|
||
**steel thread**: our frontend connects to the backend to fetch adoptable pets: | ||
|
||
- Frontend makes a call to `GET http://127.0.0.1:5000/api/pets` | ||
- Backend accesses SQLite DB and returns real-time pet data | ||
- Data is dynamically rendered on the **Pet Profile** page | ||
|
||
--- | ||
|
||
## testing & CI | ||
|
||
GitHub Actions automatically runs: | ||
|
||
- Pylint on all backend files - the score must be greater or equal than 8.0 | ||
- Pytest for backend API routes (`backend/tests/`) | ||
- Builds frontend React app | ||
- Uploads test reports as artifacts | ||
|
||
CI triggers on: | ||
|
||
- Every push to `main` or `develop` | ||
- Every pull request targeting `main` or `develop` | ||
|
||
--- | ||
|
||
## local testing commands | ||
|
||
### Lint Backend: | ||
```bash | ||
cd backend | ||
pylint ./*.py | ||
``` | ||
|
||
### Run Backend Tests: | ||
```bash | ||
pytest backend/tests | ||
``` | ||
|
||
> has database validation changes, API calls, and edge cases. | ||
--- | ||
|
||
## TA Instructions | ||
|
||
To test and run locally: | ||
|
||
1. to start the backend: | ||
```bash | ||
cd backend | ||
python main.py | ||
``` | ||
2. to start the frontend: | ||
```bash | ||
cd frontend | ||
npm run dev | ||
``` | ||
3. visting the app: [http://localhost:5173](http://localhost:5173) | ||
|
||
|
||
|
||
|
||
# React + TypeScript + Vite | ||
|
||
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](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) 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 | ||
|
||
## Expanding the ESLint configuration | ||
|
||
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: | ||
|
||
```js | ||
export default tseslint.config({ | ||
extends: [ | ||
// Remove ...tseslint.configs.recommended and replace with this | ||
...tseslint.configs.recommendedTypeChecked, | ||
// Alternatively, use this for stricter rules | ||
...tseslint.configs.strictTypeChecked, | ||
// Optionally, add this for stylistic rules | ||
...tseslint.configs.stylisticTypeChecked, | ||
], | ||
languageOptions: { | ||
// other options... | ||
parserOptions: { | ||
project: ['./tsconfig.node.json', './tsconfig.app.json'], | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
}) | ||
``` | ||
|
||
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: | ||
|
||
```js | ||
// eslint.config.js | ||
import reactX from 'eslint-plugin-react-x' | ||
import reactDom from 'eslint-plugin-react-dom' | ||
|
||
export default tseslint.config({ | ||
plugins: { | ||
// Add the react-x and react-dom plugins | ||
'react-x': reactX, | ||
'react-dom': reactDom, | ||
}, | ||
rules: { | ||
// other rules... | ||
// Enable its recommended typescript rules | ||
...reactX.configs['recommended-typescript'].rules, | ||
...reactDom.configs.recommended.rules, | ||
}, | ||
}) | ||
``` |