Skip to content

Commit 18acbb1

Browse files
authored
docs: update installation instructions and add database management details (#99)
1 parent 069b8aa commit 18acbb1

File tree

1 file changed

+51
-6
lines changed

1 file changed

+51
-6
lines changed

README.md

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ Easy Invoice is a modern, user-friendly web application that demonstrates the po
1414
### Prerequisites
1515

1616
- 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+
1725
- PostgreSQL database
1826
- Google OAuth credentials (for authentication)
1927
- Request Network API key
@@ -51,15 +59,31 @@ cp .env.example .env
5159

5260
### Installation
5361

54-
1. Install dependencies:
62+
#### 1. Install Dependencies
5563

5664
```bash
5765
npm install
5866
# or
5967
yarn install
6068
```
6169

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`.
6387
6488
```bash
6589
# For development:
@@ -75,15 +99,36 @@ yarn db:generate
7599
yarn db:migrate
76100
```
77101

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:
79107

80108
```bash
81-
npm run dev
109+
npm run db:studio
82110
# or
83-
yarn dev
111+
yarn db:studio
84112
```
85113

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.
87132

88133
## 🏗️ Tech Stack
89134

0 commit comments

Comments
 (0)