https://github.com/nuanv/expense-tracker
A fullstack website to track your daily expenses
https://github.com/nuanv/expense-tracker
docker expense-tracker expressjs mern-stack mongodb tailwindcss typescript webapp
Last synced: 3 months ago
JSON representation
A fullstack website to track your daily expenses
- Host: GitHub
- URL: https://github.com/nuanv/expense-tracker
- Owner: nuanv
- Created: 2024-05-13T12:52:37.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-18T03:57:17.000Z (over 1 year ago)
- Last Synced: 2025-01-18T04:34:54.881Z (over 1 year ago)
- Topics: docker, expense-tracker, expressjs, mern-stack, mongodb, tailwindcss, typescript, webapp
- Language: TypeScript
- Homepage: https://expense-tracker-phi-cyan.vercel.app/
- Size: 1.32 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## ExpenseTracker - Getting Started
1. Clone the repository from GitHub:
```sh
git clone https://github.com/nuanv/Expense-Tracker.git
```
2. To Install the necessary dependencies navigate to backend and frontend directories and run:
```sh
npm install
```
4. Define your MONGO_URL in /backend/.env:
```env
MONGO_URL=
```
5. Start the backend and frontend:
```sh
/backend > npm start
/frontend > npm run dev
```
## Running Docker Containers
### Representation
```sql
+---------------------+
| frontend Container |
|---------------------|
| Runs Vite on port |
| 3000 inside the |
| container |
|---------------------|
| Connects to |
| backend:8000 |
| via app-network |
+---------------------+
|
Communicates over `app-network`
v
+---------------------+
| backend Container |
|---------------------|
| Runs Express.js on |
| port 8000 inside |
| the container |
|---------------------|
| Connects to |
| MongoDB via |
| MONGO_URL (network)|
+---------------------+
|
Communicates over `app-network`
v
+---------------------+
| MongoDB Server |
| (External service) |
|---------------------|
| Accessed using |
| a connection URL |
+---------------------+
```
### Start Docker Engine
1. In docker-compose.yml provide the MONGO_URL
```yml
environment:
- MONGO_URL=
```
2. Run docker compose
```sh
docker compose up --build
```
### Notes
- **`frontend` container**:
- Built from `frontend/Dockerfile`.
- Port `3000` inside the container maps to `localhost:3000` on the host.
- Depends on the `backend` service.
- **`backend` container**:
- Built from `backend/Dockerfile`.
- Port `8000` inside the container maps to `localhost:8000` on the host.
- CORS configured to allow `frontend` service communication.
- Both containers use `app-network` for internal communication (via service names like `backend` or `frontend`).
- MongoDB is external (could also be another container if specified). Accessed via `MONGO_URL` defined in the environment.