diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..7ec08aa --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,121 @@ +# Contributing +Contributions of all kind are welcomed + +## Run Locally + +#### Prerequisites : + + - [Git](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) + - [WSL (only for windows)](https://www.oracle.com/java/technologies/downloads/) + - [Docker](https://docs.docker.com/engine/install/) + - [Github OAuth Application](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) + With redierect url to http://localhost:3000/login + - [Node](https://nodejs.org/en/download) + - [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) + - [Postgresql](https://www.postgresql.org/download/) + - [Redis](https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/) + - [Jdk-17](https://openjdk.org/projects/jdk/17/) + - [maven](https://maven.apache.org/install.html) + + +#### Clone the Repo +``` +git clone https://github.com/mdgspace/Tracer.git +``` +#### Change current folder to project folder + +``` +cd Tracer +``` +### Start postgres and redis servers + +### Create postgresql user, password and database + +### Create env.sh from env.sh.example + + +### Install node-modules +``` +npm ci +``` +### Run Frontend + +``` +source env.sh +npm start +``` + +### Run backend + +``` +source env.sh +mvn spring-boot:run -DskipTests +``` + +### Testing + +Tests for backend is written ./src/test Directories + +#### Run tests + +``` +mvn test +``` + +## Run using Docker +#### Prerequisites : + + - [Git](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) + - [WSL (only for windows)](https://www.oracle.com/java/technologies/downloads/) + - [Docker](https://docs.docker.com/engine/install/) + - [Github OAuth Application](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) + With redierect url to http://localhost:3000/login + +#### Clone the Repo +``` +git clone https://github.com/mdgspace/Tracer.git +``` +#### Change current folder to project folder + +``` +cd Tracer +``` + +### Create env.list file using env.list.example + +### Run docker compose +``` +docker compose up +``` + +## Commit messages +Please start your commits with these prefixes for better understanding among collaborators, based on the type of commit: + +``` +feat: (addition of a new feature) +rfac: (refactoring the code: optimization/ different logic of existing code - output doesn't change, just the way of execution changes) +docs: (documenting the code, be it readme, or extra comments) +bfix: (bug fixing) +chor: (chore - beautifying code, indents, spaces, camelcasing, changing variable names to have an appropriate meaning) +ptch: (patches - small changes in code, mainly UI, for example color of a button, increasing size of tet, etc etc) +conf: (configurational settings - changing directory structure, updating gitignore, add libraries, changing manifest etc) +About +``` + +Add in last of commit message (backend) or (frontend) to specify where you have done the changes + +ex: +``` +chor: Chnge project colour (frontend) + +rfac: Get UserApi (backend) +``` + +## File Structure + +- **src/main:** Contains all the backend code +- **src/test:** Contains all the backend tests +- **src/app:** Contains all the frontend configurations +- **src/features:** Contains all the frontend features +- **src/utils:** Contains all the frontend utilities + diff --git a/CONTRIBUTION.md b/CONTRIBUTION.md deleted file mode 100644 index a397f71..0000000 --- a/CONTRIBUTION.md +++ /dev/null @@ -1,94 +0,0 @@ -# Activity-leaderboard Backend - - -## Run Locally - -#### Prerequisites : - - - [Git](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) - - [WSL (only for windows)](https://www.oracle.com/java/technologies/downloads/) - - [Docker](https://docs.docker.com/engine/install/) - - [AWS CLI](https://cloudacademy.com/blog/how-to-use-aws-cli/) - - [Github OAuth Application](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) - - -#### Clone the Repo -``` -git clone https://github.com/mdgspace/activity-leaderboard-backend.git -``` -#### Change current folder to project folder - -``` -cd activity-leaderboard-backend -``` - -#### Create env.list from env.list.example - -``` - -# Postgres configurations -POSTGRES_HOST=postgres -POSTGRES_USER=sudo -POSTGRES_PASSWORD=sudo -POSTGRES_DB=test - - -#Redis configuration -REDIS_HOST=redis -REDIS_PASS= - -# Github configuration - -GITHUB_CLIENT_ID=you github oauth application client id -GITHUB_CLIENT_SECRET=you github oauth application client id - - -# AWS Configurations -AWS_BUCKET=bucketname -AWS_ACCESS=localstack -AWS_SECRET=localstack -AWS_URL=http://localstack:4566 -AWS_REGION=us-east-1 - - - - -``` - -#### Run Docker compose (In root dierectory) -``` -docker compose up -d -``` - -#### Run localstack s3 image - -``` -docker run -d --name localstack --network activity-leaderboard-backend_network -e SERVICES=s3 -p 4566:4566 localstack/localstack -``` -#### Create s3 bucket - -``` - -aws --endpoint-url=http://localhost:4566 s3api create-bucket --bucket bucketname --region us-east-1 - - -aws --endpoint-url=http://localhost:4566 s3 ls - -``` - -### Get the ip of locakstack container -``` -docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' localstack -``` - - -#### Build backend image(in root dierectory) -``` -docker build -t activity-backend:latest . - -``` - -#### Run backend image -``` -docker run --name backend --network activity-leaderboard-backend_network -dp 8080:8080 --env-file env.list activity-backend:latest -``` \ No newline at end of file