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
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@
5
5
# Real Dev Squad API
6
6
7
7
<!-- TABLE OF CONTENTS -->
8
+
8
9
## Table of Contents
9
10
10
11
-[About the Project](#about-the-project)
@@ -14,16 +15,19 @@
14
15
-[CONTRIBUTING](CONTRIBUTING.md)
15
16
16
17
## About the Project
18
+
17
19
This Project serves the backend APIs required for [Real Dev Squad](https://realdevsquad.com/) web projects. This project is built in [Express.js](https://expressjs.com/).
18
20
19
21
## Prerequisites
22
+
20
23
- The application uses [node-config](https://github.com/lorenwest/node-config)([documentation](https://github.com/lorenwest/node-config/wiki/Configuration-Files)) for managing config.
21
24
- Create a new file: `config/local.js`. Override the required config values from `config/development.js` and `config/default.js` into `config/local.js`.
22
25
- Register the application for [GitHub OAuth](https://docs.github.com/en/developers/apps/creating-an-oauth-app) to get the `clientId` and `clientSecret`. Add the callback URL as `http://<HOSTNAME>:<PORT>/auth/github/callback`
23
-
- Create an application on [FireStore](https://firebase.google.com/docs/firestore) and [generate a service file](https://cloud.google.com/iam/docs/creating-managing-service-account-keys). Add the service file credentials in the local config (or your env variables) as a string (don't forget to escape the newlinein private_key)
26
+
- Create an application on [FireStore](https://firebase.google.com/docs/firestore) and [generate a service file](https://cloud.google.com/iam/docs/creating-managing-service-account-keys). Add the service file credentials in the local config (or your env variables) as a string. Make sure you convert all the escape sequence (newline) - `\n` with `\\n`in private_key field.
24
27
- For running the project locally, [Firebase Local Emulator Suite](https://firebase.google.com/docs/emulator-suite) can also be used instead of using the remote DB. Steps for setting it up: [CONTRIBUTING.md - Using Firebase Emulator Locally](https://github.com/Real-Dev-Squad/website-backend/blob/develop/CONTRIBUTING.md#using-firebase-emulator-locally)
@@ -33,13 +37,15 @@ To install Volta, please follow the [process](https://docs.volta.sh/guide/gettin
33
37
### Local Development Setup
34
38
35
39
Install all the packages using the following command:
40
+
36
41
```shell
37
42
yarn
38
43
```
39
44
40
45
#### Confirm correct configuration setup
41
46
42
47
This command should be successful, before moving to development.
48
+
43
49
```shell
44
50
yarn validate-setup
45
51
```
@@ -55,29 +61,40 @@ Run TDD in watch mode. Exiting this command will print the coverage report. Try
55
61
```shell
56
62
yarn tdd:watch
57
63
```
64
+
58
65
#### Running a server in Dev mode
66
+
59
67
```shell
60
68
yarn dev
61
69
```
70
+
62
71
## What happens in production:
72
+
63
73
- Install packages
74
+
64
75
```
65
-
yarn
76
+
yarn
66
77
```
78
+
67
79
- Run tests
80
+
68
81
```
69
82
yarn run test
70
83
```
84
+
71
85
- Prune dev dependencies
86
+
72
87
```
73
88
npm prune --production
74
89
```
90
+
75
91
- Run start command (with port information)
92
+
76
93
```
77
94
yarn start
78
95
```
79
-
Note: These are handled automatically behind the scene when pushing to [Heroku](https://devcenter.heroku.com/)
80
96
97
+
Note: These are handled automatically behind the scene when pushing to [Heroku](https://devcenter.heroku.com/)
81
98
82
99
Check out our video on how to setup the backend here: [Wiki link](https://github.com/Real-Dev-Squad/website-backend/wiki/Backend-setup-and-understanding-the-flow)
0 commit comments