|
1 | 1 | # Billy
|
2 | 2 | A MERN stack application created to maintain my expenses.
|
3 | 3 |
|
4 |
| -### Features |
5 |
| -- Create new expenses |
6 |
| -- View expenses |
7 |
| -- Edit expenses |
8 |
| -- Delete expenses |
9 |
| -- View basic statistics about expenses |
| 4 | +# Features |
| 5 | +- Expenses |
| 6 | + - Title, amount, category, date, group, and description attributes |
| 7 | + - Sort by attribute |
| 8 | + - Search by title |
| 9 | +- Groups |
| 10 | + - Group expenses together i.e. by card or bank account |
| 11 | + - View group distributions for the month and year on the dashboard |
10 | 12 |
|
11 |
| -### Installing |
| 13 | +# Usage |
| 14 | +## Installing |
12 | 15 | 1. Clone the repository
|
13 |
| -2. Place a `.env` file in the root project folder with the following environment variables: |
14 |
| - - MONGODB_URI=<mongodb url> |
15 |
| - - JWT_ACCESS_SECRET=<your secret key> |
16 |
| - - JWT_REFRESH_SECRET=<your secret key> |
17 |
| -3. Run `npm install` in the root project folder. |
18 |
| -4. Install nodemon with `npm install -g nodemon` |
19 |
| -5. Run `npm run auth` to start authentication server |
20 |
| -6. Run `npm run express` to start the express API server |
21 |
| -7. Run `npm run client` to start the react app |
22 |
| -8. Navigate to (http://localhost:3000) in your browser to use the application |
| 16 | +2. Place a `.env` file in _backend/_ with the following environment variables: |
| 17 | + - MONGODB_URI=[_mongodb uri_] |
| 18 | + - JWT_ACCESS_SECRET=[_secret for access tokens_] |
| 19 | + - JWT_REFRESH_SECRET=[_secret for refresh tokens_] |
| 20 | +3. Place a `.env` file in _backend/_ with the following environment variables: |
| 21 | + - REACT_APP_AUTH_URL=[_url for auth server (e.g. http://localhost:3000)_] |
| 22 | + - REACT_APP_API_URL=[_url for api server (e.g. http://localhost:4000)_] |
| 23 | +4. Run `npm install` in the _backend/_. |
| 24 | +5. Run `npm install` in the _frontend/_. |
| 25 | + |
| 26 | +## Running |
| 27 | + |
| 28 | +### Development |
| 29 | +1. Open a new terminal in _backend/_ and run `npm run auth`. |
| 30 | +2. Open a new terminal in _backend/_ and run `npm run express`. |
| 31 | +3. If you are on Linux/MacOS: |
| 32 | + - Open _frontend/package.json_ |
| 33 | + - Under `scripts`, edit `start` to be |
| 34 | + ``` |
| 35 | + "start": "PORT=5000 react-script start", |
| 36 | + ``` |
| 37 | +3. Open a new terminal in _frontend/_ and run `npm start`. |
| 38 | + |
| 39 | + |
| 40 | +### Production |
| 41 | +1. Open the terminal |
| 42 | +2. Install pm2 by running `npm install -g pm2` |
| 43 | +3. Navigate to _backend/_ |
| 44 | +4. Start the authentication server by running `sudo pm2 start authServer.js --name auth` |
| 45 | +5. Start the API server by running `sudo pm2 start app.js --name api` |
| 46 | +6. Navigate to _frontend/_ |
| 47 | +7. Build a production version of the react-app by running `npm run build` |
| 48 | +8. Start the react-app by running `sudo pm2 serve build 5000 --spa --name client` |
0 commit comments