Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions docs/teams/fullstack/appendices/00_glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ The server-side part of an application responsible for business logic, database
**Caching**
The process of storing frequently accessed data in memory to improve performance and reduce database load (e.g., using Redis or Memcached).

**CI (Continuous Integration)**
A practice where code changes are automatically built and tested to detect issues early in the development cycle.

**CD (Continuous Deployment/Delivery)**
Automated processes for deploying code to production or staging environments after passing automated tests.

**CI (Continuous Integration)**
A practice where code changes are automatically built and tested to detect issues early in the development cycle.

**CMS (Content Management System)**
Software that allows users to create, manage, and modify website content without needing to code.

**Composable**
A reusable function in Vue 3's Composition API that encapsulates and shares stateful logic across components. Composables follow the `use` prefix convention (e.g., `useUser`, `useFetch`).

**Container Orchestration**
The automated management of containerized applications, including deployment, scaling, networking, and health monitoring. Tools include Docker Compose (for development) and Google Cloud Run (for production).

**CSS (Cascading Style Sheets)**
A language used to describe the presentation and layout of web pages.

Expand All @@ -36,6 +42,9 @@ A major update to JavaScript that introduced new syntax and features, making the
**DOM (Document Object Model)**
A programming interface that represents the structure of HTML or XML documents as a tree of objects, allowing scripts to update content, structure, and style.

**E2E (End-to-End) Testing**
A testing methodology that validates the entire application flow from the user's perspective, simulating real user interactions through a browser or API client.

**Frontend**
The client-side part of an application that users interact with directly, typically built with HTML, CSS, and JavaScript.

Expand All @@ -51,9 +60,15 @@ The standard language for creating web pages and web applications.
**HTTP/HTTPS (HyperText Transfer Protocol / Secure)**
Protocols for transferring data over the web; HTTPS adds encryption for security.

**IaC (Infrastructure as Code)**
The practice of managing and provisioning infrastructure through machine-readable configuration files (e.g., Terraform, Pulumi) rather than manual processes.

**IDE (Integrated Development Environment)**
Software that provides comprehensive tools for software development, such as code editing, debugging, and testing.

**Jest**
A JavaScript and TypeScript testing framework with built-in assertion library, mocking, and code coverage. Used as our standard testing tool for both backend (NestJS) and frontend (Vue) projects.

**JSON (JavaScript Object Notation)**
A lightweight data-interchange format, easy for humans to read and write, and easy for machines to parse and generate.

Expand All @@ -63,15 +78,24 @@ A programming language used to create dynamic and interactive effects within web
**JWT (JSON Web Token)**
A compact, URL-safe token format used for securely transmitting information between parties, commonly used for authentication and authorization.

**LLM (Large Language Model)**
An AI model trained on large amounts of text data, capable of generating and understanding natural language. Used in development tools like GitHub Copilot, Claude, and ChatGPT.

**Load Balancer**
A system that distributes incoming network traffic across multiple servers to ensure reliability and scalability.

**Middleware**
Software that acts as a bridge between different systems or layers, commonly used in web frameworks to process requests and responses.

**Monorepo**
A software development strategy where code for multiple projects or packages is stored in a single repository, enabling shared tooling and easier cross-project changes.

**NoSQL**
A category of database systems that store and retrieve data in formats other than relational tables, such as key-value, document, columnar, or graph formats. Popular NoSQL databases include MongoDB, Cassandra, and Redis.

**OpenAPI (Swagger)**
A specification for describing RESTful APIs in a machine-readable format, enabling automatic documentation generation, client SDK generation, and API testing.

**ORM (Object-Relational Mapping)**
A programming technique for converting data between incompatible type systems in object-oriented programming languages. It allows developers to interact with a database using objects instead of SQL queries.

Expand All @@ -90,13 +114,15 @@ A software distribution model in which applications are hosted by a provider and
**SPA (Single Page Application)**
A web application that loads a single HTML page and dynamically updates content as the user interacts with the app.

**SSR (Server-Side Rendering)**
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chybí mi tu zmínka o SSG, když už ho používáme 🙂

A technique where web pages are rendered on the server and sent as fully formed HTML to the client, improving initial load performance and SEO.

**SQL (Structured Query Language)**
A standard language for managing and manipulating relational databases.

**TypeScript**
A strongly-typed superset of JavaScript that adds static typing, interfaces, and other features to improve code quality and maintainability, commonly used in both frontend and backend (Node.js) development.


