You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+51-6Lines changed: 51 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,14 @@ Easy Invoice is a modern, user-friendly web application that demonstrates the po
14
14
### Prerequisites
15
15
16
16
- Node.js 18+
17
+
18
+
- It is recommended to use `nvm` (Node Version Manager) to install and manage your Node.js versions. You can install `nvm` from [here](https://github.com/nvm-sh/nvm) and then run the following commands:
19
+
20
+
```bash
21
+
$ nvm install 18
22
+
$ nvm use 18
23
+
```
24
+
17
25
- PostgreSQL database
18
26
- Google OAuth credentials (for authentication)
19
27
- Request Network API key
@@ -51,15 +59,31 @@ cp .env.example .env
51
59
52
60
### Installation
53
61
54
-
1. Install dependencies:
62
+
#### 1. Install Dependencies
55
63
56
64
```bash
57
65
npm install
58
66
# or
59
67
yarn install
60
68
```
61
69
62
-
2. Set up the database:
70
+
#### 2. Start the Development Server
71
+
72
+
This command runs the Easy Invoice Next.js app (frontend and backend) and starts the PostgreSQL database container.
73
+
74
+
```bash
75
+
npm run dev
76
+
# or
77
+
yarn dev
78
+
```
79
+
80
+
> **Note:** If the PostgreSQL database container does not exist, it will be created automatically when you start the development server.
81
+
82
+
The application will be available at [http://localhost:3000](http://localhost:3000).
83
+
84
+
#### 3. Set Up the Database
85
+
86
+
> **Note:** Ensure the database container is running before interacting with the database. The container starts automatically when you run `npm run dev` or `yarn dev`.
63
87
64
88
```bash
65
89
# For development:
@@ -75,15 +99,36 @@ yarn db:generate
75
99
yarn db:migrate
76
100
```
77
101
78
-
3. Start the development server:
102
+
### Development
103
+
104
+
#### Access the Database with Drizzle Studio
105
+
106
+
You can use Drizzle Studio to inspect and manage your PostgreSQL database:
79
107
80
108
```bash
81
-
npm run dev
109
+
npm run db:studio
82
110
# or
83
-
yarn dev
111
+
yarn db:studio
84
112
```
85
113
86
-
The application will be available at [http://localhost:3000](http://localhost:3000).
114
+
Drizzle Studio runs on port `4983` by default. If you see an error like `Error: listen EADDRINUSE: address already in use 127.0.0.1:4983`, it means the port is already in use (possibly by another Drizzle Studio instance). You can specify a different port:
115
+
116
+
```bash
117
+
npm run db:studio -- --port=4984
118
+
# or
119
+
yarn db:studio --port=4984
120
+
```
121
+
122
+
#### Resetting the Database for Development
123
+
124
+
The PostgreSQL database container stores its data in the `./dev/postgres-data` directory (mounted as a volume).
125
+
126
+
To fully reset the database:
127
+
128
+
1.**Delete the PostgreSQL container.**
129
+
2.**Delete the `./dev/postgres-data` directory.**
130
+
131
+
This will remove all persisted data and ensure a fresh database instance is created on the next startup.
0 commit comments