mirror of
https://github.com/learnhouse/docs.git
synced 2026-12-04 12:42:15 +01:00
feat: new documentation
This commit is contained in:
5
content/developers/contributing/_meta.json
Normal file
5
content/developers/contributing/_meta.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"index": "Overview",
|
||||
"dev-environment": "Dev Environment",
|
||||
"guidelines": "Guidelines"
|
||||
}
|
||||
62
content/developers/contributing/dev-environment.mdx
Normal file
62
content/developers/contributing/dev-environment.mdx
Normal file
@@ -0,0 +1,62 @@
|
||||
import { Callout } from 'nextra/components'
|
||||
|
||||
# Development Environment Setup
|
||||
|
||||
The LearnHouse CLI provides a streamlined way to set up and run the entire development environment with a single command.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Make sure you have the following installed before proceeding:
|
||||
|
||||
- **Docker** (with Docker Compose v2)
|
||||
- **Node.js 18+**
|
||||
|
||||
<Callout type="warning">
|
||||
Make sure Docker has at least **4GB of RAM** allocated. You can check and adjust this in Docker Desktop under Settings > Resources.
|
||||
</Callout>
|
||||
|
||||
<Callout type="info">
|
||||
You do **not** need to install Python, uv, Bun, or any other tooling manually. The `npx learnhouse dev` command handles all dependency installation automatically.
|
||||
</Callout>
|
||||
|
||||
## Setup Steps
|
||||
|
||||
### 1. Clone the Repository and Start Development
|
||||
|
||||
```bash
|
||||
git clone https://github.com/learnhouse/learnhouse && cd learnhouse && npx learnhouse dev
|
||||
```
|
||||
|
||||
That single command handles everything:
|
||||
|
||||
- **Starts backing services** -- PostgreSQL and Redis are launched via Docker Compose.
|
||||
- **Installs dependencies** -- Python dependencies are installed via `uv` and JavaScript dependencies via `bun`, all automatically.
|
||||
- **Starts the API** -- The FastAPI backend starts on port 1338 with hot reload.
|
||||
- **Starts the frontend** -- The Next.js development server starts with `--turbopack` and hot reload.
|
||||
- **Starts the collaboration server** -- The Hocuspocus collaboration server starts via `tsx watch`.
|
||||
|
||||
All services are coordinated automatically so you do not need to manage them individually.
|
||||
|
||||
## Accessing the Application
|
||||
|
||||
Once `npx learnhouse dev` is running, you can access:
|
||||
|
||||
| Service | URL |
|
||||
| --- | --- |
|
||||
| Frontend | [http://localhost:3000](http://localhost:3000) |
|
||||
| API | [http://localhost:1338](http://localhost:1338) |
|
||||
| API Documentation (Swagger) | [http://localhost:1338/docs](http://localhost:1338/docs) |
|
||||
|
||||
<Callout type="info">
|
||||
The Swagger UI at `/docs` is only available in development mode. Production instances do not expose the interactive API documentation.
|
||||
</Callout>
|
||||
|
||||
## Stopping the Environment
|
||||
|
||||
Press `Ctrl+C` in the terminal where `npx learnhouse dev` is running to stop all services.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **Port conflicts** -- Make sure ports 3000 and 1338 are not in use by other applications.
|
||||
- **Docker not running** -- Ensure the Docker daemon is started before running `npx learnhouse dev`.
|
||||
- **Dependency issues** -- The CLI installs all dependencies automatically. If you encounter issues, try deleting `node_modules` and `.venv` directories and re-running `npx learnhouse dev`.
|
||||
86
content/developers/contributing/guidelines.mdx
Normal file
86
content/developers/contributing/guidelines.mdx
Normal file
@@ -0,0 +1,86 @@
|
||||
# Contribution Guidelines
|
||||
|
||||
This page outlines the workflow and standards for contributing to LearnHouse.
|
||||
|
||||
## Workflow
|
||||
|
||||
### 1. Fork and Clone
|
||||
|
||||
Fork the [LearnHouse repository](https://github.com/learnhouse/learnhouse) on GitHub, then clone your fork:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/YOUR_USERNAME/learnhouse.git
|
||||
cd learnhouse
|
||||
```
|
||||
|
||||
### 2. Create a Feature Branch
|
||||
|
||||
Always create a new branch for your changes. Use a descriptive branch name:
|
||||
|
||||
```bash
|
||||
git checkout -b feature/your-feature-name
|
||||
```
|
||||
|
||||
Branch naming conventions:
|
||||
|
||||
- `feature/` -- New features or enhancements
|
||||
- `fix/` -- Bug fixes
|
||||
- `docs/` -- Documentation changes
|
||||
- `refactor/` -- Code refactoring without behavior changes
|
||||
|
||||
### 3. Make Your Changes
|
||||
|
||||
Develop your changes locally using the [development environment](/developers/contributing/dev-environment). Keep commits focused and atomic.
|
||||
|
||||
When adding or updating dependencies:
|
||||
|
||||
- **Frontend** -- Use `bun` to manage JavaScript/TypeScript dependencies (e.g., `bun add <package>`).
|
||||
- **Backend** -- Use `uv` to manage Python dependencies (e.g., `uv add <package>`).
|
||||
|
||||
### 4. Submit a Pull Request
|
||||
|
||||
Push your branch to your fork and open a pull request against the `main` branch of the LearnHouse repository:
|
||||
|
||||
```bash
|
||||
git push origin feature/your-feature-name
|
||||
```
|
||||
|
||||
In your pull request description:
|
||||
|
||||
- Explain **what** your change does and **why** it is needed.
|
||||
- Reference any related [GitHub issues](https://github.com/learnhouse/learnhouse/issues).
|
||||
- Include screenshots or recordings for UI changes.
|
||||
|
||||
## Code Style
|
||||
|
||||
### Frontend (TypeScript / React)
|
||||
|
||||
- Use **TypeScript** for all new code.
|
||||
- Follow existing patterns in the codebase for component structure and naming.
|
||||
- Use functional components with hooks.
|
||||
- Format code consistently -- the project includes configuration for code formatters.
|
||||
|
||||
### Backend (Python)
|
||||
|
||||
- Follow **PEP 8** conventions.
|
||||
- Use type hints for function parameters and return values.
|
||||
- Write clear docstrings for public functions and classes.
|
||||
- Keep functions focused and concise.
|
||||
|
||||
## Testing
|
||||
|
||||
- Test your changes locally before submitting a pull request.
|
||||
- Verify that existing functionality is not broken by your changes.
|
||||
- For new features, include tests where applicable.
|
||||
|
||||
## Review Process
|
||||
|
||||
After submitting a pull request:
|
||||
|
||||
1. A maintainer will review your code and may request changes.
|
||||
2. Address any feedback by pushing additional commits to your branch.
|
||||
3. Once approved, a maintainer will merge your pull request.
|
||||
|
||||
## Reporting Issues
|
||||
|
||||
If you find a bug or have a feature request, please [open an issue](https://github.com/learnhouse/learnhouse/issues/new) on GitHub. Include as much detail as possible: steps to reproduce, expected behavior, actual behavior, and any relevant logs or screenshots.
|
||||
21
content/developers/contributing/index.mdx
Normal file
21
content/developers/contributing/index.mdx
Normal file
@@ -0,0 +1,21 @@
|
||||
# Contributing to LearnHouse
|
||||
|
||||
Thank you for your interest in contributing to LearnHouse! Whether you are fixing a bug, adding a feature, or improving documentation, your contributions are welcome.
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. **[Set up your development environment](/developers/contributing/dev-environment)** -- Get a local instance of LearnHouse running using the LearnHouse CLI.
|
||||
2. **[Review the contribution guidelines](/developers/contributing/guidelines)** -- Understand our workflow, code style, and expectations for pull requests.
|
||||
|
||||
## Finding Work
|
||||
|
||||
The best place to start is the [LearnHouse GitHub issues](https://github.com/learnhouse/learnhouse/issues) page. Look for issues labeled:
|
||||
|
||||
- **`help wanted`** -- Issues where community contributions are especially welcome.
|
||||
- **`good first issue`** -- Smaller, well-scoped tasks ideal for first-time contributors.
|
||||
|
||||
If you have an idea for a new feature, open an issue first to discuss it with the maintainers before starting work.
|
||||
|
||||
## Questions
|
||||
|
||||
If you have questions about contributing, feel free to open a discussion on the [GitHub repository](https://github.com/learnhouse/learnhouse) or reach out to the maintainers through the issue tracker.
|
||||
Reference in New Issue
Block a user