https://github.com/thedevstone/asw-1920-gymmy
https://github.com/thedevstone/asw-1920-gymmy
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/thedevstone/asw-1920-gymmy
- Owner: thedevstone
- Created: 2021-01-21T10:41:45.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2021-02-03T11:17:38.000Z (over 4 years ago)
- Last Synced: 2025-03-16T16:15:47.777Z (3 months ago)
- Language: JavaScript
- Size: 8.27 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gymmy web services
Gymmy app, api and database in one simple solution.## Local development
### Command line
- **Environment variables**
This setup will use variables located in **.local.env**.
Create this file editing **example.local.env**
- **App and Api**
```
cd app && npm install
npm start
cd api && npm install
node src/Server.js
```
- **Mongo**
You need to create an admin user in **MongoDBCompass**. See mongo README.md.### Docker
- **Environment variables**This setup will use variables located in **.dev.docker-compose.env**.
Create this file editing **example.docker-compose.env**
- **Start services**
```
cd app && npm install
cd ..
cd api && npm install
cd ..
docker-compose -f dev.docker-compose.yaml up --build -d [services...]
```
- **Stop and cleanup**
```
docker-compose -f dev.docker-compose.yaml down -v [services...]
```## Run Docker-Compose production setup: App, Api and MongoDB Cluster (3 nodes)
- ### Environment variables
- #### App
Modify `REACT_APP_API_URL=http://:8080` in `app/.env.production` with Server URL
- #### Api
Modify jwt and db connection in `api/docker_envs/.env.production`
```
# ------ Api ---------
....
DB_ADMIN=admin
DB_ADMIN_PWD=password
DB_CONNECTION=mongodb://:27017/
example: DB_CONNECTION=mongodb://mongo1:27017/
JWT_SECRET=secret
```
- #### Mongo
Modify jwt and db connection in `mongo/docker_envs/.env.production`
```
# ------ Api ---------
....
MONGO_INITDB_ROOT_USERNAME=admin
MONGO_INITDB_ROOT_PASSWORD=password
MONGO_INITDB_DATABASE=gymmy
```
- ### Start services
```
docker-compose -f prod.docker-compose.yaml up --build -d [services...]
```
- ### Stop and cleanup
```
docker-compose -f prod.docker-compose.yaml up --build -d [services...]
```
- ### Info
```
docker-compose -f prod.docker-compose.yaml ps
```