Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implement Admin View #1

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
119 changes: 26 additions & 93 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,104 +1,37 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
.idea

# Runtime data
pids
*.pid
*.seed
*.pid.lock
# dependencies
/node_modules
/.pnp
.pnp.js

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# testing
/coverage

# Coverage directory used by tools like istanbul
coverage
*.lcov
# next.js
/.next/
/out/

# nyc test coverage
.nyc_output
# production
/build

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# misc
.DS_Store
*.pem

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Dependency directories
node_modules/
jspm_packages/
# local env files
.env*.local

# TypeScript v1 declaration files
typings/
# vercel
.vercel

# TypeScript cache
# typescript
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
next-env.d.ts
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/[id].tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
23 changes: 23 additions & 0 deletions mappings/GET_login.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"request": {
"method": "GET",
"url": "/login",
"cookies": {
"session": {
"matches": "supersecretusersessionkey"
}
}
},
"response": {
"status": 200,
"jsonBody": {
"displayName": "Max Mustermann",
"email": "[email protected]",
"isInstanceAdmin": true,
"isOrigin": true
},
"headers": {
"Content-Type": "application/json"
}
}
}
12 changes: 12 additions & 0 deletions mappings/GET_login_unauthorized.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"request": {
"method": "GET",
"url": "/login"
},
"response": {
"status": 401,
"headers": {
"Content-Type": "application/json"
}
}
}
30 changes: 30 additions & 0 deletions mappings/GET_space0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"request": {
"method": "GET",
"url": "/space/0",
"cookies": {
"session": {
"matches": "supersecretusersessionkey"
}
}
},
"response": {
"status": 200,
"jsonBody": {
"id": 0,
"name": "Sample Webseite",
"color1": "#576CA8",
"color2": "#274690",
"color3": "#1D1F25",
"color4": "#272A30",
"primaryLanguage": "de-DE",
"languages": [
"de-DE",
"en-US"
]
},
"headers": {
"Content-Type": "application/json"
}
}
}
32 changes: 32 additions & 0 deletions mappings/GET_spaces.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"request": {
"method": "GET",
"url": "/spaces",
"cookies": {
"session": {
"matches": "supersecretusersessionkey"
}
}
},
"response": {
"status": 200,
"jsonBody": [
{
"id": 0,
"name": "Sample Webseite",
"color1": "#576CA8",
"color2": "#274690",
"color3": "#1D1F25",
"color4": "#272A30",
"primaryLanguage": "de-DE",
"languages": [
"de-DE",
"en-US"
]
}
],
"headers": {
"Content-Type": "application/json"
}
}
}
12 changes: 12 additions & 0 deletions mappings/GET_spaces_unauthorized.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"request": {
"method": "GET",
"url": "/spaces"
},
"response": {
"status": 401,
"headers": {
"Content-Type": "application/json"
}
}
}
21 changes: 21 additions & 0 deletions mappings/POST_login.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"request": {
"method": "POST",
"url": "/login",
"bodyPatterns": [ {
"equalToJson": {
"email": "[email protected]",
"password": "password"
}
}]
},
"response": {
"status": 200,
"jsonBody": {
"session": "supersecretusersessionkey"
},
"headers": {
"Content-Type": "application/json"
}
}
}
12 changes: 12 additions & 0 deletions mappings/POST_login_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"request": {
"method": "POST",
"url": "/login"
},
"response": {
"status": 401,
"headers": {
"Content-Type": "application/json"
}
}
}
30 changes: 30 additions & 0 deletions mappings/PUT_space0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"request": {
"method": "PUT",
"url": "/space/0",
"cookies": {
"session": {
"matches": "supersecretusersessionkey"
}
}
},
"response": {
"status": 201,
"jsonBody": {
"id": 0,
"name": "Sample Webseite",
"color1": "#576CA8",
"color2": "#274690",
"color3": "#1D1F25",
"color4": "#272A30",
"primaryLanguage": "de-DE",
"languages": [
"de-DE",
"en-US"
]
},
"headers": {
"Content-Type": "application/json"
}
}
}
6 changes: 6 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}

module.exports = nextConfig
Loading