1
0
Fork 0

Revert "chore: Linting for markdown and js"

This reverts commit 1c92e0f655.
This commit is contained in:
joostdecock 2021-10-17 18:26:00 +02:00
parent 994874fa72
commit cba1ab19c8
6627 changed files with 25791 additions and 24211 deletions

View file

@ -1,6 +1,8 @@
***
---
title: backend
---
## title: backend
<Note>
@ -15,11 +17,11 @@ using [MongoDB](https://www.mongodb.com/) as our database.
This backend handles the storage and retrieval of user data. Including:
* User profiles
* Models
* Recipes
- User profiles
- Models
- Recipes
This backend does not include any code related to our patterns.
This backend does not include any code related to our patterns.
It is only required if you want to use your own instance
of [freesewing.org](https://github.com/freesewing/backend).
@ -27,8 +29,8 @@ of [freesewing.org](https://github.com/freesewing/backend).
To start this backend, you'll need:
* A MongoDB database
* Configure environment variables (see [configuration](#configuration) below)
- A MongoDB database
- Configure environment variables (see [configuration](#configuration) below)
There's a few different ways you can get started:
@ -38,7 +40,9 @@ If you just want the backend and provide your own mongo instance,
you can run [our docker image](https://hub.docker.com/r/freesewing/backend) directly
from the internet:
docker run --env-file .env --name fs_backend -d -p 3000:3000 freesewing/backend
```
docker run --env-file .env --name fs_backend -d -p 3000:3000 freesewing/backend
```
Your backend will now be available at http://localhost:3000
@ -47,9 +51,11 @@ Your backend will now be available at http://localhost:3000
You can use [docker-compose](https://docs.docker.com/compose/) to spin up both the backend
API and a MongoDB instance. Clone the repository, and run `docker-compose up`:
git clone git@github.com:freesewing/backend.git
cd backend
docker-compose up
```
git clone git@github.com:freesewing/backend.git
cd backend
docker-compose up
```
Your backend will now be available at http://localhost:3000
@ -58,10 +64,12 @@ Your backend will now be available at http://localhost:3000
To run the backend from source, you'll need to clone this repository
and intall dependencies.
git clone git@github.com:freesewing/backend
cd backend
npm install
npm install --global backpack-core
```
git clone git@github.com:freesewing/backend
cd backend
npm install
npm install --global backpack-core
```
<Note>
@ -71,25 +79,30 @@ We are installing [backpack-core](https://www.npmjs.com/package/backpack-core) g
While developing, you can run:
npm run develop
```
npm run develop
```
And backpack will compile the backend, and spin it up.
It will also watch for changes and re-compile every time. Handy!
If you want to run this in production, you should build the code:
npm run build
```
npm run build
```
Then use something like [PM2](http://pm2.keymetrics.io/) to run it and keep it running.
## Configuration
This backend can be configured with environment variables.
We provide an `example.env` file that you can edit and rename to `.env`.
This backend can be configured with environment variables.
We provide an `example.env` file that you can edit and rename to `.env`.
This way they will be picked up automatically.
The available variables are listed below, as we as in our [example.env](https://github.com/freesewing/backend/blob/develop/example.env) file.
| Variable | Description |
| ------------------------- | ------------------------------------------------ |
| `FS_BACKEND` | URL on which the backend is hosted |
@ -110,7 +123,9 @@ The available variables are listed below, as we as in our [example.env](https://
This API uses [JWT](https://jwt.io/) for authentication. Authenticated calls to this API should include a `Authorization` header as such:
Authorization: Bearer <token>
```
Authorization: Bearer <token>
```
The `token` is returned from the `/login`, `/oauth/login`, and `/confirm/login` endpoints.
@ -139,17 +154,19 @@ Because of this, this backend comes with a couple of command-line tools to do ba
There's two ways to run tests:
* `npm run test` will run tests that don't depend on emails
- `npm run test` will run tests that don't depend on emails
![npm run test](https://github.com/freesewing/backend/blob/develop/test.svg)
* `npm run testall` will runn all tests, including the ones that depend on email
- `npm run testall` will runn all tests, including the ones that depend on email
![npm run testall](https://github.com/freesewing/backend/blob/develop/testall.svg)
To run the email tests, spin up a mailhog container with Docker:
sudo docker run -p 8025:8025 -p 1025:1025 mailhog/mailhog
```
sudo docker run -p 8025:8025 -p 1025:1025 mailhog/mailhog
```
Then, configure your backend as such:
@ -158,13 +175,14 @@ Then, configure your backend as such:
This allows complete end-to-end testing of signup flow and other things the depend on email sent to the user.
## Links
* 💻 Maker site: [freesewing.org](https://freesewing.org)
* 👩‍💻 Developer site: [freesewing.dev](https://freesewing.dev)
* 💬 Chat/Support: [discord.freesewing.org](https://discord.freesewing.org)
* 🐦 Twitter: [@freesewing\_org](https://twitter.com/freesewing\_org)
* 📷 Instagram: [@freesewing\_org](https://instagram.com/freesewing\_org)
- 💻 Maker site: [freesewing.org](https://freesewing.org)
- 👩‍💻 Developer site: [freesewing.dev](https://freesewing.dev)
- 💬 Chat/Support: [discord.freesewing.org](https://discord.freesewing.org)
- 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org)
- 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org)
## License

View file

@ -1,9 +1,8 @@
***
---
title: Repositories
for: contributors
about: Complete list of all FreeSewing software repositories
------------------------------------------------------------
---
FreeSewing uses the following repositories:

View file

@ -1,6 +1,8 @@
***
---
title: freesewing.dev
---
## title: freesewing.dev
<RepoPage repo="freesewing.dev" />
@ -9,3 +11,4 @@ and the site you are browsing right now.
It's a [JAMStack](https://jamstack.org/) site powered by [Gatsby](https://www.gatsbyjs.org/) and
hosted by [Netlify](https://www.netlify.com/).

View file

@ -1,6 +1,8 @@
***
---
title: freesewing.org
---
## title: freesewing.org
<RepoPage repo="freesewing.org" />
@ -34,6 +36,7 @@ please check [these alternatives](https://stackoverflow.com/questions/3796927/ho
</Note>
<Note>
We're creating a copy of the `.env.example` file here as it contains required environment variables.
@ -73,8 +76,8 @@ The website allows signing up/logging in via your Github or Google account.
We use Oauth for this, which has a few dependencies:
* You need to create/configure an app with Github and Google for Oauth
* You need to configure the various environment variables (see below)
- You need to create/configure an app with Github and Google for Oauth
- You need to configure the various environment variables (see below)
If you don't setup/configure Oauth, everything will work, except Oath (duh).
@ -104,3 +107,5 @@ The `.env.example` file contains the required variables to get the site up and r
| `GATSBY_ALGOLIA_API_ID` | The Algolia client ID for search (under construction) | `MA0Y5A2PF0` |
| `GATSBY_ALGOLIA_SEARCH_KEY` | The Algolia *read only* key for search (under construction) | `9209470ad243eee797156aa2874d886c` |
| `GATSBY_ALGOLIA_UPDATE_KEY` | The *write* key to update the Algolia search index at build time (under construction) | `ba780a3afe2118062ee08ea4fb54c097` |

View file

@ -1,9 +1,12 @@
***
---
title: freesewing
---
## title: freesewing
<RepoPage repo="freesewing" />
This is a [monorepo](https://en.wikipedia.org/wiki/Monorepo) holding all
our [NPM packages](/reference/packages/).
This is a [monorepo](https://en.wikipedia.org/wiki/Monorepo) holding all
our [NPM packages](/reference/packages/).
We use [Lerna](https://lerna.js.org/) and [Yarn workspaces](https://yarnpkg.com/en/docs/workspaces) to manage the repo.

View file

@ -1,6 +1,8 @@
***
---
title: svgtopdf
---
## title: svgtopdf
<RepoPage repo="svgtopdf" />
@ -9,3 +11,4 @@ turns SVGs into (tiled) PDFs.
We've decided to implement this as a stand-alone app rather than integrate it into [our backend](/reference/repos/backend/) because
while our backend is highly specific to our own website, this is a feature that others might want to re-use.

View file

@ -1,6 +1,8 @@
***
---
title: tile
---
## title: tile
<RepoPage repo="tile" />