https://github.com/mavhungutrezzy/campus-connect
The 'Campus Connect' API is a comprehensive system designed to facilitate interactions between students, universities, and bursary providers
https://github.com/mavhungutrezzy/campus-connect
api-rest django django-rest-framework docker postgresql
Last synced: 3 months ago
JSON representation
The 'Campus Connect' API is a comprehensive system designed to facilitate interactions between students, universities, and bursary providers
- Host: GitHub
- URL: https://github.com/mavhungutrezzy/campus-connect
- Owner: mavhungutrezzy
- License: other
- Created: 2023-10-24T04:46:24.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-29T13:22:27.000Z (over 2 years ago)
- Last Synced: 2024-01-28T23:10:47.854Z (over 2 years ago)
- Topics: api-rest, django, django-rest-framework, docker, postgresql
- Language: Python
- Homepage: https://campusconnect-yph529vr.b4a.run/api/v1/docs/
- Size: 146 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Campus Connect (1.0.0)
[](https://github.com/mavhungutrezzy/campus-connect/actions/workflows/django.yml)
[](href="https://www.djangoproject.com/)
[](https://www.python.org)
[](https://www.djangoproject.com/)
The 'Campus Connect' API is a comprehensive system designed to facilitate interactions between students, universities, and bursary providers. It leverages the power of Django REST framework and employs JWT (JSON Web Tokens) for secure authentication. The API provides several features to serve students, including bursaries management, application tracking for bursaries and courses, courses and university information, etc.
## ๐ API Documentation
The API documentation is available to help you understand how to use the 'Campus Connect' API. You can access the API documentation by visiting the following URL: [Docs](https://campusconnect-yph529vr.b4a.run/api/v1/docs/)
## ๐ Installation
This project can be installed via Pip or Docker. To get started, clone the repository to your local computer and navigate to the project directory.
```shell
$ git clone https://github.com/yourusername/yourrepository.git
$ cd yourrepository
```
### Pip
Create a virtual environment, activate it, install the project requirements, perform database migrations, create a superuser, and run the development server.
```shell
$ python -m venv .venv
# Windows
$ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
$ .venv\Scripts\Activate.ps1
# macOS
$ source .venv/bin/activate
(.venv) $ pip install -r requirements.txt
(.venv) $ python manage.py migrate
(.venv) $ python manage.py createsuperuser
(.venv) $ python manage.py runserver
# Access the site at http://127.0.0.1:8000
```
### Docker
If you prefer using Docker with PostgreSQL as the database, update the `DATABASES` section in the `django_project/settings.py` file to match the following configuration:
```python
# django_project/settings.py
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "postgres",
"USER": "postgres",
"PASSWORD": "postgres",
"HOST": "db", # set in docker-compose.yml
"PORT": 5432, # default PostgreSQL port
}
}
```
Update the `INTERNAL_IPS` configuration in `django_project/settings.py` as well:
```python
# config/settings.py
# django-debug-toolbar
import socket
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS = [ip[:-1] + "1" for ip in ips]
```
Build the Docker image, run the container, and execute the standard commands within Docker:
```shell
$ docker-compose up -d --build
$ docker-compose exec web python manage.py migrate
$ docker-compose exec web python manage.py createsuperuser
# Access the site at http://127.0.0.1:8000
```
## ๐งช Testing
We use both pytest and Django unittests for testing the 'Campus Connect' API.
### Running pytest
You can run pytest to execute the project's tests by using the following command:
```shell
(.venv) $ pytest
```
### Running Django unittests with Coverage
To run Django unittests with coverage, use the following command:
```shell
(.venv) $ coverage run manage.py test
```
You can then view the coverage report using:
```shell
(.venv) $ coverage report
```
For a more detailed HTML report, use:
```shell
(.venv) $ coverage html
```