The project represents a simple web app. Basically, it has a list of people and a registration form. Data is stored in-memory, validation is present. Seamless user experience is provided by WebSockets, not by API polling.
- Node.js + TypeScript
- GraphQL server: Apollo Server Express, WebSocket subscriptions
- GraphQL codegen: Nexus
- Custom logging
- Angular
- GraphQL client: Apollo Angular
- Real-time WebSocket subscriptions
- Docker Compose
Make sure you have Docker Engine
and Docker Compose
installed on your machine. If you don't and you use Windows or macOS, consider installing Docker Desktop
, it includes all needed tools. Note that Docker Compose
version must be at least 2.0.0
.
Windows
-
Verify installation of
Docker
andDocker Compose
2.0.0+:docker -v && docker-compose -v
-
Clone the repository:
git clone https://github.com/VengerAndrey/MembersClub.git
-
Navigate inside the repository directory:
cd MembersClub
-
Start the application with the command:
docker-compose up -d
-
Wait a few seconds after containers are created and then navigate to
localhost:4200
.
Linux
-
Verify installation of
Docker
andDocker Compose
2.0.0+:docker version && docker compose version
-
Clone the repository:
git clone https://github.com/VengerAndrey/MembersClub.git
-
Navigate inside the repository directory:
cd MembersClub
-
Start the application with the command:
docker compose up -d
-
Wait a few seconds after containers are created and then navigate to
localhost:4200
.
Windows
To see logs run the following command:
docker-compose logs api
To stop application run:
docker-compose down
You can restart it with mentioned up
command. If you want to run it as a foreground process and view all logs you may omit -d
flag.
To clean up run:
docker-compose down -v --rmi all --remove-orphans
Linux
To see logs run the following command:
docker compose logs api
To stop application run:
docker compose down
You can restart it with mentioned up
command. If you want to run it as a foreground process and view all logs you may omit -d
flag.
To clean up run:
docker compose down -v --rmi all --remove-orphans
It is possible that you run some other programs on ports 4000
and 4200
, which are used to serve this application. If you do so, consider altering docker-compose.yml
:
version: '2'
services:
api:
build: members-club-api
ports:
- - "4000:4000"
+ - "4001:4000"
client:
build: members-club-client
ports:
- - "4200:80"
+ - "4201:80"
Do not forget to change API endpoint in members-club-client\src\app\graphql.module.ts
:
- const uri = 'localhost:4000/graphql'
+ const uri = 'localhost:4001/graphql'
If you use Linux and get Docker daemon error similar to the following:
Got permission denied while trying to connect to the Docker daemon socket at unix
/var/run/docker.sock: connect: permission denied
Consider running the command:
sudo chmod 666 /var/run/docker.sock