Skip to content
Snippets Groups Projects
Verified Commit b2d04ec2 authored by Miniontoby's avatar Miniontoby :writing_hand_tone1:
Browse files

Updated README and made the edit user actually work

With the edit user I coded it incorrectly and I hadn't checked it.
Now it works and also the update email will now tell you what has changed...
parent 9b95289f
No related branches found
No related tags found
No related merge requests found
......@@ -6,25 +6,28 @@ Sheet music, lyrics and more sharing web platform for churches and other live pe
## Idea/Roadmap
Web app for sharing the lyrics for the services
- You can then create teams
- Within team, owner can use the songs
- Lyrics as main item
- Add your own music sheets
- Even 'linking' them to the lyrics
- If the text is large, it scrolls to it
- Make recordings of yourself singing/playing it, so that the rest can practice (such as for the drummers, for example)
- With a practice 'view' (maybe)
- Add an liveview with a share key, like at Kahoot
- Allow the leader to control/scroll
- Add an remote API for external programs
- Add an integration with my SongTextProjector so that it would sync to the songtext on the screen
- And if we were to use this, the person controlling the projector would no longer have to ask which songs
- And no longer ask in which order
- [X] You can then create teams
- [X] Within team, owner can use the songs
- [X] Lyrics as main item
- [X] Add your own music sheets
- [X] Support commonly used ChordPro format
- [ ] Even 'linking' them to the lyrics
- [ ] If the text is large, it scrolls to it
- [ ] Make recordings of yourself singing/playing it, so that the rest can practice (such as for the drummers, for example)
- [ ] With a practice 'view' (maybe)
- [X] Add an liveview with a share key, like at Kahoot
- [ ] Allow the leader to control/scroll
- [ ] Add an remote API for external programs
- [ ] Add an integration with my SongTextProjector so that it would sync to the songtext on the screen
## Getting started
Here is a quick little guide to get you started.
I probably will be making releases so you can run the production version easier, but that will come later.
You can make your own one yourself and then upload the .tgz to your remote hosting. You will read that later.
### Cloning this code
......@@ -70,11 +73,10 @@ npm run dev -- --open
## Testing
For testing you need to create a few files in order to use authenticated routes.
~~For testing you need to create a few files in order to use authenticated routes.~~ (this still needs to be made...)
...
Afterwards, you can run:
To run the tests, you can run:
```bash
npm run test
......@@ -83,17 +85,46 @@ npm run test
## Building
To create a production version of your app:
To create a production version of the app, run:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
You can then preview the production build with `npm run preview`.
And you can run the production build using `npm start` or `node .` or `node ./productionServer/`
If you would like to only have the required (production) files on your remote host, then run this command after the build:
```bash
npm pack
```
This will produce a `praiselink-0.0.1.tgz` file that you can copy to your host, then unpack.
You can then use the `install_prod` script (`.bat` for windows and `.sh` for linux) to install the required deps
Then you can run the `npm run db:push` to make sure your database is created and up-to-date.
And if it is the first time, you should run `npm run db:seed`, this will allow you to make your account.
Then run the `start_prod` script (again `.bat` for windows and `.sh` for linux) and you should be good-to-go
You will need to add some arguments/variables in order to make it work:
```bash
HOST=your.domain.com PORT=3000 ./start_prod.sh
```
And if you use a reverse proxy to get rid of the port, then run:
```bash
HOST=your.domain.com PORT=3000 ORIGIN=https://your.domain.com ./start_prod.sh
```
Without the `ORIGIN` variable (that will be set to `http://{HOST}:{PORT}` if not specified), the POST requests, like login and such will NOT WORK!
This is because of some cors thingy sveltekit created. So make sure to set the ORIGIN variable! It will NOT work when put into the `.env` file, yet.
## Running in subfolder
You can run this web platform mounted in a subfolder,
......@@ -116,8 +147,8 @@ Then using the `npm run preview` or `npm start`, it will require you to use the
## Background information / Story
I, Miniontoby, am a christian and I help out at the Teenager church diensten
by controlling the computer for projecting the lyrics.
I, Miniontoby, am a christian and I help out at the Teenager church nights.
I do this by controlling the computer for projecting the lyrics.
It all started when I got a connection with the other person who used to control the computer for the beamer for the lyrics.
He always complained about the program we use for the lyrics presentation, that it is bad and slow.
......
......@@ -40,7 +40,12 @@ export const actions = {
return fail(400, { unique: true });
// This should make sure to check if something is changed
if ((origUser.email === email || origUser.name === name || origUser.roleId === roleId) && !(formData.data.password && formData.data.password !== ''))
const updates = {
email: origUser.email !== email,
name: origUser.name !== name,
roleId: origUser.role.id !== roleId,
}
if (!(Object.values(updates).find(u=>u===true)) && !(formData.data.password && formData.data.password !== ''))
return { success: true, edited: false, user: origUser };
const user = await User.edit(userId, email, roleId, name);
......@@ -52,8 +57,8 @@ export const actions = {
const info = await sendMail(
String(user.email),
'Account Updated', // Subject line
`Hello!\n\nYou are receiving this email because your account has been updated on PraiseLink.\n\n${(formData.data.password && formData.data.password !== '') ? `New Password: ${formData.data.password}\n\n` : ''}Login over at ${url}/login\n\nRegards,\nPraiseLink`, // plain text body
`Hello!<br><br>You are receiving this email because your account has been updated on PraiseLink.<br><br>${(formData.data.password && formData.data.password !== '') ? `<b>New Password:</b> ${formData.data.password}<br><br>` : ''}Login over at <a href="${url}/login">${url}/login</a><br><br>Regards,<br>PraiseLink`, // html body
`Hello!\n\nYou are receiving this email because your account has been updated on PraiseLink.\n\n${Object.entries(updates).filter(([k, v])=>v===true).map(([k])=>`New ${k}: ${user[k]}\n`)}${(formData.data.password && formData.data.password !== '') ? `New Password: ${formData.data.password}\n` : ''}\nLogin over at ${url}/login\n\nRegards,\nPraiseLink`, // plain text body
`Hello!<br><br>You are receiving this email because your account has been updated on PraiseLink.<br><br>${Object.entries(updates).filter(([k, v])=>v===true).map(([k])=>`<b>New ${k}</b>: ${user[k]}<br>`)}${(formData.data.password && formData.data.password !== '') ? `<b>New Password:</b> ${formData.data.password}<br>` : ''}<br>Login over at <a href="${url}/login">${url}/login</a><br><br>Regards,<br>PraiseLink`, // html body
);
if (info)
console.log("Message sent: %s", info.messageId);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment