Clever Finance Management Tool
- Python (version 3.8 or above)
- Node.js and npm
- Pipenv
- Django
- React
-
Backend Setup
a. Clone the repository:
git clone git@github.com:neuromaxer/finance_manager.git cd finance_manager
b. Install dependencies using pipenv:
pipenv install
c. Activate the pipenv shell:
pipenv shell
d. Apply migrations:
cd finance_manager/ python manage.py migrate
e. Start the Django server:
python manage.py runserver
-
Frontend Setup
a. Navigate to the frontend directory:
cd ../frontend
b. Install required packages:
npm install
c. Start the React development server:
npm start
Over time, you might want to clean up or reset the database of trades. Follow the steps below to do this:
-
Delete the SQLite Database:
- If you're using the default SQLite database, simply delete the
db.sqlite3
file located in the root directory of your project.rm db.sqlite3
- If you're using the default SQLite database, simply delete the
-
Run Migrations Again:
- After deleting the SQLite database, you need to recreate the database structure.
python manage.py migrate
Remember to always backup important data before performing destructive operations on the database.
- After deleting the SQLite database, you need to recreate the database structure.
-
Launch Service:
- Launch all services
chmod +x run.sh ./run.sh
- Launch all services
-
Record Trades:
- On the web interface, fill in the details in the form: Symbol, Quantity, Price, Time, and Type (Buy/Sell).
- Click on "Submit" to record the trade.
-
View Trades and Open Positions:
- Below the form, you'll see two tables displaying all recorded trades and netted open positions.
- Use the "Refresh Data" button to update the tables if needed.
- Backend Tests: While inside the main
finance_manager
directory, runpython manage.py test
. - Frontend Tests: (If you have set up tests for React) Navigate to the
finance_manager/frontend
directory and runnpm test
.
For contributions, please create a new branch, implement your features or fixes, and submit a pull request.
MIT License