A simple web app for storing and splitting receipts in a sharehouse
Note. This document is still a work in progress and may be missing sections or steps.
- Receipt tracking and history
- Payment tracking and history
- Email and Push notifications
- Automatic cost distribution
- Distribution offsets
- Automatic debt balancing
- Password authentication
- Clean and minimalistic UI
- Mobile optimized
- Rich JSON REST API
- JWT session management
- Easy configuration via .env file
- Light and dark themes
- Spending statistics
- Setup script
- Progressive Web App support
- Docker deployment option
Name | Description |
---|---|
bcrypt | Password-hashing library |
Express | Back-end web app framework |
Knex.js | SQL query builder |
MySQL | Relational database management system |
Node.js | Back-end JavaScript runtime environment |
Nodemailer | Node library for sending e-mails |
React | JavaScript library for building user interfaces |
reactstrap | React component library for Bootstrap |
web-push | Node library for sending push notifications |
For this simple deployment, we will use nginx as a reverse proxy as well as to serve the front-end client. Additionally we will use the pm2 node package to serve the api. Tested on Ubuntu 21.10.
sudo apt update
sudo apt install nodejs nginx mysql-server
npm install pm2 -g
git clone https://github.com/JaydenGrubb1/sharehouse.git
cd sharehouse
node server/gen-vapid.js
Example output:
{
publicKey: 'BIqoBJhEX9Exp9XOUu1lsB6MNti_Wz_6p0OB5WRowD9NebjIiixltxmBYzWzoLQemuqYmaRvU7QiW9e0-AK2Jrk'
privateKey: 'PeIapvjJO2VMEkoFbi95gtPo3kF0YcrNYY0_Yr_xVm4'
}
cp docs/example.env server/.env
nano server/.env
Change the values of the variables in the .env
file as needed, using the comments as a guide.
cd server
npm install --production
sudo pm2 start "npm run production" --name "api"
sudo pm2 save
cd ../
You can test if the back-end is running and working by going to the test page in your browser. By default this can be found at http://localhost:3001/test
Example output in browser:
{
"error": false,
"message": "Test completed succesfully at 3/1/2022, 7:23:34 AM"
}
cd client
npm install --production
npm run build
cd ../
mkdir /var/www/sharehouse
mv client/build /var/www/sharehouse/html
sudo systemctl restart nginx
coming soon...