Skip to content

Latest commit

 

History

History
102 lines (66 loc) · 2.92 KB

CONTRIBUTING.md

File metadata and controls

102 lines (66 loc) · 2.92 KB

Contributing to stackoverflow-readme-profile

Hello! 👋

Thanks for contributing on stackoverflow-readme-profile. Before implementing new features and changes, feel free to submit an issue. We're going to talk here.

🌱 How to submit a pull request?

  1. Fork this repository.
  2. Create a new feature branch. (Eg: feature/add-theme-burgger)
  3. Make your changes.
  4. Make a little check using yarn lint && yarn test
  5. Commit your changes using the gitmoji convention.
  6. Submit your pull request.

🔨 How to start stackoverflow-readme-profile locally

  1. Clone the project
git clone https://github.com/johannchopin/stackoverflow-readme-profile.git
cd stackoverflow-readme-profile
  1. Install the dependencies
yarn
  1. Run a local postgres instance with docker
docker run --name MY_DOCKER_INSTANCE_NAME -p 5430:5432  -e POSTGRES_PASSWORD=MY_PWD  -e POSTGRES_USER=MY_USER  -e POSTGRES_DB=MY_DB_NAME -v my-postgres-db-db:/var/lib/postgresql/data -d postgres:15
  1. Add and adapt the .env variables

You will find an example of it in ./.env.example.

  1. Run the start script

You can easily see your changes by running the express api located in ./src/api.ts:

yarn start
  1. Navigate to http://localhost:5000/profile/8583669

📄 Generate the templates demos

The repo contains generated README files that present the different themes like https://github.com/johannchopin/stackoverflow-readme-profile/tree/main/docs/profile. Those are generated by using the following commands:

yarn docs:gen:template TEMPLATE_NAME # generate the profile badges
yarn docs:gen:ranking-template # generate the ranking badges

💡 I decided to generate them to avoid unnecessary server computation since the templates won't change much.


🐳 Docker

Build the image

You can build the image by using the following command:

docker build -t johannchopin/stackoverflow-readme-profile .

Push the image

You can push the image by using the following command:

docker push johannchopin/stackoverflow-readme-profile

Run the application

To run the app together with postgresql you will need to copy the docker-compose.yml file on you server. Near to it add a new .env file and adapt the variables. You will find an example of it in ./.env.example. You can then run:

docker-compose pull # be sure to get the latest johannchopin/stackoverflow-readme-profile image version
docker-compose up # start the engine

Stop the application

docker-compose stop

Remove the container

docker-compose down
docker-compose down --volumes # use it to remove the stored database volume