-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bring back to Django * Fix github tests * Ensure shell scripts always have LF line endings Signed-off-by: Nishant Nayak <[email protected]> * Made a few more changes to docker files * Added CONTRIBUTING guidelines --------- Signed-off-by: Nishant Nayak <[email protected]> Co-authored-by: Nishant Nayak <[email protected]>
- Loading branch information
1 parent
7d22deb
commit 938bd47
Showing
55 changed files
with
104 additions
and
16,043 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.sh text eol=lf |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
python 3.11.1 | ||
nodejs 18.16.0 |
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,66 @@ | ||
## Development Instructions | ||
|
||
Versions for all the languages used in the project can be found in the `.tool-versions` file. Support will be provided for all Unix (MacOS, Debian/Ubuntu) based systems. If you choose to develop on Windows, we cannot promise anything xD. We also will not be supporting RHEL-based operating systems. | ||
|
||
If you do not have access to a Unix machine, Docker is the recommended way for development. | ||
|
||
### Pre Commit Hooks | ||
|
||
We maintain code quality using pre-commit hooks (defined in [.pre-commit-config.yaml](.pre-commit-config.yaml)). All developers are requested to install all the pre-commit hooks before making any contributions to the codebase. Read more about pre-commit hooks [here](https://pre-commit.com/). | ||
|
||
To install pre-commit hooks, run the following commands: | ||
|
||
```shell | ||
# Install the pre-commit framework | ||
pip install pre-commit | ||
|
||
# Install the pre-commit hooks | ||
pre-commit install | ||
``` | ||
|
||
### Docker Development | ||
|
||
This is the preferred way for development. All modern editors allow you to open code in Docker containers remotely. If that is not possible, all code is mounted to Docker containers, so you can make changes that can be checked live. | ||
|
||
For development, use the development Docker Compose file. | ||
|
||
```shell | ||
cp env.example .env | ||
|
||
# Make required changes to the .env file | ||
|
||
docker compose up --build | ||
``` | ||
|
||
This Compose file will mount your codebase for dynamic updation. | ||
|
||
## Working on the Local System | ||
|
||
If you do not want to use Docker, you can do so by setting up the project locally. Ensure that you fetch the proper environment variables before doing so. | ||
|
||
```shell | ||
set -a | ||
source .env | ||
``` | ||
|
||
Apart from this, you will also have to set the `ENVIRONMENT` variable, which can be set to `DEVELOPMENT`. | ||
|
||
Corpus depends on PostgreSQL. You might have it setup on your local system, or running it as a Docker container. Please make sure that you edit your environment variables accordingly so that proper configurations are set. You may also change the `ENVIRONMENT` to `DEVELOPMENT` to ensure that you have the Django debugging features available. | ||
|
||
The application is a Django app. The recommended approach is to create a Python virtual environment, and setup the project (if you are using `conda`, please refer to that documentation for instructions). | ||
|
||
```sh | ||
python -m venv venv | ||
source venv/bin/activate (on Windows: venv\Scripts\activate) | ||
pip install --upgrade pip | ||
pip install -r requirements.txt | ||
``` | ||
|
||
After installing dependencies, you can setup the Django Project. | ||
|
||
```sh | ||
python manage.py makemigrations | ||
python manage.py migrate | ||
python manage.py createsuperuser | ||
python manage.py runserver | ||
``` |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -20,5 +20,4 @@ | |
|
||
urlpatterns = [ | ||
path("admin/", admin.site.urls), | ||
path("api-auth/", include("rest_framework.urls")), | ||
] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,6 @@ | ||
asgiref==3.7.2 | ||
Django==4.2.4 | ||
gunicorn==21.2.0 | ||
packaging==23.1 | ||
psycopg2==2.9.7 | ||
sqlparse==0.4.4 |
File renamed without changes.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.