From 6914a6855cfa25574c2ad45e7bdacb0bfc5e5dba Mon Sep 17 00:00:00 2001 From: Newzy Developer Date: Fri, 30 Oct 2026 10:53:31 +0000 Subject: [PATCH] Add frontend project structure with React/TypeScript setup --- CONTRIBUTING.md | 191 +- LICENSE | 4 +- README.md | 131 +- backend/.gitignore | 29 + backend/README.md | 200 + backend/api/v1/__init__.py | 0 backend/config.py | 33 + backend/core/__init__.py | 0 backend/db/__init__.py | 0 backend/db/session.py | 26 + backend/main.py | 84 + backend/models/__init__.py | 9 + backend/models/article.py | 27 + backend/models/author.py | 23 + backend/models/category.py | 21 + backend/pytest.ini | 8 + backend/requirements.txt | 11 + backend/schemas/__init__.py | 19 + backend/schemas/article.py | 42 + backend/schemas/author.py | 37 + backend/schemas/category.py | 35 + backend/tests/conftest.py | 71 + backend/tests/test_health.py | 52 + backend/tests/test_models.py | 151 + backend/tests/test_version.py | 40 + docker-compose.yml | 34 + frontend/.eslintrc.cjs | 66 + frontend/.gitignore | 42 + frontend/Dockerfile | 24 + frontend/README.md | 253 + frontend/nginx.conf | 39 + frontend/package-lock.json | 6289 +++++++++++++++++ frontend/package.json | 42 + frontend/playwright.config.ts | 35 + frontend/playwright/e2e/api.spec.ts | 84 + frontend/playwright/e2e/home.spec.ts | 64 + frontend/public/index.html | 14 + frontend/src/App.tsx | 21 + frontend/src/api/client.ts | 39 + frontend/src/assets/logo.svg | 4 + frontend/src/assets/styles/globals.css | 213 + .../src/components/articles/ArticleCard.tsx | 35 + .../src/components/articles/AuthorAvatar.tsx | 24 + .../src/components/articles/CategoryBadge.tsx | 27 + frontend/src/components/ui/Header.tsx | 26 + frontend/src/components/ui/Layout.tsx | 21 + frontend/src/main.tsx | 9 + frontend/src/pages/ArticlePage.tsx | 20 + frontend/src/pages/CategoriesPage.tsx | 18 + frontend/src/pages/Home.tsx | 52 + frontend/src/tests/ArticleCard.test.tsx | 11 + frontend/src/tests/Header.test.tsx | 13 + frontend/src/types/index.ts | 32 + frontend/tsconfig.json | 25 + frontend/tsconfig.node.json | 11 + frontend/vite.config.ts | 18 + frontend/vitest.config.ts | 24 + milestones/m3-setup-frontend-prompt.md | 419 ++ 58 files changed, 9056 insertions(+), 236 deletions(-) create mode 100644 backend/.gitignore create mode 100644 backend/README.md create mode 100644 backend/api/v1/__init__.py create mode 100644 backend/config.py create mode 100644 backend/core/__init__.py create mode 100644 backend/db/__init__.py create mode 100644 backend/db/session.py create mode 100644 backend/main.py create mode 100644 backend/models/__init__.py create mode 100644 backend/models/article.py create mode 100644 backend/models/author.py create mode 100644 backend/models/category.py create mode 100644 backend/pytest.ini create mode 100644 backend/requirements.txt create mode 100644 backend/schemas/__init__.py create mode 100644 backend/schemas/article.py create mode 100644 backend/schemas/author.py create mode 100644 backend/schemas/category.py create mode 100644 backend/tests/conftest.py create mode 100644 backend/tests/test_health.py create mode 100644 backend/tests/test_models.py create mode 100644 backend/tests/test_version.py create mode 100644 docker-compose.yml create mode 100644 frontend/.eslintrc.cjs create mode 100644 frontend/.gitignore create mode 100644 frontend/Dockerfile create mode 100644 frontend/README.md create mode 100644 frontend/nginx.conf create mode 100644 frontend/package-lock.json create mode 100644 frontend/package.json create mode 100644 frontend/playwright.config.ts create mode 100644 frontend/playwright/e2e/api.spec.ts create mode 100644 frontend/playwright/e2e/home.spec.ts create mode 100644 frontend/public/index.html create mode 100644 frontend/src/App.tsx create mode 100644 frontend/src/api/client.ts create mode 100644 frontend/src/assets/logo.svg create mode 100644 frontend/src/assets/styles/globals.css create mode 100644 frontend/src/components/articles/ArticleCard.tsx create mode 100644 frontend/src/components/articles/AuthorAvatar.tsx create mode 100644 frontend/src/components/articles/CategoryBadge.tsx create mode 100644 frontend/src/components/ui/Header.tsx create mode 100644 frontend/src/components/ui/Layout.tsx create mode 100644 frontend/src/main.tsx create mode 100644 frontend/src/pages/ArticlePage.tsx create mode 100644 frontend/src/pages/CategoriesPage.tsx create mode 100644 frontend/src/pages/Home.tsx create mode 100644 frontend/src/tests/ArticleCard.test.tsx create mode 100644 frontend/src/tests/Header.test.tsx create mode 100644 frontend/src/types/index.ts create mode 100644 frontend/tsconfig.json create mode 100644 frontend/tsconfig.node.json create mode 100644 frontend/vite.config.ts create mode 100644 frontend/vitest.config.ts create mode 100644 milestones/m3-setup-frontend-prompt.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 164d481..63469a6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,169 +1,76 @@ -# Contributing to newzy +# Contributing to Newzy -First off, thank you for considering contributing to newzy! It's people like you that make newzy such a great tool. +Thank you for your interest in contributing to Newzy! This document outlines the guidelines and processes for contributing to the project. -## Table of Contents - -- [Code of Conduct](#code-of-conduct) -- [How Can I Contribute?](#how-can-i-contribute) - - [Reporting Bugs](#reporting-bugs) - - [Suggesting Enhancements](#suggesting-enhancements) - - [Pull Requests](#pull-requests) -- [Development Setup](#development-setup) -- [Coding Standards](#coding-standards) -- [Git Workflow](#git-workflow) -- [Style Guides](#style-guides) - -## Code of Conduct - -This project and everyone participating in it is expected to abide by the following code of conduct: - -- Be respectful and considerate -- Focus on what is best for the community -- Accept constructive criticism gracefully - -Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing. - -## How Can I Contribute? +## How to Contribute ### Reporting Bugs -Before creating bug reports, please check existing issues to avoid duplicates. When you are creating a bug report, please include as many details as possible: +Please open an issue on GitHub with: +- A clear description of the problem +- Steps to reproduce (if applicable) +- Expected vs actual behavior +- Environment details (OS, browser version, etc.) -- **Use a clear and descriptive title** -- **Describe the exact steps to reproduce** the bug -- **Provide specific examples** to demonstrate the steps (include links to files or projects that demonstrate the issue) -- **Describe the behavior you observed** after following the steps -- **Describe the behavior you expected** after following the steps +### Suggesting Features -### Suggesting Enhancements +We welcome feature suggestions! Please submit detailed proposals including: +- Problem statement +- Proposed solution +- Use cases and benefits -Enhancement suggestions are tracked as GitHub issues. Create an issue and clearly describe: +### Making Changes -1. **Is your feature request related to a problem? Please describe it.** -2. **Describe the solution you'd like** -3. **Describe alternatives you've considered** -4. **Provide additional context** (e.g., motivation for this feature) +1. **Fork** the repository +2. Create a new **branch** (`git checkout -b feature/amazing-feature`) +3. Make your changes following our coding standards +4. Write or update tests as needed +5. Ensure all tests pass (`pytest -v`) +6. Submit a **pull request** -### Pull Requests +## Development Standards -1. Fork the repo and create your branch from `develop`. -2. If you've added code that should be tested, add tests. -3. Ensure the test suite passes. -4. Update documentation if needed. -5. Make sure your code lints. -6. Issue that pull request! +### Code Style -**Pull Request Guidelines**: Use one of the following prefixes to categorize your PR: +- Follow Python PEP 8 guidelines +- Use type hints for function signatures +- Include docstrings for public functions and classes -- `feat:` - A new feature -- `fix:` - A bug fix -- `docs:` - Documentation changes -- `style:` - Formatting, missing semicolons, etc; no code change -- `refactor:` - Code change that neither fixes a bug nor adds a feature -- `perf:` - A code change that improves performance -- `test:` - Adding missing tests -- `chore:` - Changes to the build process or auxiliary tools +### Testing -## Development Setup +- Write tests for all new features +- Aim for at least 70% code coverage +- Run `pytest` before submitting PRs -### Requirements +### Commit Messages -- Node.js (v18+) -- npm or yarn - -### Installation - -```bash -git clone https://github.com/daniel/newzy.git -cd newzy -npm install -cp .env.example .env -# Edit .env with your configuration -npm run dev +Use the following format: ``` +type(scope): description -## Coding Standards - -We use modern JavaScript (ES6+). Follow these guidelines: - -- Use consistent indentation (2 spaces) -- Single quotes instead of double quotes (unless using template literals) -- Semicolons at the end of each statement -- No trailing whitespace -- One function per file when possible -- Meaningful variable and function names - -Example: - -```javascript -// Good -const users = getUserData(); -if (users.length > 0) { - return users[0]; -} - -// Bad -const user = get_data(); -if(user.length > 0){ - return user[0] -} -``` - -## Git Workflow - -### Branching Strategy - -We follow a GitFlow-inspired workflow: - -- `main` - Production-ready code -- `develop` - Integration branch for feature development -- `feature/*` - New features and enhancements (branch from develop) -- `bugfix/*` - Bug fixes from develop -- `hotfix/*` - Critical fixes from main - -### Making a Commit - -When making commits, use the following format: - -``` -(): - - - -