This repository serves the backend system for The Three Hundred Days Of Code Challenge.
To learn more about the challenge please check out this link.
Note:
- This setup is for running the cluster locally.
- The codebase for the FE is present in this repository.
The following are the pre-requisites for setting up the backend cluster:
- Docker
- Git
- Java
- MVN
- Download the repo using the command:
git clone git@github.com:ravitandon90/ThreeHundredDaysOfCode-BE.git
- Setup Docker using this link.
- Install maven using this link for mac
brew install maven
- Go to root-directory using the command:
cd ThreeHundredDaysOfCode-BE
- Build the backend using the following command.
mvn clean
mvn package
- Deploy the backend on local using the following commands:
cd deployments/local
- set the following environment variables
export USER=ravi
# update with your usernameexport DOCKER_TAG=ravitandon2/master-300-prod:0.3
# update with custom docker image
docker-compose up
- Verify that the
Master Service
is up using the ping command as follows:curl localhost:80
- You should get
Master-Ok
as the response.
- Run the following command to list all the running docker containers:
docker container ls
You should see a Master Service and a Postgres server running.
- Load the data into the database using the following command:
docker exec -ti db psql -d postgres -U postgres -f /home/data.sql
- To bring down the cluster use the following commands:
- Shutdown the cluster without deleting the data:
docker-compose down
- Shutdown the cluster and delete the data:
docker-compose down --volumes
- Shutdown the cluster without deleting the data:
Here is some information around the three hundred days of code challenge.
Your goal is to solve 1 coding problem every single day. After you solve the problem, submit the problem on ThreeHundredDaysOfCode and send a tweet with the hashtag (#300DaysOfCode).
There are three prizes:
- Monthly Coding Streak Challenge: Every month we will give out $200 to the person who submits a solution on the maximum number of days . You need a minimum of 20 unique days to qualify for the prize.
- Monthly Referral Challenge: Every month we will give out $50 to the person who brings in the maximum number of people to the community. You need a minimum of 10 successful referrals to qualify for the prize.
- The Coding God: The first person to complete a 300-day-long streak, will get a brand new IPhone. The solution should be your own and not copied from any other place.