**UI (User Interface)**
The visual elements of an application that users interact with.

Expand Down
167 changes: 165 additions & 2 deletions docs/teams/fullstack/appendices/10_scripts.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,165 @@
!!! warning "Work in progress"

# Useful Scripts & Tools

A collection of commonly used scripts and commands for day-to-day development work.

## Database Scripts

### Reset Local Database

Drops and recreates the database, runs migrations, and seeds development data:

```bash
#!/bin/bash
# scripts/db-reset.sh

echo "Dropping and recreating database..."
docker compose exec postgres psql -U myuser -c "DROP DATABASE IF EXISTS mydb;"
docker compose exec postgres psql -U myuser -c "CREATE DATABASE mydb;"

echo "Running migrations..."
docker compose exec api npm run migrate
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm nepoužíváme, ale je to všude
možná dobrý nápad zvalidovat i to, jestli chceme zůstat u yarn


echo "Seeding development data..."
docker compose exec api npm run seed

echo "Database reset complete."
```

### Database Dump and Restore

```bash
# Export a database dump
docker compose exec -T postgres pg_dump -U myuser mydb > backup.sql

# Import a database dump
docker compose exec -T postgres psql -U myuser mydb < backup.sql
```

### Quick Migration Commands

```bash
# Prisma
docker compose exec api npx prisma migrate dev --name description_of_change
docker compose exec api npx prisma generate
docker compose exec api npx prisma studio # Visual database browser

# TypeORM
docker compose exec api npx typeorm migration:generate -n MigrationName
docker compose exec api npx typeorm migration:run
docker compose exec api npx typeorm migration:revert
```

## Docker Scripts

### Clean Rebuild

When things are broken and you want a fresh start:

```bash
# Stop everything, remove volumes, rebuild
docker compose down -v
docker compose build --no-cache
docker compose up -d
```

### View Logs

```bash
# Follow all logs
docker compose logs -f

# Follow a specific service
docker compose logs -f api

# Show last 100 lines
docker compose logs --tail=100 api
```

### Shell Access

```bash
# Open a shell in the API container
docker compose exec api sh

# Run a one-off command
docker compose exec api npm run lint
```

## Development Helpers

### Generate NestJS Resources

```bash
# Generate a complete CRUD module
npx nest generate resource users

# Generate individual components
npx nest generate module users
npx nest generate service users
npx nest generate controller users
```

### Quick Dependency Check

```bash
# Check for outdated packages
npm outdated

# Check for security vulnerabilities
npm audit

# Update all packages to latest within semver range
npm update
```

### TypeScript Type Checking

```bash
# Run type checker without emitting files
npx tsc --noEmit

# Watch mode for continuous type checking
npx tsc --noEmit --watch
```

## Git Helpers

### Clean Up Local Branches

```bash
# Delete all local branches that have been merged to develop
git branch --merged develop | grep -v "develop\|main" | xargs git branch -d

# Prune remote tracking branches that no longer exist
git remote prune origin
```

### Quick Rebase on Develop

```bash
git fetch origin
git rebase origin/develop
```

## npm Scripts Convention

Every project should define these scripts in `package.json`:

```json
{
"scripts": {
"dev": "nest start --watch",
"build": "nest build",
"start": "node dist/main.js",
"lint": "eslint . --fix",
"format": "prettier --write .",
"test": "jest",
"test:watch": "jest --watch",
"test:e2e": "jest --config jest.e2e.config.ts",
"migrate": "prisma migrate deploy",
"migrate:dev": "prisma migrate dev",
"seed": "ts-node prisma/seed.ts",
"type-check": "tsc --noEmit"
}
}
```
131 changes: 129 additions & 2 deletions docs/teams/fullstack/appendices/20_faq.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,129 @@
!!! warning "Work in progress"

# FAQ

Answers to common questions from new team members and recurring topics.

## Onboarding

### How do I get access to the project repositories?

