Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Brahmer <[email protected]>
  • Loading branch information
Grotax committed Dec 31, 2024
1 parent 8f6351d commit 16b4d3a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 9 deletions.
27 changes: 27 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Dev Containers

## Image Used in This Project

This project uses a Nextcloud Docker image for the development container. The image is defined in the `.devcontainer.json` configuration file. For more details about the image and its configuration, you can refer to the [GitHub repository](https://github.com/juliusknorr/nextcloud-dev).

# VS Code

## Introduction to Dev Containers

Dev Containers are a feature in Visual Studio Code that allows you to develop inside a containerized environment. This ensures that your development environment is consistent across different machines and setups. By using Dev Containers, you can easily share your development environment with your team, ensuring that everyone is working with the same dependencies and configurations.

## How to Use Dev Containers with VS Code

1. **Install Docker**: Make sure you have Docker installed on your machine. You can download it from [Docker's official website](https://www.docker.com/products/docker-desktop).

2. **Install VS Code**: If you haven't already, download and install Visual Studio Code from [here](https://code.visualstudio.com/).

3. **Install the Remote - Containers Extension**: Open VS Code and go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window. Search for "Remote - Containers" and install it.

4. **Open a Folder in a Container**:
- Open your project folder in VS Code.
- Press `F1` to open the Command Palette, then type `Remote-Containers: Open Folder in Container...` and select it.
- VS Code will build the container and open your project inside it.


For further information on how to configure and use Dev Containers, please visit the [official documentation](https://code.visualstudio.com/docs/remote/containers).
27 changes: 18 additions & 9 deletions docs/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,33 @@ To test the codestyle you can run `make phpcs`.

The application Front End uses Vue 2.7 and the Nextcloud Libraries [Vue Components](https://github.com/nextcloud-libraries/nextcloud-vue) for building the Application running inside your Nextcloud instance. For linting these files, we are using eslint, see the [config file](https://github.com/nextcloud/news/blob/master/.eslintrc.js). We also have Unit Tests for the components that run with Jest, please ensure these pass when adding new features/fixing bugs.

## General Developer setup
## Developer setup
TL;DR:

Check the Nextcloud [documentation](https://docs.nextcloud.com/server/latest/developer_manual/getting_started/devenv.html) to learn how to setup a developer environment, alternatively to a proper web server you can also use the [builtin php server](https://www.php.net/manual/en/features.commandline.webserver.php) on demand, it is enough for development purposes.
- Clone [nextcloud server repository](https://github.com/nextcloud/server)
- run `git submodule update --init`
- Install the server `php ./occ maintenance:install`
- Clone the viewer repo if you want to be able to upgrade the setup
- `cd apps && git clone https://github.com/nextcloud/viewer.git`
- Inside apps dir clone the news app: `git clone https://github.com/nextcloud/news.git`

When your setup is running, clone the news repository in the `apps/` directory inside the server.
For more information check the Nextcloud [documentation](https://docs.nextcloud.com/server/latest/developer_manual/getting_started/devenv.html), the setup of a webserver is not strictly needed for backend development.

Change into the news directory and run `make` to build the app, you will need php, composer, node, npm and maybe more.

Now you can basically use the news app and test any changes you make on your local development environment. Check out the `appinfo/routes.php` file and `lib/controller/` directory for details on API controllers. Or check out `package.json` for npm scripts and the `src/` directory for the front end Vue Application.

## Alternative Developer setup
With [PR 2670](https://github.com/nextcloud/news/pull/2670) new options to create a development environment were added.
### Docker
We also have a docker based environment check the README in the `docker/` directory.

See the README in the docker directory.
This setup is nice since you get a full nextcloud installation and you can open the interface in the browser, which allows you to easily test your changes.

There is also a nix-shell config and zellij layout prepared.
There is also a nix-shell config and zellij layout prepared if you are interested in that.

If you have issues with the setup create a [new discussion](https://github.com/nextcloud/news/discussions).
### Devcontainer
Check the README in the .devcontainer directory.

If you have issues with setting up a developer environment create a [new discussion](https://github.com/nextcloud/news/discussions/categories/developer).

### Frontend Tips/Organization

Expand All @@ -53,7 +62,7 @@ If you have issues with the setup create a [new discussion](https://github.com/n

## Testing

Please make sure to run all tests before submitting any pull requests.
When submitting your PR the tests will be run automatically, try to fix any errors.

### Frontend Unit Tests

Expand Down

0 comments on commit 16b4d3a

Please sign in to comment.