"Time For Friends" is a web application that allows you to track your friends local time live.
- MongoDB
- Node.js
- Express.js
- GraphQL
- React.js
Docker image for backend application can be found on DockerHub
Cleanup database and generate test data:
npm run init
Start server in development setup (with nodemon):
npm run dev
Start server in production setup (without nodemon):
npm run start
Run through docker (from existing dockerimage on DockerHub):
docker run -e INIT_DATA=true -e MONGO_URI=<your databse uri> -p 8080:<your choosen port> -d nawajo/time_for_friends
Server port (default 8080):
PORT=<your port> npm run start
MongoDB URI (default mongodb://localhost/time_for_friends)
MONGO_URI=<your uri> npm run start
Data initialization - should 'init-data' script run at server start (default false)
INIT_DATA=true npm run dev
To create docker image for backend run following commands:
cd backend
docker build -t <your tag> .
Then you can run your image with following command:
docker run -e MONGO_URI=<your database URI> -p 8080:8080 -d <your tag>
You can link created container with existing mongodb container on your machine:
docker run --link <your mongodb container>:mongodb -e MONGO_URI='mongodb://mongodb/time_for_friends' -p 8080:8080 -d <your_tag>
Login to your dockerhub account:
docker login
Tag your image:
docker tag <image id> <repository name>:latest
Push image to dockerhub:
docker push <repository name>
Start development server:
npm start
Build application for production:
npm run build
Backend URI (default http://localhost:8080/graphql)
REACT_APP_BACKEND_URI=<your backend uri> npm start
Google Maps API (map will not work without this variable)
REACT_APP_GOOGLE_MAPS_API_KEY=<your api key> npm start
Navigate to frontend folder
cd frontend
Edit Dockerfile and add ENV variables for backend URI and Gogle Maps API Key
To create Docker image run:
docker build -t <your tag> .
Then you can run your container with following command:
docker run -p 80:80 -d <your tag>
Login to your dockerhub account:
docker login
Tag your image:
docker tag <image id> <repository name>:latest
Push image to dockerhub:
docker push <repository name>