mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 05:14:23 +00:00
restructure and rethink setup
This commit is contained in:
@@ -54,9 +54,9 @@ const settings = JSON.parse( fs.readFileSync( path.join( __dirname + '/config/se
|
|||||||
|
|
||||||
console.log( '[ Server ] Setting up static routes' );
|
console.log( '[ Server ] Setting up static routes' );
|
||||||
if ( settings.init ) {
|
if ( settings.init ) {
|
||||||
app.use( express.static( '../webapp/main/dist' ) );
|
app.use( express.static( 'webapp/main/dist' ) );
|
||||||
} else {
|
} else {
|
||||||
app.use( express.static( '../webapp/setup/dist' ) );
|
app.use( express.static( 'webapp/setup/dist' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialise express with middlewares
|
// initialise express with middlewares
|
||||||
@@ -76,7 +76,7 @@ app.use( expressSession( {
|
|||||||
// app.use( bodyParser.json() );
|
// app.use( bodyParser.json() );
|
||||||
app.use( cookieParser() );
|
app.use( cookieParser() );
|
||||||
|
|
||||||
let file = path.join( __dirname + '/webapp/index.html' );
|
let file = path.join( __dirname + '/webapp/main/dist/index.html' );
|
||||||
|
|
||||||
console.log( '[ Server ] loading backend components' );
|
console.log( '[ Server ] loading backend components' );
|
||||||
if ( settings.init ) {
|
if ( settings.init ) {
|
||||||
@@ -86,7 +86,7 @@ if ( settings.init ) {
|
|||||||
require( './backend/userRoutes.js' )( app, settings ); // user routes
|
require( './backend/userRoutes.js' )( app, settings ); // user routes
|
||||||
} else {
|
} else {
|
||||||
require( './setup/setupRoutes.js' )( app, settings ); // setup routes
|
require( './setup/setupRoutes.js' )( app, settings ); // setup routes
|
||||||
file = path.join( __dirname + '/../webapp/setup/dist/index.html' );
|
file = path.join( __dirname + '/webapp/setup/dist/index.html' );
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log( '[ Server ] loading plugins' );
|
console.log( '[ Server ] loading plugins' );
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"init": true,
|
"init": false,
|
||||||
"twoFA": "allow",
|
"twoFA": "allow",
|
||||||
|
"setupKey": "hello world",
|
||||||
"twoFAMode": "enhanced",
|
"twoFAMode": "enhanced",
|
||||||
"db": "mysql",
|
"db": "mysql",
|
||||||
"payments": "stripe",
|
"payments": "stripe",
|
||||||
|
|||||||
@@ -7,11 +7,19 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const db = require( '../backend/db/db.js' );
|
||||||
|
|
||||||
module.exports = ( app, settings ) => {
|
module.exports = ( app, settings ) => {
|
||||||
/*
|
/*
|
||||||
Admin login route that checks the password
|
Admin login route that checks the password
|
||||||
*/
|
*/
|
||||||
|
|
||||||
app.get( '/setup/start', ( request, response ) => {} );
|
app.get( '/setup/start', ( request, response ) => {
|
||||||
|
if ( request.query.token === settings.setupToken ) {
|
||||||
|
response.send( 'ok' );
|
||||||
|
} else {
|
||||||
|
response.send( 'incorrect' );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
../webapp/main/dist/
|
../webapp/
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<h2>Event analytics</h2>
|
<h2>Event analytics</h2>
|
||||||
<p>Get insights into tickets sold, people checked in, available tickets, revenue, etc, in real time!</p>
|
<p>Get insights into tickets sold, people checked in, available tickets, revenue, etc, in real time!</p>
|
||||||
|
<p>Coming soon! (in the next major update)</p>
|
||||||
<!-- TODO: Add toggle for real-time update (gets live updates from sse) -->
|
<!-- TODO: Add toggle for real-time update (gets live updates from sse) -->
|
||||||
<!-- Use chart.js for visualisations -->
|
<!-- Use chart.js for visualisations -->
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -43,33 +43,6 @@ export default {
|
|||||||
setupAuthRequired: true,
|
setupAuthRequired: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: 'payments',
|
|
||||||
name: 'setupPayments',
|
|
||||||
component: () => import( '../views/SetupPaymentsView.vue' ),
|
|
||||||
meta: {
|
|
||||||
title: 'Payments :: Setup - libreevent',
|
|
||||||
setupAuthRequired: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'events',
|
|
||||||
name: 'setupEvents',
|
|
||||||
component: () => import( '../views/SetupEventsView.vue' ),
|
|
||||||
meta: {
|
|
||||||
title: 'Events :: Setup - libreevent',
|
|
||||||
setupAuthRequired: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'tos',
|
|
||||||
name: 'setupTOS',
|
|
||||||
component: () => import( '../views/SetupTOSView.vue' ),
|
|
||||||
meta: {
|
|
||||||
title: 'TOS (Optional) :: Setup - libreevent',
|
|
||||||
setupAuthRequired: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: 'complete',
|
path: 'complete',
|
||||||
name: 'setupComplete',
|
name: 'setupComplete',
|
||||||
|
|||||||
@@ -13,6 +13,12 @@
|
|||||||
<h1>Setup complete!</h1>
|
<h1>Setup complete!</h1>
|
||||||
<p>Congratulations on finishing the setup of libreǝvent!</p>
|
<p>Congratulations on finishing the setup of libreǝvent!</p>
|
||||||
<p>Please restart the node.js application to have it load the actual user interface for libreevent. You may then log in at <a :href="windowURL" target="_blank">{{ windowURL }}</a></p>
|
<p>Please restart the node.js application to have it load the actual user interface for libreevent. You may then log in at <a :href="windowURL" target="_blank">{{ windowURL }}</a></p>
|
||||||
|
<p>In the admin panel, there are a few things you still need to change. You may find a list of all things <a href="/docs/setup/afterSetup">here</a></p>
|
||||||
|
<ul>
|
||||||
|
<li>Choose a payment gateway and set it up</li>
|
||||||
|
<li>Create a event location and an event</li>
|
||||||
|
<li>Create other admin accounts with less privileges</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
<!--
|
|
||||||
* libreevent - SetupEventsView.vue
|
|
||||||
*
|
|
||||||
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
|
|
||||||
* https://janishutz.com, development@janishutz.com
|
|
||||||
*
|
|
||||||
*
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<h1>Events</h1>
|
|
||||||
<p>You may choose all of the below payment methods, but we recommend to only select one payment gateway for simplicity. Recommended: Either Stripe or Adyen. See the comparison of the different payment methods <a href="https://libreevent.janishutz.com/docs/payments">here</a></p>
|
|
||||||
<p>You may find more infos about this part <a href="https://libreevent.janishutz.com/docs/setup/setup#payment-methods" target="_blank">here</a></p>
|
|
||||||
<button @click="submit()">Continue</button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { useBackendStore } from '@/stores/backendStore.js';
|
|
||||||
import { mapStores } from 'pinia';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
formData: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapStores( useBackendStore )
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
submit () {
|
|
||||||
this.backendStore.addVisitedSetupPages( 'tos', true );
|
|
||||||
this.$router.push( '/setup/tos' );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
options: { 'default': { 'id': 'default', 'name': 'Default' }},
|
options: { 'default': { 'id': 'default', 'name': 'Default' } },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -37,8 +37,8 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
submit () {
|
submit () {
|
||||||
this.backendStore.addVisitedSetupPages( 'payments', true );
|
this.backendStore.addVisitedSetupPages( 'complete', true );
|
||||||
this.$router.push( '/setup/payments' );
|
this.$router.push( '/setup/complete' );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
<!--
|
|
||||||
* libreevent - SetupPaymentsView.vue
|
|
||||||
*
|
|
||||||
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
|
|
||||||
* https://janishutz.com, development@janishutz.com
|
|
||||||
*
|
|
||||||
*
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<h1>Setting up payment methods</h1>
|
|
||||||
<p>You may choose all of the below payment methods, but we recommend to only select one payment gateway for simplicity. Recommended: Either Stripe or Adyen. See the comparison of the different payment methods <a href="https://libreevent.janishutz.com/docs/payments" target="_blank">here</a></p>
|
|
||||||
<p>You may find more infos about this part <a href="https://libreevent.janishutz.com/docs/setup/setup#payment-methods" target="_blank">here</a></p>
|
|
||||||
<button @click="submit()">Continue</button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { useBackendStore } from '@/stores/backendStore.js';
|
|
||||||
import { mapStores } from 'pinia';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
formData: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapStores( useBackendStore )
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
submit () {
|
|
||||||
this.backendStore.addVisitedSetupPages( 'events', true );
|
|
||||||
this.$router.push( '/setup/events' );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
<!--
|
|
||||||
* libreevent - SetupTOSView.vue
|
|
||||||
*
|
|
||||||
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
|
|
||||||
* https://janishutz.com, development@janishutz.com
|
|
||||||
*
|
|
||||||
*
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<h3>Setting up TOS (optional)</h3>
|
|
||||||
<p>You may choose all of the below payment methods, but we recommend to only select one payment gateway for simplicity. Recommended: Either Stripe or Adyen. See the comparison of the different payment methods <a href="https://libreevent.janishutz.com/docs/payments" target="_blank">here</a></p>
|
|
||||||
<p>You may find more infos about this part <a href="https://libreevent.janishutz.com/docs/setup/setup#payment-methods" target="_blank">here</a></p>
|
|
||||||
<button @click="submit()">Continue</button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { useBackendStore } from '@/stores/backendStore.js';
|
|
||||||
import { mapStores } from 'pinia';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
formData: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapStores( useBackendStore )
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
submit () {
|
|
||||||
this.backendStore.addVisitedSetupPages( 'complete', true );
|
|
||||||
this.$router.push( '/setup/complete' );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -15,12 +15,6 @@
|
|||||||
<a v-else class="inactive">Root account</a> |
|
<a v-else class="inactive">Root account</a> |
|
||||||
<router-link to="/setup/page" v-if="backendStore.getVisitedSetupPages[ 'page' ]">Landing page</router-link>
|
<router-link to="/setup/page" v-if="backendStore.getVisitedSetupPages[ 'page' ]">Landing page</router-link>
|
||||||
<a v-else class="inactive">Landing page</a> |
|
<a v-else class="inactive">Landing page</a> |
|
||||||
<router-link to="/setup/payments" v-if="backendStore.getVisitedSetupPages[ 'payments' ]">Payments</router-link>
|
|
||||||
<a v-else class="inactive">Payments</a> |
|
|
||||||
<router-link to="/setup/events" v-if="backendStore.getVisitedSetupPages[ 'events' ]">Events</router-link>
|
|
||||||
<a v-else class="inactive">Events</a> |
|
|
||||||
<router-link to="/setup/tos" v-if="backendStore.getVisitedSetupPages[ 'tos' ]" @click="unlock( 'complete' )">TOS</router-link>
|
|
||||||
<a v-else class="inactive">TOS</a> |
|
|
||||||
<router-link to="/setup/complete" v-if="backendStore.getVisitedSetupPages[ 'complete' ]">Complete</router-link>
|
<router-link to="/setup/complete" v-if="backendStore.getVisitedSetupPages[ 'complete' ]">Complete</router-link>
|
||||||
<a v-else class="inactive">Complete</a>
|
<a v-else class="inactive">Complete</a>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -50,11 +44,6 @@
|
|||||||
created () {
|
created () {
|
||||||
this.backendStore.loadVisitedSetupPages();
|
this.backendStore.loadVisitedSetupPages();
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
unlock ( page ) {
|
|
||||||
this.backendStore.addVisitedSetupPages( page, true );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user