Ask your team lead to add you to the [Futured GitHub organization](https://github.com/futuredapp). You'll need a GitHub account. Once added, you'll have access to all team repositories.

### How do I set up my local environment?

Follow the [Local Setup Instructions](../dev_env/00_local_setup.md). In short:

1. Install Node.js (via nvm), Docker Desktop (or OrbStack on Mac), and Git
2. Clone the repository
3. Copy `docker-compose.dist.yml` to `docker-compose.yml` and fill in the values
4. Run `docker compose up -d`
5. Run migrations and seed data

### Where do I find the environment variables?

Ask your team lead or a colleague working on the project. Credentials are shared securely (not via Slack/email). See [Secrets Management](../dev_env/10_secrets.md) for the full process.

### Which IDE should I use?

We don't mandate a specific IDE. Most team members use:

- **WebStorm** (JetBrains) — Full-featured, excellent TypeScript/Vue support
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Přidala bych, že je to self-paying, aby nebylo mrzení

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a je? já si to nechávám proplácet 🤔

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha, to je vtipné, mi bylo řečeno, že si to mám zaplatit sama 🙂

- **VS Code** — Lightweight, great with extensions
- **Cursor** — VS Code fork with built-in AI features

Whatever you use, make sure ESLint and Prettier are configured to run on save.

## Development

### REST or GraphQL — which should I use?

See the [Backend](../tech_stack/10_backend.md) page for a comparison table. In short:

- **REST** for simple CRUD, public APIs, file operations, webhooks
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and scheduled jobs

- **GraphQL** for complex data relationships, flexible frontend queries, real-time subscriptions

Most projects start with REST. Use GraphQL when the frontend needs outgrow simple endpoints.

### How do I create a new feature branch?

```bash
git checkout develop
git pull origin develop
git checkout -b feature/ABC-123-short-description
```

See [Git Flow](../development/00_git_flow.md) for the full branching model.

### How do I handle database schema changes?

Always use migrations. Never modify the database schema manually. See the migration sections in [Database](../tech_stack/20_database.md) and [Deployment](../deployment/00_deployment.md).

### Why do we use Docker for local development?

Docker ensures everyone runs the same environment regardless of their OS. It eliminates "works on my machine" issues, makes onboarding faster, and keeps dependencies (PostgreSQL, Redis, etc.) isolated from your system.

### How do I add a new npm package?

```bash
# npm
npm install package-name # production dependency
npm install -D package-name # development dependency

# yarn
yarn add package-name # production dependency
yarn add -D package-name # development dependency
```

Before adding a package, check:

- Is it actively maintained?
- Does it have TypeScript types?
- Does it add significant bundle size? (check on [bundlephobia.com](https://bundlephobia.com))
- Is there already a similar package in the project?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ještě mi tu chybí push 😆 a před pushem spustit testy

## Code Review

### How quickly should I review a PR?

Aim to start a review within the same business day. If you can't review in time, let the author know so they can find another reviewer.

### What should I focus on during code review?

1. **Correctness** — Does the code do what it's supposed to?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chybí mi tu ještě readability (naming, apod.) a efficiency

2. **Security** — Are there any vulnerabilities (SQL injection, XSS, exposed secrets)?
3. **Architecture** — Does it fit the project structure? Is it in the right module?
4. **Edge cases** — What happens with empty input, null values, concurrent requests?
5. **Tests** — Are critical paths tested?

See [Code Review Process](../development/20_code_review_process.md) for the full guidelines.

### Can I use AI tools for code review?

Yes. We use Copilot and CodeRabbit for automated analysis. They catch common issues and provide suggestions. However, AI review supplements — it doesn't replace — human review. Always verify AI suggestions against the project context.

## Deployment

### How do I deploy to the dev environment?

Merge your PR to `develop`. The CI/CD pipeline will automatically build and deploy.

### How do I deploy to production?

Create a PR from `develop` to `main`. After approval and merge, the pipeline deploys automatically. See [Deployment Process](../deployment/00_deployment.md).

### What do I do if a deployment breaks production?

Follow the [Rollback Procedures](../deployment/10_rollback.md). The quickest fix is usually redeploying the previous container image.

## Architecture Decisions

### Why NestJS instead of Express?

NestJS provides structure, dependency injection, and modularity out of the box. Express gives you freedom but requires you to build all of that yourself. For team projects, the consistency of NestJS saves more time than the flexibility of Express.

### Why Vue instead of React?

Vue was adopted as our primary frontend framework based on team experience and project needs. Vue's Composition API + TypeScript provides an excellent developer experience. For projects where React is a better fit (e.g., client requirement, React Native), we use React.

### Why PostgreSQL as the default database?

PostgreSQL offers the best balance of reliability, features, and performance for our typical use cases (transactional web applications). It handles JSON data well enough to cover most semi-structured data needs too.
Loading