restructuring

This commit is contained in:
janishutz committed 2023-07-18 09:00:57 +02:00
1 parent 98ac5c8dfc
commit 21afcdb036
94 files changed
+49 -32

No files matched your search

File renamed without changes.
+15 -21
View File
@@ -21,25 +21,11 @@ const settings = JSON.parse( fs.readFileSync( path.join( __dirname + '/config/se
// const mail = require( './backend/mail/mailSender.js' ); // const mail = require( './backend/mail/mailSender.js' );
// const mailManager = new mail(); // const mailManager = new mail();
// const dbh = require( './backend/db/mysqldb.js' ); if ( settings.init ) {
// const db = new dbh(); app.use( express.static( '../webapp/main/dist' ) );
} else {
// db.connect(); app.use( express.static( '../webapp/setup/dist' ) );
}
// const env = process.env.PROD || false;
// if ( !settings.init ) {
// db.setupDB( 'janishut_libreeventTest' );
// }
// const responseTime = require( 'response-time' );
// app.use( responseTime( ( request, response, time ) => {
// console.log( time );
// } ) );
app.use( express.static( '../webapp/dist' ) );
// app.use( express.static( '.' ) );
// initialise express with middlewares // initialise express with middlewares
// TODO: Generate random token // TODO: Generate random token
@@ -56,11 +42,19 @@ app.use( bodyParser.urlencoded( { extended: false } ) );
app.use( bodyParser.json() ); app.use( bodyParser.json() );
app.use( cookieParser() ); app.use( cookieParser() );
require( './admin/routes.js' )( app, settings ); // admin routes let file = path.join( __dirname + '/../webapp/main/dist/index.html' );
if ( settings.init ) {
require( './admin/adminRoutes.js' )( app, settings ); // admin routes
require( './backend/userRoutes.js' )( app, settings ); // user routes require( './backend/userRoutes.js' )( app, settings ); // user routes
} else {
require( './setup/setupRoutes.js' )( app, settings ); // setup routes
file = path.join( __dirname + '/../webapp/setup/dist/index.html' );
}
app.use( ( request, response ) => { app.use( ( request, response ) => {
response.sendFile( path.join( __dirname + '/../webapp/dist/index.html' ) ); response.sendFile( file );
} ); } );
const PORT = process.env.PORT || 8081; const PORT = process.env.PORT || 8081;
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"init": false, "init": true,
"twoFA": "enhanced", "twoFA": "enhanced",
"db": "mysql" "db": "mysql"
} }
+17
View File
@@ -0,0 +1,17 @@
/*
* libreevent - setupRoutes.js
*
* Created by Janis Hutz 07/18/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
module.exports = ( app, settings ) => {
/*
Admin login route that checks the password
*/
app.get( '/setup/start', ( request, response ) => {} );
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
View File
@@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
}
@@ -31,7 +31,7 @@
}, },
methods: { methods: {
submit () { submit () {
this.backendStore.addVisitedSetupPages( 'complete', true ); this.backendStore.addVisitedSetupPages( 'tos', true );
this.$router.push( '/setup/tos' ); this.$router.push( '/setup/tos' );
} }
}, },
+1 -1
View File
@@ -37,7 +37,7 @@
}, },
methods: { methods: {
submit () { submit () {
this.backendStore.addVisitedSetupPages( 'events', true ); this.backendStore.addVisitedSetupPages( 'payments', true );
this.$router.push( '/setup/payments' ); this.$router.push( '/setup/payments' );
} }
}, },
@@ -31,7 +31,7 @@
}, },
methods: { methods: {
submit () { submit () {
this.backendStore.addVisitedSetupPages( 'tos', true ); this.backendStore.addVisitedSetupPages( 'events', true );
this.$router.push( '/setup/events' ); this.$router.push( '/setup/events' );
} }
}, },
+1 -1
View File
@@ -46,7 +46,7 @@
}, },
methods: { methods: {
submit () { submit () {
this.backendStore.addVisitedSetupPages( 'payments', true ); this.backendStore.addVisitedSetupPages( 'page', true );
this.$router.push( 'page' ); this.$router.push( 'page' );
} }
}, },
@@ -14,7 +14,7 @@
<i style="font-size: small;">All links during setup open in separate tabs</i> <i style="font-size: small;">All links during setup open in separate tabs</i>
<p>Thank you for downloading libreǝvent, the free & open source event management solution. libreǝvent aims to help you save both time and money when hosting events, so you can focus on what really matters.</p> <p>Thank you for downloading libreǝvent, the free & open source event management solution. libreǝvent aims to help you save both time and money when hosting events, so you can focus on what really matters.</p>
<p>Let's start by setting it up. We strongly encourage you to also have a look at the extensive documentation of the setup process <a href="https://libreevent.janishutz.com/docs/setup/setup" target="_blank">here</a></p> <p>Let's start by setting it up. We strongly encourage you to also have a look at the extensive documentation of the setup process <a href="https://libreevent.janishutz.com/docs/setup/setup" target="_blank">here</a></p>
<router-link to="/setup/root" @click="setup();">Start setup</router-link> <button @click="setup();">Start setup</button>
</div> </div>
</template> </template>
@@ -33,7 +33,8 @@
}, },
methods: { methods: {
setup () { setup () {
this.backendStore.addVisitedSetupPages( 'page', true ); this.backendStore.addVisitedSetupPages( 'root', true );
this.$router.push( '/setup/root' );
} }
}, },
}; };
@@ -31,6 +31,7 @@
}, },
methods: { methods: {
submit () { submit () {
this.backendStore.addVisitedSetupPages( 'complete', true );
this.$router.push( '/setup/complete' ); this.$router.push( '/setup/complete' );
} }
}, },
+5 -4
View File
@@ -11,12 +11,13 @@
<div> <div>
<nav class="setup-nav"> <nav class="setup-nav">
<router-link to="/setup">Start</router-link> | <router-link to="/setup">Start</router-link> |
<router-link to="/setup/root" @click="unlock( 'page' )">Root account</router-link> | <router-link to="/setup/root" v-if="backendStore.getVisitedSetupPages[ 'root' ]">Root account</router-link>
<router-link to="/setup/page" v-if="backendStore.getVisitedSetupPages[ 'page' ]" @click="unlock( 'payments' )">Landing page</router-link> <a v-else class="inactive">Root account</a> |
<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' ]" @click="unlock( 'events' )">Payments</router-link> <router-link to="/setup/payments" v-if="backendStore.getVisitedSetupPages[ 'payments' ]">Payments</router-link>
<a v-else class="inactive">Payments</a> | <a v-else class="inactive">Payments</a> |
<router-link to="/setup/events" v-if="backendStore.getVisitedSetupPages[ 'events' ]" @click="unlock( 'tos' )">Events</router-link> <router-link to="/setup/events" v-if="backendStore.getVisitedSetupPages[ 'events' ]">Events</router-link>
<a v-else class="inactive">Events</a> | <a v-else class="inactive">Events</a> |
<router-link to="/setup/tos" v-if="backendStore.getVisitedSetupPages[ 'tos' ]" @click="unlock( 'complete' )">TOS</router-link> <router-link to="/setup/tos" v-if="backendStore.getVisitedSetupPages[ 'tos' ]" @click="unlock( 'complete' )">TOS</router-link>
<a v-else class="inactive">TOS</a> | <a v-else class="inactive">TOS</a> |