discussion add tag
5 years ago Ibnelaiq

As I am experienced developer working with PHP and C#, I am totally impressed and want to contribute in this site as there is no moderator things and not daily question. So the question is how can we encourage more new developers towards this site and contribute to this website because I feel little bit difficulty in understand the UI. so any help will be appreciated.

Top Answer
5 years ago Jack Douglas

Thanks for the kind offer, we’d love to have more experienced PHP devs on board, and will do what we can to make the experience as painless as possible.

Because of @Pax’s very helpful efforts, devs are able to spin up their own fully-functional Docker environments with a seed database, so you can test before submitting PRs on GitHub.

I know you’ve found our GitHub repo too, but for the benefit of others, our stack is:

  1. Postgres
  2. PHP

We use Apache to serve, but that’s not really important to know except for setting up, and HTML/CSS/Javascript too, but that goes without saying!

In terms of architecture:

  • Everything is built around the database, and all access to the database is through a ‘transactional’ API layer of procedural code in the database itself.

  • Much of the front-end code was originally quite naive — it’s a relatively thin layer, and we put it together quickly. More recently, again mostly as the result of @Pax’s direction and prompting, we’ve refactored things to add better separation. See this blog post for further details on the JS modularization (Require.JS) and resource versioning aspects of that:

  • We have started to move away from using jQuery in the front-end code in favour of native (modern) Javascript. We don’t support IE at all, and don’t officially support anything other that the most recent versions of Firefox, Chrome/Edge/Opera and Safari. In practice we also make limited efforts to keep things functional on:

    1. Recent iOS and Android mobile devices
    2. Certain older versions of Chrome and FF that we know particular contributors are still using 😃
5 years
Pax — Tuesday, 14th Jul 2020 21:17

Yes. If you install Docker for Desktop, you should get the CLI commands as well: https://www.docker.com/products/docker-desktop

an hour
Ibnelaiq — Tuesday, 14th Jul 2020 20:13

Thanks

Ibnelaiq — Tuesday, 14th Jul 2020 20:13

sorry, but I am kinda new to docker so docker is software right I have to download?

2 days
Ibnelaiq — Sunday, 12th Jul 2020 19:40

Thanks, I will contact you here when I ever need any help

35 minutes
Pax — Sunday, 12th Jul 2020 19:05

Once the containers are fixed, to spin up your own dev environment would be simply to:

  1. git clone .... the repo
  2. run docker-compose up inside the project (in the directory where docker-compose.yml is found)
  3. (this step can go in whatever order, really.) add topanswers.local to your hosts file

Docker will setup everything you need (apache, postgres, etc.) to get a dev environment going and you’d be able to visit topanswers.local and test your changes.

Pax replying to Jack Douglas — Sunday, 12th Jul 2020 18:56

Yup. But right now it’s broken since I haven’t updated the Apache container. Once this is merged, I’ll move to fixing the container! I think that’s the last js file with PHP in it.

2 hours
Jack Douglas replying to Ibnelaiq — Sunday, 12th Jul 2020 16:43

As far as I know, the docker route sets everything up for you, including apache, postgres and all the code. You won’t actually need to connect to the database directly or anything like that

Ibnelaiq — Sunday, 12th Jul 2020 16:38

can I do it with GIT but don’t know how to connect to database for testing

Ibnelaiq — Sunday, 12th Jul 2020 16:35

Thanks for this response. I will do my best

Jack Douglas — Sunday, 12th Jul 2020 16:29

Here is an example of a feature request that is not horribly hard, and probably only involves PHP: https://github.com/topanswers/topanswers/issues/70

Jack Douglas replying to Ibnelaiq — Sunday, 12th Jul 2020 16:26

I you are serious about helping, you will certainly need to be able to spin up a dev environment — I understand it’s pretty easy to do that with Docker, and @Pax may be able to help if you have any issues doing so.

Jack Douglas replying to Ibnelaiq — Sunday, 12th Jul 2020 16:25

I have added you to the dev room so you should be able to post messages in there now — feel free to do so, or in this room.

2 hours
Ibnelaiq — Sunday, 12th Jul 2020 14:48

Yes I am

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.