mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
prepare for a simpler installation method. Still missing config adjustments (i.e. adjusting how the config is loaded)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -24,5 +24,6 @@ node_modules
|
|||||||
*.synctex.gz
|
*.synctex.gz
|
||||||
*.fdb_latexmk
|
*.fdb_latexmk
|
||||||
._wordcount_selection.tex
|
._wordcount_selection.tex
|
||||||
|
/*.zip
|
||||||
|
|
||||||
AppMarketing
|
AppMarketing
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "libreevent",
|
"name": "libreevent",
|
||||||
"version": "1.0.7",
|
"version": "1.1.0",
|
||||||
"description": "A free and open source event management solution",
|
"description": "A free and open source event management solution",
|
||||||
"main": "/dist/app.js",
|
"main": "/dist/app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
12
package.sh
12
package.sh
@@ -6,7 +6,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
v="V1.0.7"
|
v="V1.1.0"
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
_ _ _ _
|
_ _ _ _
|
||||||
@@ -154,8 +154,12 @@ zip -9r libreevent-$v-full-icu.zip src/server/package.json src/server/package-lo
|
|||||||
cd src/server
|
cd src/server
|
||||||
npm uninstall full-icu
|
npm uninstall full-icu
|
||||||
|
|
||||||
cd ../../
|
cd ../../dist
|
||||||
rm -rf dist
|
cp ../README.md .
|
||||||
|
|
||||||
|
ls
|
||||||
|
|
||||||
|
# rm -rf dist
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
|
|
||||||
@@ -177,5 +181,7 @@ echo "
|
|||||||
Next steps:
|
Next steps:
|
||||||
- Check that everything was packaged correctly
|
- Check that everything was packaged correctly
|
||||||
- Create a release on GitHub
|
- Create a release on GitHub
|
||||||
|
- Run 'cd dist && npm publish'
|
||||||
|
- Delete all newly spawned files
|
||||||
|
|
||||||
"
|
"
|
||||||
16
simple/index.js
Normal file
16
simple/index.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* libreevent - index.js
|
||||||
|
*
|
||||||
|
* Created by Janis Hutz 08/26/2024, Licensed under the GPL V3 License
|
||||||
|
* https://janishutz.com, development@janishutz.com
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
This file is a wrapper for the npm package
|
||||||
|
*/
|
||||||
|
|
||||||
|
const libreevent = require( 'libreevent' );
|
||||||
|
|
||||||
|
libreevent.run();
|
||||||
23
simple/package.json
Normal file
23
simple/package.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"name": "libreevent-simple",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Simplify libreevent's install using the npm package",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/janishutz/libreevent.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"libreevent",
|
||||||
|
"simple"
|
||||||
|
],
|
||||||
|
"author": "Janis Hutz",
|
||||||
|
"license": "GPL-3.0-or-later",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/janishutz/libreevent/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://libreevent.janishutz.com"
|
||||||
|
}
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
/*
|
|
||||||
* libreevent - app.js
|
|
||||||
*
|
|
||||||
* Created by Janis Hutz 02/26/2023, Licensed under the GPL V3 License
|
|
||||||
* https://janishutz.com, development@janishutz.com
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
const express = require( 'express' );
|
|
||||||
let app = express();
|
|
||||||
const path = require( 'path' );
|
|
||||||
const expressSession = require( 'express-session' );
|
|
||||||
const cookieParser = require( 'cookie-parser' );
|
|
||||||
const http = require( 'http' );
|
|
||||||
const fs = require( 'fs' );
|
|
||||||
const token = require( './backend/token.js' );
|
|
||||||
|
|
||||||
console.log( `
|
|
||||||
|
|
||||||
_ _ _ _
|
|
||||||
| (_) | | |
|
|
||||||
| |_| |__ _ __ ___ _____ _____ _ __ | |_
|
|
||||||
| | | '_ \\| '__/ _ \\/ _ \\ \\ / / _ \\ '_ \\| __|
|
|
||||||
| | | |_) | | | __/ __/\\ V / __/ | | | |_
|
|
||||||
|_|_|_.__/|_| \\___|\\___| \\_/ \\___|_| |_|\\__|
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-------------------------------
|
|
||||||
|
|
||||||
==> Welcome to libreevent!
|
|
||||||
|
|
||||||
|
|
||||||
==> You are running Version V1.0.0
|
|
||||||
|
|
||||||
Below you can see all important things that happen during operation.
|
|
||||||
libreevent logs all errors in the console such that they appear in the
|
|
||||||
log files when running it with an output pipe (which you should definitely do)
|
|
||||||
|
|
||||||
To do this run the following command when starting libreevent:
|
|
||||||
'node app.js > libreevent_log.txt'
|
|
||||||
|
|
||||||
` );
|
|
||||||
|
|
||||||
console.log( '[ Server ] loading settings' );
|
|
||||||
const settings = JSON.parse( fs.readFileSync( path.join( __dirname + '/config/settings.config.json' ) ) );
|
|
||||||
|
|
||||||
|
|
||||||
// Route for static html file for start page (page is compiled using
|
|
||||||
// Vue SSR and gets its support files (e.g. CSS and JS files) from
|
|
||||||
// the /home/supportFiles/:file route plus its assets from the /otherAssets/:file
|
|
||||||
// route).
|
|
||||||
if ( settings.setupDone ) {
|
|
||||||
app.get( '/', ( req, res ) => {
|
|
||||||
res.sendFile( path.join( __dirname + '/ui/home/active/en/index.html' ) );
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Set up static routes for static file serving (performance wise not
|
|
||||||
// that good, but way easier to set up)
|
|
||||||
console.log( '[ Server ] Setting up static routes' );
|
|
||||||
if ( settings.setupDone ) {
|
|
||||||
app.use( express.static( 'webapp/main/dist' ) );
|
|
||||||
} else {
|
|
||||||
app.use( express.static( 'webapp/setup/dist' ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
// initialise express with middlewares
|
|
||||||
console.log( '[ Server ] loading and initializing middlewares' );
|
|
||||||
app.use( expressSession( {
|
|
||||||
secret: token.generateToken( 60 ),
|
|
||||||
resave: false,
|
|
||||||
saveUninitialized: true,
|
|
||||||
cookie: {
|
|
||||||
sameSite: 'none',
|
|
||||||
httpOnly: true,
|
|
||||||
secure: false,
|
|
||||||
}
|
|
||||||
} ) );
|
|
||||||
|
|
||||||
app.use( cookieParser() );
|
|
||||||
|
|
||||||
let file = path.join( __dirname + '/webapp/main/dist/index.html' );
|
|
||||||
|
|
||||||
if ( settings.setupDone ) {
|
|
||||||
console.log( '[ Server ] loading backend components' );
|
|
||||||
require( './backend/helperRoutes.js' )( app, settings ); // Helper routes
|
|
||||||
require( './admin/adminRoutes.js' )( app, settings ); // admin routes
|
|
||||||
require( './admin/adminAPIRoutes.js' )( app, settings ); // admin api routes
|
|
||||||
require( './admin/appApiRoutes.js' )( app, settings ); // app api routes
|
|
||||||
require( './backend/userAPIRoutes.js' )( app, settings ); // user api routes
|
|
||||||
require( './backend/userRoutes.js' )( app, settings ); // user routes
|
|
||||||
require( './backend/payments/paymentRoutes.js' )( app, settings ); // payment routes
|
|
||||||
require( './backend/plugins/pluginLoader.js' )( app, settings ); // plugin loader
|
|
||||||
} else {
|
|
||||||
console.log( '[ Setup ] Loading setup routes' );
|
|
||||||
require( './setup/setupRoutes.js' )( app, settings ); // setup routes
|
|
||||||
file = path.join( __dirname + '/webapp/setup/dist/index.html' );
|
|
||||||
}
|
|
||||||
|
|
||||||
// handling of any unknown route. Returns the SPA index.html file which
|
|
||||||
// initiates loading of the SPA
|
|
||||||
app.use( ( request, response ) => {
|
|
||||||
response.sendFile( file );
|
|
||||||
} );
|
|
||||||
|
|
||||||
console.log( '\n\n[ Server ] loading complete!\n\n' );
|
|
||||||
|
|
||||||
const PORT = process.env.PORT || 8080;
|
|
||||||
console.log( '[ Server ] listening on port ' + PORT );
|
|
||||||
http.createServer( app ).listen( PORT );
|
|
||||||
116
src/server/index.js
Normal file
116
src/server/index.js
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
/*
|
||||||
|
* libreevent - app.js
|
||||||
|
*
|
||||||
|
* Created by Janis Hutz 02/26/2023, Licensed under the GPL V3 License
|
||||||
|
* https://janishutz.com, development@janishutz.com
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
const express = require( 'express' );
|
||||||
|
let app = express();
|
||||||
|
const path = require( 'path' );
|
||||||
|
const expressSession = require( 'express-session' );
|
||||||
|
const cookieParser = require( 'cookie-parser' );
|
||||||
|
const http = require( 'http' );
|
||||||
|
const fs = require( 'fs' );
|
||||||
|
const token = require( './backend/token.js' );
|
||||||
|
|
||||||
|
module.exports.run = () => {
|
||||||
|
console.log( `
|
||||||
|
|
||||||
|
_ _ _ _
|
||||||
|
| (_) | | |
|
||||||
|
| |_| |__ _ __ ___ _____ _____ _ __ | |_
|
||||||
|
| | | '_ \\| '__/ _ \\/ _ \\ \\ / / _ \\ '_ \\| __|
|
||||||
|
| | | |_) | | | __/ __/\\ V / __/ | | | |_
|
||||||
|
|_|_|_.__/|_| \\___|\\___| \\_/ \\___|_| |_|\\__|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
==> Welcome to libreevent!
|
||||||
|
|
||||||
|
|
||||||
|
==> You are running Version V1.0.0
|
||||||
|
|
||||||
|
Below you can see all important things that happen during operation.
|
||||||
|
libreevent logs all errors in the console such that they appear in the
|
||||||
|
log files when running it with an output pipe (which you should definitely do)
|
||||||
|
|
||||||
|
To do this run the following command when starting libreevent:
|
||||||
|
'node app.js > libreevent_log.txt'
|
||||||
|
|
||||||
|
` );
|
||||||
|
|
||||||
|
console.log( '[ Server ] loading settings' );
|
||||||
|
const settings = JSON.parse( fs.readFileSync( path.join( __dirname + '/config/settings.config.json' ) ) );
|
||||||
|
|
||||||
|
|
||||||
|
// Route for static html file for start page (page is compiled using
|
||||||
|
// Vue SSR and gets its support files (e.g. CSS and JS files) from
|
||||||
|
// the /home/supportFiles/:file route plus its assets from the /otherAssets/:file
|
||||||
|
// route).
|
||||||
|
if ( settings.setupDone ) {
|
||||||
|
app.get( '/', ( req, res ) => {
|
||||||
|
res.sendFile( path.join( __dirname + '/ui/home/active/en/index.html' ) );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Set up static routes for static file serving (performance wise not
|
||||||
|
// that good, but way easier to set up)
|
||||||
|
console.log( '[ Server ] Setting up static routes' );
|
||||||
|
if ( settings.setupDone ) {
|
||||||
|
app.use( express.static( 'webapp/main/dist' ) );
|
||||||
|
} else {
|
||||||
|
app.use( express.static( 'webapp/setup/dist' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// initialise express with middlewares
|
||||||
|
console.log( '[ Server ] loading and initializing middlewares' );
|
||||||
|
app.use( expressSession( {
|
||||||
|
secret: token.generateToken( 60 ),
|
||||||
|
resave: false,
|
||||||
|
saveUninitialized: true,
|
||||||
|
cookie: {
|
||||||
|
sameSite: 'none',
|
||||||
|
httpOnly: true,
|
||||||
|
secure: false,
|
||||||
|
}
|
||||||
|
} ) );
|
||||||
|
|
||||||
|
app.use( cookieParser() );
|
||||||
|
|
||||||
|
let file = path.join( __dirname + '/webapp/main/dist/index.html' );
|
||||||
|
|
||||||
|
if ( settings.setupDone ) {
|
||||||
|
console.log( '[ Server ] loading backend components' );
|
||||||
|
require( './backend/helperRoutes.js' )( app, settings ); // Helper routes
|
||||||
|
require( './admin/adminRoutes.js' )( app, settings ); // admin routes
|
||||||
|
require( './admin/adminAPIRoutes.js' )( app, settings ); // admin api routes
|
||||||
|
require( './admin/appApiRoutes.js' )( app, settings ); // app api routes
|
||||||
|
require( './backend/userAPIRoutes.js' )( app, settings ); // user api routes
|
||||||
|
require( './backend/userRoutes.js' )( app, settings ); // user routes
|
||||||
|
require( './backend/payments/paymentRoutes.js' )( app, settings ); // payment routes
|
||||||
|
require( './backend/plugins/pluginLoader.js' )( app, settings ); // plugin loader
|
||||||
|
} else {
|
||||||
|
console.log( '[ Setup ] Loading setup routes' );
|
||||||
|
require( './setup/setupRoutes.js' )( app, settings ); // setup routes
|
||||||
|
file = path.join( __dirname + '/webapp/setup/dist/index.html' );
|
||||||
|
}
|
||||||
|
|
||||||
|
// handling of any unknown route. Returns the SPA index.html file which
|
||||||
|
// initiates loading of the SPA
|
||||||
|
app.use( ( request, response ) => {
|
||||||
|
response.sendFile( file );
|
||||||
|
} );
|
||||||
|
|
||||||
|
console.log( '\n\n[ Server ] loading complete!\n\n' );
|
||||||
|
|
||||||
|
const PORT = process.env.PORT || 8080;
|
||||||
|
console.log( '[ Server ] listening on port ' + PORT );
|
||||||
|
http.createServer( app ).listen( PORT );
|
||||||
|
}
|
||||||
4
src/server/package-lock.json
generated
4
src/server/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "libreevent",
|
"name": "libreevent",
|
||||||
"version": "1.0.7",
|
"version": "1.1.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "libreevent",
|
"name": "libreevent",
|
||||||
"version": "1.0.7",
|
"version": "1.1.0",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pdfme/generator": "^1.2.6",
|
"@pdfme/generator": "^1.2.6",
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "libreevent",
|
"name": "libreevent",
|
||||||
"version": "1.0.7",
|
"version": "1.1.0",
|
||||||
"description": "Free & Open source event management solution",
|
"description": "Free & Open source event management solution",
|
||||||
"main": "app.js",
|
"main": "index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
"doc": "docs"
|
"doc": "docs"
|
||||||
},
|
},
|
||||||
|
|||||||
4
src/webapp/main/package-lock.json
generated
4
src/webapp/main/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "libreevent",
|
"name": "libreevent",
|
||||||
"version": "1.0.7",
|
"version": "1.1.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "libreevent",
|
"name": "libreevent",
|
||||||
"version": "1.0.7",
|
"version": "1.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pdfme/generator": "^1.2.3",
|
"@pdfme/generator": "^1.2.3",
|
||||||
"@pdfme/ui": "^3.2.1",
|
"@pdfme/ui": "^3.2.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "libreevent",
|
"name": "libreevent",
|
||||||
"version": "1.0.7",
|
"version": "1.1.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --host",
|
"dev": "vite --host",
|
||||||
|
|||||||
4
src/webapp/setup/package-lock.json
generated
4
src/webapp/setup/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "libreevent-setup",
|
"name": "libreevent-setup",
|
||||||
"version": "1.0.7",
|
"version": "1.1.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "libreevent-setup",
|
"name": "libreevent-setup",
|
||||||
"version": "1.0.7",
|
"version": "1.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pinia": "^2.1.3",
|
"pinia": "^2.1.3",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.3.4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "libreevent-setup",
|
"name": "libreevent-setup",
|
||||||
"version": "1.0.7",
|
"version": "1.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
Reference in New Issue
Block a user