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
+24-53Lines changed: 24 additions & 53 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ This is a full-fledged User Authentication app created using Express, TypeORM, P
2
2
3
3
Here is the list of APIs this app contains:"
4
4
5
-
<imgsrc="images/docs.png">
5
+
<imgsrc="images/api-docs.png">
6
6
7
7
# Project Setup and Local Run Guide
8
8
@@ -18,11 +18,12 @@ Below is a summary of key features and instructions for running the project:
18
18
2. TypeORM for database interactions.
19
19
3. Passport for authentication strategies.
20
20
4. Swagger for API documentation.
21
+
5. Docker desktop
21
22
22
23
### Development Tools:
23
24
24
25
1. Nodemon for automatic server restart during development.
25
-
2. ts-node for running TypeScript files directly.
26
+
2.`ts-node` for running `TypeScript` files directly.
26
27
3. Concurrently for running multiple npm scripts concurrently.
27
28
4. Database Migrations:
28
29
@@ -35,6 +36,7 @@ Before getting started, ensure that you have the following installed on your mac
35
36
36
37
- Node.js: [Download and Install Node.js](https://nodejs.org/)
37
38
- npm (Node Package Manager): Included with Node.js installation
39
+
- Docker Desktop
38
40
39
41
## Project Setup
40
42
@@ -52,59 +54,30 @@ Before getting started, ensure that you have the following installed on your mac
52
54
cd mysql-express-node-auth-app
53
55
```
54
56
55
-
3.**Install Dependencies:**
56
-
Install project dependencies by running:
57
-
58
-
```bash
59
-
npm install
60
-
```
61
-
62
57
## Running the Project Locally
63
58
64
-
### Development Mode
65
-
66
-
To run the project in development mode with automatic restart on file changes, execute the following command:
67
-
59
+
### 1. Change the file permissions `run.sh` to make it executable
68
60
```bash
69
-
npm run dev
61
+
chmod +x run.sh
70
62
```
71
63
72
-
This command uses `nodemon` to watch for changes in the `src` directory and automatically restarts the server.
73
-
74
-
### Production Mode
75
-
76
-
To start the project in production mode, use:
77
-
64
+
### 2. copy the `.env.example` file and make new `.env` file
78
65
```bash
79
-
npm start
66
+
./run.sh env
80
67
```
81
68
82
-
### Swagger Documentation
83
-
84
-
To generate Swagger documentation, use the following command:
85
-
69
+
### 3. Start the project. Below command will pull the MySQL, Node images, install the dependencies.
86
70
```bash
87
-
npm run swagger
71
+
./run.sh start
88
72
```
73
+
once docker containers are up and running project is accessable `http://localhost:8000/docs`. This is the Swagger UI which will list all the API endpoints.
89
74
90
-
This command generates Swagger specs based on your TypeScript code.
91
-
92
-
## Database Migrations
93
-
94
-
The project includes commands for managing database migrations using TypeORM.
95
-
96
-
-**Create a Migration:**
97
-
98
-
```bash
99
-
npm run migration:create
100
-
```
101
-
102
-
-**Generate a Migration:**
103
-
104
-
```bash
105
-
npm run migration:generate
106
-
```
75
+
### 4. Go inside app container.
76
+
```bash
77
+
./run.sh bash
78
+
```
107
79
80
+
Once you are inside the docker container you can run the below commands. These commands are for managing database migrations using TypeORM.
108
81
-**Run Migrations:**
109
82
110
83
```bash
@@ -116,19 +89,17 @@ The project includes commands for managing database migrations using TypeORM.
116
89
```bash
117
90
npm run migration:down
118
91
```
92
+
-**Create a Migration:**
119
93
120
-
## Additional Notes
121
-
122
-
-**Environment Variables:**
123
-
Create a `.env` file in the project root with the necessary environment variables. You can refer to the provided `.env.example` file for guidance.
124
-
125
-
-**Swagger UI:**
126
-
Access the Swagger UI at `http://localhost:8000/docs` to interact with the API documentation.
94
+
```bash
95
+
npm run migration:create
96
+
```
127
97
128
-
-**Concurrent Commands:**
129
-
The `concurrently` package allows you to run multiple npm scripts concurrently. This is utilized in the `npm run dev` command.
98
+
-**Generate a Migration:**
130
99
131
-
---
100
+
```bash
101
+
npm run migration:generate
102
+
```
132
103
133
104
Now you should have the "mysql-express-node-auth-app" project up and running locally. If you encounter any issues, please refer to the project documentation or seek assistance from the project's maintainers.
0 commit comments