Skip to content

Commit 05283bf

Browse files
author
Víctor Martínez
committed
first commit
0 parents  commit 05283bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+10249
-0
lines changed

.env.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MONGO_INITDB_ROOT_USERNAME=docker
2+
MONGO_INITDB_ROOT_PASSWORD=docker
3+
MONGO_INITDB_DATABASE=casame
4+
MONGO_DB_URL_PRODUCTION=mongodb://docker:docker@mongo:27017/casame?authSource=admin
5+
MONGO_DB_URL_DEVELOPMENT=mongodb://docker:docker@mongo:27017/casame?authSource=admin
6+
MONGO_DB_URL_TEST=mongodb://docker:docker@mongo:27017/casame?authSource=admin
7+
BCRYPT_SALT_ROUNDS=
8+
JWT_SECRET=
9+
10+
FB_CERT_TYPE=
11+
FB_CERT_PROJECT_ID=
12+
FB_CERT_PRIVATE_KEY_ID=
13+
FB_CERT_PRIVATE_KEY=
14+
FB_CERT_CLIENT_EMAIL=
15+
FB_CERT_CLIENT_ID=
16+
FB_CERT_AUTH_URI=
17+
FB_CERT_TOKEN_URI=
18+
FB_CERT_AUTH_PROVIDER_X_509_CERT_URL=
19+
FB_CERT_CLIENT_X_509_CERT_URL=

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
**/*.env
2+
**/node_modules
3+
.DS_Store
4+
5+
server/globalConfig.json
6+
7+
### Node ###
8+
# Logs
9+
logs
10+
*.log
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
lerna-debug.log*
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
*.lcov
22+
23+
# Optional eslint cache
24+
.eslintcache
25+
26+
### react ###
27+
.DS_*
28+
**/*.backup.*
29+
**/*.back.*
30+
31+
node_modules
32+
33+
### yarn ###
34+
# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored
35+
36+
.yarn/*
37+
!.yarn/releases
38+
!.yarn/plugins
39+
!.yarn/sdks
40+
!.yarn/versions
41+
42+
# if you are NOT using Zero-installs, then:
43+
# comment the following lines
44+
# !.yarn/cache
45+
46+
# and uncomment the following lines
47+
.pnp.*

.huskyrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
hooks: {
3+
"pre-commit": "lint-staged",
4+
},
5+
};

.lintstagedrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
"*.{js,jsx}": [
3+
"npm run lint:js",
4+
"npm run lint:format:check",
5+
"npm run test:related",
6+
],
7+
"*.{css,scss,html,md}": ["npm run lint:format:check"],
8+
};

.prettierrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
printWidth: 80,
3+
tabWidth: 2,
4+
useTabs: false,
5+
semi: true,
6+
singleQuote: false,
7+
trailingComma: "all",
8+
bracketSpacing: true,
9+
jsxBracketSameLine: false,
10+
proseWrap: "always",
11+
arrowParens: "always"
12+
};

DockerFile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:latest
2+
3+
ENV NPM_CONFIG_LOGLEVEL=http
4+
5+
WORKDIR /app
6+
7+
COPY src /app/src/
8+
COPY package.json .
9+
COPY jest.config.js .
10+
COPY jsconfig.json .
11+
COPY globalConfig.json .
12+
13+
RUN npm install -g jest
14+
RUN npm install mongodb-memory-server-global --save-dev
15+
RUN npm install -g nodemon
16+
RUN npm install -g dotenv
17+
18+
RUN npm install && npm build
19+
20+
EXPOSE 5000
21+
22+
STOPSIGNAL SIGINT

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 Daniel Lucaci
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
up: down
2+
docker-compose -f docker-compose-test.yaml up -d --scale node=0 && docker-compose -f docker-compose-test.yaml run node /bin/sh
3+
4+
run_start: down
5+
docker-compose -f docker-compose-test.yaml up -d --scale node=0 && docker-compose -f docker-compose-test.yaml run node npm run start
6+
7+
run_dev: down
8+
docker-compose -f docker-compose-test.yaml up -d --scale node=0 && docker-compose -f docker-compose-test.yaml run node npm run dev
9+
10+
test_watch: down
11+
docker-compose -f docker-compose-test.yaml up -d --scale node=0 && docker-compose -f docker-compose-test.yaml run node npm run test:watch
12+
13+
down:
14+
docker-compose -f docker-compose-test.yaml down
15+
16+
build:
17+
docker-compose -f docker-compose-test.yaml build
18+
up_forward: down
19+
docker-compose -f docker-compose-test.yaml up -d --scale node=0 && docker-compose -f docker-compose-test.yaml -p 5000:5000 run node /bin/sh

README.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<p align="center" >
2+
<img src="docs/images/logo.png" title="Casame" width="200">
3+
</p>
4+
5+
<p align="center">
6+
<a href="./LICENSE" target="_blank">
7+
<img alt="MIT License" src="https://img.shields.io/github/license/Property-Search-Engine/admin-server" />
8+
</a>
9+
10+
<img alt="node-build" src="https://img.shields.io/github/workflow/status/Property-Search-Engine/admin-server/NodeJS?logo=node.js" />
11+
12+
<img alt="pr" src="https://img.shields.io/github/issues-pr/Property-Search-Engine/admin-server" />
13+
<img alt="issues" src="https://img.shields.io/github/issues/Property-Search-Engine/admin-server" />
14+
<img alt="discord-chat" src="https://img.shields.io/discord/803927161806520340?logo=discord" />
15+
</p>
16+
17+
<h1 align="center">CasaMe: Find the house or office of your dreams</h1>
18+
19+
> CasaMe Service admin dashboard backend
20+
21+
## Configure
22+
23+
Make sure that you have **Docker** & **Docker Compose** installed on your system
24+
so you can easily follow the next steps!
25+
26+
Before running the project, first copy the .env.save file:
27+
28+
```bash
29+
$ cp .env.example .env
30+
```
31+
32+
Then setup all the needed env variables and everything should be up to go!
33+
## Run
34+
35+
We provide you with a set of tools that can help you to automate the building
36+
and running process throughout makefiles and docker-compose files.
37+
38+
```bash
39+
$ make run_start
40+
# remember to execute `make down` when you are done
41+
```
42+
43+
Run watch to restart the server on each change
44+
45+
```bash
46+
$ make run_dev
47+
# remember to execute `make down` when you are done
48+
```
49+
50+
## Test ✅
51+
52+
```bash
53+
$ make test_watch
54+
```
55+
56+
This is going to run all the tests inside a docker environment. If you want to
57+
have more control over how the tests are performed, you can run:
58+
59+
```bash
60+
$ make up
61+
> $ npm run test # ex.
62+
```
63+
64+
## 👤 Contributors ✨
65+
66+
<table>
67+
<tr>
68+
<td align="center"><a href="https://github.com/JasterV"><img src="https://avatars3.githubusercontent.com/u/49537445?v=4" width="100" alt=""/><br /><sub><b>Victor Martínez</b></sub></a></td>
69+
<td align="center"><a href="https://github.com/devmxhv"><img src="https://avatars.githubusercontent.com/u/18093090?s=400&u=f1be9a47c65f930f7cb6948fe3a606fdac42c197&v=4" width="100" alt=""/><br /><sub><b>devmxhv</b></sub></a></td>
70+
<td align="center"><a href="https://github.com/Damantino"><img src="https://avatars.githubusercontent.com/u/50982542?s=400&u=94fbe1218e4fb44f5443848c1a586a087dfc773f&v=4" width="100" alt=""/><br /><sub><b>Daniel García</b></sub></a></td>
71+
</tr>
72+
73+
</table>
74+
75+
## Show your support
76+
77+
Give a ⭐️ if this project helped you!

docker-compose-test.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: "3"
2+
services:
3+
node:
4+
build:
5+
context: .
6+
dockerfile: DockerFile
7+
cache_from:
8+
- node:latest
9+
env_file: .env
10+
environment:
11+
NODE_ENV: development
12+
PORT: 5000
13+
DEBUG: app:*
14+
ports:
15+
- 5000:5000
16+
depends_on:
17+
- mongo
18+
volumes:
19+
- ./:/app
20+
21+
mongo:
22+
image: mongo:latest
23+
# logging:
24+
# driver: "none"
25+
env_file: .env
26+
ports:
27+
- 27017:27017

0 commit comments

Comments
 (0)