Skip to content

Commit

Permalink
Adds SpectaQL documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert27 committed Apr 10, 2024
1 parent 322d06d commit df7d4ec
Show file tree
Hide file tree
Showing 28 changed files with 2,736 additions and 239 deletions.
16 changes: 0 additions & 16 deletions .dockerignore

This file was deleted.

3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"noUnusedLocals": true,
"noUnusedParameters": true
},
"rules": {}
"rules": {},
"ignorePatterns": ["node_modules", "documentation"]
}
43 changes: 43 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static documentation to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './documentation/generated'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env.local
.VSCodeCounter
node_modules
.DS_Store
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bun lint-staged
bun lint-staged
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
documentation/generated
39 changes: 33 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# neuland.app-backend

GraphQL API for the neuland.app and Neuland Next app using Apollo Server and Bun.
Neuland API uses GraphQL to provide a flexible and powerful API for neuland.app and Neuland Next.

## API Documentation

The API documentation is available [here](https://neuland-ingolstadt.github.io/neuland.app-backend/).

### Endpoint

https://api.neuland.app

> [!IMPORTANT]
> Using the provided API endpoint outside of the neuland.app and Neuland Next app is not allowed.
## Development

### Getting Started

Expand All @@ -9,12 +22,15 @@ bun i
```

Set the necessary environment variables in a `.env.local` file.
You can use the `.env.local.example` file as a template.

````bash

### Start the Development Server

```bash
bun start
```
````
> [!TIP]
> Use `bun dev` to start the development server with hot reloading.
Expand All @@ -31,8 +47,19 @@ http://localhost:4000/

- `index.ts` - The entry point for the API.
- `src/` - Contains the source code for the GraphQL API.
- `src/data/` - Contains the static data for the API.
- `src/resolvers/` - Contains the resolvers for the API.
- `src/schema/` - Contains the type definitions for the API.
- `src/schema.gql` - Contains the GraphQL schema.
- `src/data/` - Contains the static data.
- `src/resolvers/` - Contains the resolvers.
- `src/types/` - Contains the types for TypeScript.
- `src/utils/` - Contains utility functions for the API.
- `src/scrapers/` - Contains the scrapers for the data used by the resolvers.
- `src/utils/` - Contains utility functions.

#### Commiting Changes

We use husky to lint and test the code before it is committed, that's why we recommend using the ESLint and Prettier extensions in VSCode.
When changing the schema file husky will automatically generate the html documentation. Therefore, you need to have the `spectaql` package installed globally.
```bash
npm install -g spectaql
```
13 changes: 0 additions & 13 deletions docker-compose.yaml

This file was deleted.

13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.8'

services:
app:
build:
context: .
dockerfile: Dockerfile
environment:
- NODE_ENV=production
ports:
- '4000:4000'
volumes:
- ./.env.local:/usr/src/app/.env.local
27 changes: 27 additions & 0 deletions documentation/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
introspection:
schemaFile:
- ./src/schema.gql

servers:
- url: https://api.neuland.app
description: Neuland API Server
production: true
info:
title: Neuland API Documentation
description:
Neuland API uses GraphQL to provide a flexible and powerful API for neuland.app and Neuland Next.
This documentation provides a detailed overview of the API and its capabilities.
Using the provided API endpoint outside of the neuland.app and Neuland Next app is not allowed.
termsOfService: 'https://assets.neuland.app/datenschutzerklaerung-app.pdf'
contact:
name: Neuland Ingolstadt e.V.
email: [email protected]
url: https://github.com/neuland-ingolstadt/neuland.app-backend
license:
name: AGPL-3.0
url: 'https://www.gnu.org/licenses/agpl-3.0.html'
spectaql:
faviconFile: ./documentation/icon.svg
theme: spectaql
logoFile: ./documentation/icon.svg
targetDir: ./documentation/generated
106 changes: 106 additions & 0 deletions documentation/generated/images/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit df7d4ec

Please sign in to comment.