profectus-docs/docs/guide/getting-started/setup.md

55 lines
3.7 KiB
Markdown
Raw Permalink Normal View History

2022-03-03 01:28:57 +00:00
# Setting Up
2022-03-01 04:08:36 +00:00
2023-04-10 02:40:12 +00:00
Profectus requires a Node.js development environment for working on a project. If you are comfortable with the command line, a local development environment is recommended.
2022-03-03 01:28:57 +00:00
## Local Development
2023-04-10 02:40:12 +00:00
For local development, you will need the following tools:
- [git](https://git-scm.com/downloads)
- [node](https://nodejs.org/en/download/)
Create a new project from the [Profectus repository](https://code.incremental.social/profectus/Profectus) by clicking the "Use this template" button. Then, clone the repository locally using the provided link.
::: info
2023-04-18 03:43:07 +00:00
The template repository allows easy creation of multiple projects from one repository. However, updating an existing project to a newer version of Profectus can be challenging. Consider [updating Profectus](./updating.md) _before_ starting development to avoid issues with unrelated histories.
:::
It's recommended to create a new Git branch for development, allowing you to push changes without affecting the live build. The workflows will automatically rebuild the page when you push it to the `main` branch.
2023-05-16 12:13:17 +00:00
Next, install Profectus' dependencies by running `npm install`. Run `npm run dev` to start a local server hosting your project. The site will automatically reload as you modify files.
2023-04-18 03:43:07 +00:00
Also, follow the steps to [update Profectus](./updating.md) before starting to make future updates easier without worrying about unrelated histories.
2022-03-03 01:28:57 +00:00
### Deploying
Actions should be enabled by default on new repositories. To deploy, push changes to the main branch. The site will be updated automatically in a few minutes. Check progress or errors from the Actions tab on your repository.
2023-04-10 02:40:12 +00:00
Upon action completion, you will now have a `pages` branch which is automatically available at `https://<YOUR_GITHUB_USERNAME>.pages.incremental.social/<YOUR_REPO_NAME>/`. For example, the TMT Demo project hosted at https://code.incremental.social/profectus/TMT-Demo is available at https://profectus.pages.incremental.social//TMT-Demo/.
2022-03-06 04:34:42 +00:00
### Visual Studio Code Setup
2023-04-10 02:40:12 +00:00
If you don't have a preferred IDE, Profectus is developed in [Visual Studio Code](https://code.visualstudio.com) and is known to work well with it.
2022-07-10 00:42:23 +00:00
Recommendations:
- Use [Take Over Mode](https://vuejs.org/guide/typescript/overview.html#volar-takeover-mode) for proper type analysis
2022-07-10 00:42:23 +00:00
- Turn off `.value` autocomplete by running the `Preferences: Open Settings` command and setting `volar.autoCompleteRefs` to `false`
- Disable emmet expansions by setting `emmet.showExpandedAbbreviation` to `"never"`, also in the preferences
2023-04-10 02:40:12 +00:00
- Install the [Vitest VS Code extension](https://marketplace.visualstudio.com/items?itemName=ZixuanChen.vitest-explorer&ssr=false#qna) for running and debugging unit tests (if working on the engine itself)
2022-03-06 04:34:42 +00:00
2022-03-03 01:28:57 +00:00
## Replit
2023-04-10 02:40:12 +00:00
As an alternative to local development, you may use [Replit](https://replit.com). Replit sets up your development and hosts your project.
2023-04-10 02:40:12 +00:00
On the free plan, you'll face limitations, and the program may need occasional startups.
2023-04-10 02:40:12 +00:00
To create a Profectus project on Replit, all you have to do is click this button:
2022-03-03 01:28:57 +00:00
[![Run on Repl.it](https://repl.it/badge/github/profectus-engine/Profectus)](https://repl.it/github/profectus-engine/Profectus)
2023-04-10 02:40:12 +00:00
Click the "Run" button at the top of the screen to start development. This will also make the project publicly accessible, essentially auto-deploying it. However, this means you cannot separate your development and production environments.
2022-03-03 01:28:57 +00:00
## Glitch
2023-04-10 02:40:12 +00:00
[Glitch](https://glitch.com) is a site similar to Replit, with many of the same pros and cons. To create a Profectus project on Glitch, select "New Project", "Import from GitHub", and enter `profectus-engine/Profectus`. The new project will be automatically configured and ready to go.