|
1 | | -# Tailspin Toys Crowd Funding |
| 1 | +# Tailspin Toys Crowd Funding Development Guidelines |
2 | 2 |
|
3 | | -Website for crowd funding for games. |
| 3 | +This is a crowdfunding platform for games with a developer theme. The application uses a Flask backend API with SQLAlchemy ORM for database interactions, and an Astro/Svelte frontend with Tailwind CSS for styling. Please follow these guidelines when contributing: |
4 | 4 |
|
5 | | -## Backend |
| 5 | +## Code standards |
| 6 | + |
| 7 | +### Required Before Each Commit |
| 8 | + |
| 9 | +- Run Python tests to ensure backend functionality |
| 10 | +- For frontend changes, run builds in the client directory to verify build success and the end-to-end tests, to ensure everything works correctly |
| 11 | +- When making API changes, update and run the corresponding tests to ensure everything works correctly |
| 12 | +- When updating models, ensure database migrations are included if needed |
| 13 | +- When adding new functionality, make sure you update the README |
| 14 | +- Make sure all guidance in the Copilot Instructions file is updated with any relevant changes, including to project structure and scripts, and programming guidance |
| 15 | + |
| 16 | +### Global language guidance |
| 17 | + |
| 18 | +- Use type hints for function parameters and return values for all languages which support them |
6 | 19 |
|
7 | | -The backend is written using: |
| 20 | +### Python and Flask Patterns |
8 | 21 |
|
9 | | -- Flask for the API |
10 | | -- SQLAlchemy for the ORM |
11 | | -- SQLite for the database |
| 22 | +- Use SQLAlchemy models for database interactions |
| 23 | +- Use Flask blueprints for organizing routes |
| 24 | +- Follow RESTful API design principles |
12 | 25 |
|
13 | | -## Frontend |
| 26 | +### Svelte and Astro Patterns |
14 | 27 |
|
15 | | -The frontend is written using: |
| 28 | +- Use Svelte for interactive components |
| 29 | +- Follow Svelte's reactive programming model |
| 30 | +- Create reusable components when functionality is used in multiple places |
| 31 | +- Use Astro for page routing and static content |
16 | 32 |
|
17 | | -- Astro for routing |
18 | | -- Svelte for the components and interactivity |
19 | | -- Tailwind CSS for styling |
| 33 | +### Styling |
20 | 34 |
|
21 | | -## GitHub Actions Workflows |
| 35 | +- Use Tailwind CSS classes for styling |
| 36 | +- Maintain dark mode theme throughout the application |
| 37 | +- Use rounded corners for UI elements |
| 38 | +- Follow modern UI/UX principles with clean, accessible interfaces |
| 39 | + |
| 40 | +### GitHub Actions workflows |
22 | 41 |
|
23 | 42 | - Follow good security practices |
24 | | - - Make sure to explicitly set the workflow permissions |
| 43 | +- Make sure to explicitly set the workflow permissions |
| 44 | +- Add comments to document what tasks are being performed |
25 | 45 |
|
26 | | -## Code standards |
| 46 | +## Scripts |
| 47 | + |
| 48 | +- Several scripts exist in the `scripts` folder |
| 49 | +- Use existing scripts to perform tasks rather than performing them manually |
| 50 | +- Existing scripts: |
| 51 | + - `scripts/setup-env.sh`: Performs installation of all Python and Node dependencies |
| 52 | + - `scripts/run-server-tests.sh`: Calls setup-env, then runs all Python tests |
| 53 | + - `scripts/start-app.sh`: Calls setup-env, then starts both backend and frontend servers |
| 54 | + |
| 55 | +## Repository Structure |
27 | 56 |
|
28 | | -- Use good variable names, avoiding abbreviations and single letter variables |
29 | | -- Use the casing standard for the language in question (camelCasing for TypeScript, snake_casing for Python, etc.) |
30 | | -- Use type hints in all languages which support them |
| 57 | +- `server/`: Flask backend code |
| 58 | + - `models/`: SQLAlchemy ORM models |
| 59 | + - `routes/`: API endpoints organized by resource |
| 60 | + - `tests/`: Unit tests for the API |
| 61 | + - `utils/`: Utility functions and helpers |
| 62 | +- `client/`: Astro/Svelte frontend code |
| 63 | + - `src/components/`: Reusable Svelte components |
| 64 | + - `src/layouts/`: Astro layout templates |
| 65 | + - `src/pages/`: Astro page routes |
| 66 | + - `src/styles/`: CSS and Tailwind configuration |
| 67 | +- `scripts/`: Development and deployment scripts |
| 68 | +- `data/`: Database files |
| 69 | +- `docs/`: Project documentation |
| 70 | +- `README.md`: Project documentation |
0 commit comments