Skip to content

Commit 5a66924

Browse files
Merge pull request #454 from tcet-opensource/development
added setup.md
2 parents 3b2c6b4 + 4f171f8 commit 5a66924

File tree

4 files changed

+63
-4
lines changed

4 files changed

+63
-4
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ node_modules
22
coverage
33
logs
44
.env
5+
data
6+
logs
7+
apidoc

SETUP.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# TCET ERP System
2+
3+
Made in mind for testing APIs, database replication, providing data to frontend.
4+
5+
## Installation for Testing
6+
7+
### Prerequisites
8+
9+
Well before anything, you will have to install WSL. All you have to do is:
10+
11+
`wsl --install`
12+
13+
After this, you will need to restart.
14+
15+
Install Docker Desktop, it is docker bundled with a frontend. It will allow you do get the backend and databases up and running without any other installation steps.
16+
17+
The link for downloading Docker Desktop is given below.
18+
19+
[Docker Desktop Installer](https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe)
20+
21+
Again, you will need to restart.
22+
23+
### Installation
24+
25+
After this, use these commands to set up the databases and the backend.
26+
27+
```bash
28+
docker-compose pull
29+
docker-compose up -d
30+
```
31+
32+
The last step is a troublesome one, but a very necessary step. You will have to change your hosts file. On Linux, it will be in `/etc/hosts/` (use sudo vim/nano/any editor with admin privs and go to the next step). For Windows, it will be in `C:\Windows\System32\drivers\etc\hosts`. Open Notepad(or any code editor) as Admin, and open the specific hosts file, and go to the next step. You can use Microsoft PowerToys to change your Hosts file using the Hosts file editor.
33+
34+
Add the following to your hosts file.
35+
```
36+
127.0.0.1 mongo1
37+
127.0.0.1 mongo2
38+
127.0.0.1 mongo3
39+
```
40+
41+
And voila! You have the backend set up! It will be running on port 4000.
42+
43+
You can use MongoDBCompass to login with the URI specified in the `docker-compose.yaml` and the `.env.sample`
44+
45+
46+
47+
NOTE! If, for any reason, the backend doesn't work, try restarting the backend container in Docker Desktop, in the Containers tab.

_apidoc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@
718718
/**
719719
* @api {post} /exam/add Add Exam
720720
* @apiName AddExam
721-
* @apiExam Exam
721+
* @apiGroup Exam
722722
* @apiDescription Add a new exam.
723723
*
724724
* @apiBody {String} title Exam title.
@@ -1068,7 +1068,7 @@
10681068
/**
10691069
* @api {delete} /exam/delete/:id Delete Exam
10701070
* @apiName DeleteExam
1071-
* @apiExam Exam
1071+
* @apiGroup Exam
10721072
*
10731073
* @apiParam {ObjectId} id The ObjectID of the exam to delete.
10741074
*
@@ -1170,7 +1170,7 @@
11701170
/**
11711171
* @api {post} /exam/update/:id Update Exam Details
11721172
* @apiName UpdateExam
1173-
* @apiExam Exam
1173+
* @apiGroup Exam
11741174
* @apiDescription Update existing exam details.
11751175
*
11761176
* @apiParam {ObjectId} id The ObjectID of the exam to update.
@@ -1336,7 +1336,7 @@
13361336
/**
13371337
* @api {get} /exam/list Get Exam List
13381338
* @apiName GetExamList
1339-
* @apiExam Exam
1339+
* @apiGroup Exam
13401340
*
13411341
* @apiQuery {String} [title] Title of the exam.
13421342
*

docker-compose.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,12 @@ services:
3131
- ./data/mongo-3:/data/db
3232
ports:
3333
- 30003:30003
34+
35+
backend:
36+
build: .
37+
container_name: backend
38+
env_file:
39+
- .env
40+
command: ["npm", "run", "serverstart"]
41+
ports:
42+
- 4000:4000

0 commit comments

Comments
 (0)