Skip to content

Commit c90eb3f

Browse files
authored
Merge pull request #17 from code4romania/develop
update master branch
2 parents e6b3254 + 15c5e0a commit c90eb3f

File tree

116 files changed

+349452
-72
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+349452
-72
lines changed

.env.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ APP_ENV=local
22
APP_DEBUG=true
33
APP_KEY=base64:cwojeBa7tLqPbV68kj5hpJcxAnId9itWRFDmiVaBpLA=
44

5-
DB_HOST=localhost
6-
DB_DATABASE=dokathon
7-
DB_USERNAME=root
8-
DB_PASSWORD=321Javascript000
5+
DB_HOST=127.0.0.1
6+
DB_DATABASE=monitorizare_api
7+
DB_USERNAME=monitorizare
8+
DB_PASSWORD=pVa48ajGK7jCZPz6
99

1010
CACHE_DRIVER=file
1111
SESSION_DRIVER=file

.github/CONTRIBUTING.MD

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Monitorizare Vot - Rest API - Contributing guide
2+
3+
:two_hearts: First off all, thank you for your interest in the project and for taking the time to contribute!
4+
5+
This project is built by amazing volunteers, just like you, from different timezones, backgrounds and skills levels. So to make sure we're all on the same page, it would be great if we all followed a few guidelines. :two_hearts:
6+
7+
[Feedback](#feedback) | [How Can I Contribute?](#how-can-i-contribute) | [Best practices](#best-practices) | [About Code4Ro](#about-code4ro) | [Financial contributions](#financial-contributions) | [Code of conduct](#code-of-conduct)
8+
9+
## Feedback
10+
11+
Just have a quick question? Please e-mail us at at contact@code4.ro
12+
13+
## How can I contribute
14+
15+
### Report bugs
16+
17+
:bug: Think you found a bug? Please check [the list of open issues](https://github.com/code4romania/monitorizare-vot-votanti-api/issues) to see if your bug has already been reported. If it hasn't please [submit a new issue](https://github.com/code4romania/monitorizare-vot-votanti-api/issues/new).
18+
19+
:shield: If you find a **security vulnerability**, do not open an issue. Please email contact@code4.ro instead.
20+
21+
Please be as specific as possible when describing the issue. Explain the problem and include additional details to help maintainers reproduce the problem:
22+
23+
* **Description**
24+
* **Steps to Reproduce**
25+
* Expected behavior
26+
* Actual behavior
27+
* Reproduces how often
28+
29+
### Suggest new features
30+
31+
:bulb: Feature requests are welcome. We would love to hear your thoughts on how we can improve our project further.
32+
33+
To send us a suggestion, just [open an issue](https://github.com/code4romania/monitorizare-vot-votanti-api/issues/new) which describes the feature you would like to see. Give as much information as you can about what you would like to see:
34+
35+
* Description
36+
* Step by step behaviour
37+
* Explain why this enhancement would be useful
38+
39+
### Contribute to the codebase
40+
41+
:computer: We'd love for you to get your hands dirty and code for the project.
42+
43+
If you are unsure where to begin contributing to the project, you can start by looking through these issues:
44+
* [Good first issues](https://github.com/code4romania/monitorizare-vot-votanti-api/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
45+
* [Help wanted](https://github.com/code4romania/monitorizare-vot-votanti-api/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
46+
47+
Please make sure to check out the suggested coding [best practices](#best-practices) and tips with working with git below :wink:
48+
49+
## Best practices
50+
51+
### Coding best practices :ok_hand:
52+
53+
* **The language we code in is English.** Please name your variables, methods, classes and other structures using English words.
54+
* Use clean code conventions :heavy_check_mark: *tip: read [The book](https://www.goodreads.com/book/show/3735293-clean-code) if you haven't already. Or check out [a summary](https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29)*
55+
* Follow the [PHP coding recommendations](https://php7.org/guidelines/psr-1.html)
56+
* Tests are appreciated :relieved:
57+
* Please use relevant commit messages and reference issues in the commit message if applicable
58+
59+
### Git workflow
60+
61+
Our collaboration model [is described here](WORKFLOW.MD).
62+
63+
## About Code4Ro
64+
65+
Started in 2016, Code for Romania is a civic tech NGO, official member of the Code for All network. We have a community of over 500 volunteers (developers, ux/ui, communications, data scientists, graphic designers, devops, it security and more) who work pro-bono for developing digital solutions to solve social problems. #techforsocialgood. If you want to learn more details about our projects [visit our site](https://www.code4.ro/en/) or if you want to talk to one of our staff members, please e-mail us at contact@code4.ro.
66+
67+
## Financial contributions
68+
69+
Last, but not least, we rely on donations to ensure the infrastructure, logistics and management of our community that is widely spread across 11 timezones, coding for social change to make Romania and the world a better place. If you want to support us, [you can do it here](https://code4.ro/en/donate/).
70+
71+
## Code of conduct
72+
73+
This project and everyone participating in it is governed by the [Code for Romania Code of Conduct](https://code4.ro/en/code-of-conduct/). By participating, you are expected to uphold this code. Please report unacceptable behavior to safespace@code4.ro.

.github/WORKFLOW.MD

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
2+
3+
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
4+
5+
## Creating a Fork
6+
7+
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or just head straight to the command line:
8+
9+
```shell
10+
# Clone your fork to your local machine
11+
git clone git@github.com:USERNAME/FORKED-PROJECT.git
12+
```
13+
14+
## Keeping Your Fork Up to Date
15+
16+
While this isn't an absolutely necessary step, if you plan on doing anything more than just a tiny quick fix, you'll want to make sure you keep your fork up to date by tracking the original "upstream" repo that you forked. To do this, you'll need to add a remote:
17+
18+
```shell
19+
# Add 'upstream' repo to list of remotes
20+
git remote add upstream https://github.com/UPSTREAM-USER/ORIGINAL-PROJECT.git
21+
22+
# Verify the new remote named 'upstream'
23+
git remote -v
24+
```
25+
26+
Whenever you want to update your fork with the latest upstream changes, you'll need to first fetch the upstream repo's branches and latest commits to bring them into your repository:
27+
28+
```shell
29+
# Fetch from upstream remote
30+
git fetch upstream
31+
32+
# View all branches, including those from upstream
33+
git branch -va
34+
```
35+
36+
Now, checkout your own master branch and merge the upstream repo's master branch:
37+
38+
```shell
39+
# Checkout your master branch and merge upstream
40+
git checkout master
41+
git merge upstream/master
42+
```
43+
44+
If there are no unique commits on the local master branch, git will simply perform a fast-forward. However, if you have been making changes on master (in the vast majority of cases you probably shouldn't be - [see the next section](#doing-your-work), you may have to deal with conflicts. When doing so, be careful to respect the changes made upstream.
45+
46+
Now, your local master branch is up-to-date with everything modified upstream.
47+
48+
## Doing Your Work
49+
50+
### Create a Branch
51+
Whenever you begin work on a new feature or bugfix, it's important that you create a new branch. Not only is it proper git workflow, but it also keeps your changes organized and separated from the master branch so that you can easily submit and manage multiple pull requests for every task you complete.
52+
53+
To create a new branch and start working on it:
54+
55+
```shell
56+
# Checkout the master branch - you want your new branch to come from master
57+
git checkout master
58+
59+
# Create a new branch named newfeature (give your branch its own simple informative name)
60+
git branch newfeature
61+
62+
# Switch to your new branch
63+
git checkout newfeature
64+
```
65+
66+
Now, go to town hacking away and making whatever changes you want to.
67+
68+
## Submitting a Pull Request
69+
70+
### Cleaning Up Your Work
71+
72+
Prior to submitting your pull request, you might want to do a few things to clean up your branch and make it as simple as possible for the original repo's maintainer to test, accept, and merge your work.
73+
74+
If any commits have been made to the upstream master branch, you should rebase your development branch so that merging it will be a simple fast-forward that won't require any conflict resolution work.
75+
76+
```shell
77+
# Fetch upstream master and merge with your repo's master branch
78+
git fetch upstream
79+
git checkout master
80+
git merge upstream/master
81+
82+
# If there were any new commits, rebase your development branch
83+
git checkout newfeature
84+
git rebase master
85+
```
86+
87+
Now, it may be desirable to squash some of your smaller commits down into a small number of larger more cohesive commits. You can do this with an interactive rebase:
88+
89+
```shell
90+
# Rebase all commits on your development branch
91+
git checkout
92+
git rebase -i master
93+
```
94+
95+
This will open up a text editor where you can specify which commits to squash.
96+
97+
### Submitting
98+
99+
Once you've committed and pushed all of your changes to GitHub, go to the page for your fork on GitHub, select your development branch, and click the pull request button. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes on your development branch and update.
100+
101+
## Accepting and Merging a Pull Request
102+
103+
Take note that unlike the previous sections which were written from the perspective of someone that created a fork and generated a pull request, this section is written from the perspective of the original repository owner who is handling an incoming pull request. Thus, where the "forker" was referring to the original repository as `upstream`, we're now looking at it as the owner of that original repository and the standard `origin` remote.
104+
105+
### Checking Out and Testing Pull Requests
106+
Open up the `.git/config` file and add a new line under `[remote "origin"]`:
107+
108+
```
109+
fetch = +refs/pull/*/head:refs/pull/origin/*
110+
```
111+
112+
Now you can fetch and checkout any pull request so that you can test them:
113+
114+
```shell
115+
# Fetch all pull request branches
116+
git fetch origin
117+
118+
# Checkout out a given pull request branch based on its number
119+
git checkout -b 999 pull/origin/999
120+
```
121+
122+
Keep in mind that these branches will be read only and you won't be able to push any changes.
123+
124+
### Automatically Merging a Pull Request
125+
In cases where the merge would be a simple fast-forward, you can automatically do the merge by just clicking the button on the pull request page on GitHub.
126+
127+
### Manually Merging a Pull Request
128+
To do the merge manually, you'll need to checkout the target branch in the source repo, pull directly from the fork, and then merge and push.
129+
130+
```shell
131+
# Checkout the branch you're merging to in the target repo
132+
git checkout master
133+
134+
# Pull the development branch from the fork repo where the pull request development was done.
135+
git pull https://github.com/forkuser/forkedrepo.git newfeature
136+
137+
# Merge the development branch
138+
git merge newfeature
139+
140+
# Push master with the new feature merged into it
141+
git push origin master
142+
```
143+
144+
Now that you're done with the development branch, you're free to delete it.
145+
146+
```shell
147+
git branch -d newfeature
148+
```
149+
150+
151+
152+
**Copyright**
153+
154+
Copyright 2017, Chase Pettit
155+
156+
MIT License, http://www.opensource.org/licenses/mit-license.php
157+
158+
**Additional Reading**
159+
* [Atlassian - Merging vs. Rebasing](https://www.atlassian.com/git/tutorials/merging-vs-rebasing)
160+
161+
**Sources**
162+
* [GitHub - Fork a Repo](https://help.github.com/articles/fork-a-repo)
163+
* [GitHub - Syncing a Fork](https://help.github.com/articles/syncing-a-fork)
164+
* [GitHub - Checking Out a Pull Request](https://help.github.com/articles/checking-out-pull-requests-locally)

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ logs
1717
*.log
1818
npm-debug.log*
1919

20+
### Azure ###
21+
azuredeploy.json
22+
EULA_ENU.rtf
23+
2024
# Runtime data
2125
pids
2226
*.pid
@@ -130,3 +134,10 @@ bootstrap/cache/*.php
130134

131135
# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer
132136
.rocketeer/
137+
138+
# Eclipse
139+
.project
140+
build.xml
141+
.buildpath
142+
.settings
143+
.externalToolBuilders

0 commit comments

Comments
 (0)