-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into enhancement/projects-file-upload
# Conflicts: # backend/project/__init__.py # backend/project/endpoints/courses/course_admin_relation.py # backend/project/endpoints/courses/course_details.py # backend/project/endpoints/courses/course_student_relation.py # backend/project/endpoints/courses/courses.py # backend/project/endpoints/courses/courses_utils.py # backend/project/endpoints/projects/project_detail.py # backend/project/endpoints/projects/projects.py # backend/project/utils/misc.py # backend/project/utils/query_agent.py
- Loading branch information
Showing
32 changed files
with
670 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ docs/_build/ | |
dist/ | ||
venv/ | ||
.env | ||
.run/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
FROM python:3.9 | ||
RUN mkdir /app | ||
WORKDIR /app/ | ||
WORKDIR /app | ||
ADD ./project /app/ | ||
COPY requirements.txt /app/requirements.txt | ||
RUN pip3 install -r requirements.txt | ||
CMD ["python3", "/app"] | ||
COPY . /app | ||
ENTRYPOINT ["python"] | ||
CMD ["__main__.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Project pigeonhole backend | ||
## Prerequisites | ||
**1. Clone the repo** | ||
```sh | ||
git clone git@github.com:SELab-2/UGent-3.git | ||
``` | ||
**2. Installing required packages** | ||
|
||
If you want the development environment: run both commands. If you only need to deploy, run the deployment command. | ||
|
||
The [dev-requirements.txt](dev-requirements.txt) contains everything for writing tests and linters for maintaining quality code. | ||
On the other hand the regular [requirements.txt](requirements.txt) installs the packages needed for | ||
the regular base application. | ||
|
||
- Deployment | ||
```sh | ||
pip install -r requirements.txt | ||
``` | ||
- Development | ||
```sh | ||
pip install -r dev-requirements.txt | ||
``` | ||
|
||
## Setting up the environment variables | ||
The project requires a couple of environment variables to run, if you want to develop on this codebase. | ||
Setting values for these variables can be done with a method to your own liking. | ||
|
||
| Variable | Description | | ||
|-------------------|----------------------------------------------------------------| | ||
| DB_HOST | Url of where the database is located | | ||
| POSTGRES_USER | Name of the user, needed to login to the postgres database | | ||
| POSTGRES_PASSWORD | Password of the user, needed to login to the postgres database | | ||
| POSTGRES_HOST | IP adress of the postgres database | | ||
| POSTGRES_DB | Name of the postgres database | | ||
| API_HOST | Location of the API root | | ||
|
||
All the variables except the last one are for the database setup, | ||
these are needed to make a connection with the database. | ||
The last one is for keeping the API restful since the location of the resource should be located. | ||
|
||
## Running the project | ||
Once all the setup is done you can start the development server by | ||
navigating to the backend directory and running: | ||
```sh | ||
python project | ||
``` | ||
The server should now be located at `localhost:5000` and you can | ||
start developing. | ||
|
||
## Maintaining the codebase | ||
### Writing tests | ||
When writing new code it is important to maintain the right functionality so | ||
writing tests is mandatory for this, the test library used in this codebase is [pytest](https://docs.pytest.org/en/8.0.x/). | ||
|
||
If you want to write tests we highly advise to read the pytest documentation on how | ||
to write tests, so they are kept conventional. | ||
|
||
For executing the tests and testing your newly added functionality | ||
you can run: | ||
```sh | ||
sudo ./run_tests.sh | ||
``` | ||
|
||
Located in the backend directory. | ||
### Running the linter | ||
This codebase is kept clean by the [pylint](https://pypi.org/project/pylint/) linter. | ||
|
||
If you want to execute the linter on all .py files in the project it can simply be done | ||
with the command: | ||
```sh | ||
find . -type f -name "*.py" | xargs pylint | ||
``` | ||
The code needs to get a 10/10 score to get pushed to the repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.