-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
221 additions
and
164 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,9 @@ | ||
If you would like to contribute to the project, please follow these guidelines: | ||
|
||
1. Fork the repository and create a new branch for your feature or bug fix. | ||
|
||
2. Make the necessary changes and commit them. | ||
|
||
3. Push your changes to your forked repository. | ||
|
||
4. Submit a pull request to the main repository, explaining the changes you made and any additional information that might be helpful for review. |
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,59 @@ | ||
# SoC-Portal | ||
This is the official repository for the SoC Portal Project created by TTY16 | ||
|
||
### Official repository for the SoC Portal Project created by TTY16 | ||
|
||
#### This repository is a part of HelloFOSS '23 | ||
|
||
An on-going project of the Web and Coding Club. | ||
|
||
# Usage | ||
|
||
Clone the Git repository: | ||
|
||
```shell | ||
git clone https://github.com/wncc/SoC-Portal/tree/main | ||
``` | ||
|
||
Install JS packages | ||
|
||
```shell | ||
cd frontend | ||
# npm stuff here | ||
``` | ||
|
||
Create Virtual Environment: | ||
|
||
```shell | ||
cd backend | ||
python3 -m venv .venv | ||
pip3 install -r requirements.txt | ||
``` | ||
|
||
Run Application | ||
|
||
```shell | ||
# Frontend | ||
# Backend (in ./backend/) | ||
python manage.py runserver | ||
``` | ||
|
||
# Documentation | ||
|
||
## Frontend | ||
|
||
## Backend | ||
|
||
The project generates API documentation using [drf-yasg](https://github.com/axnsan12/drf-yasg), provided through Swagger and ReDoc. To access the API documentation, follow these steps: | ||
|
||
Ensure that the project is running by executing the command mentioned in the "Usage" section. | ||
|
||
Open a web browser and navigate to one of the following endpoint: | ||
|
||
```bash | ||
http://127.0.0.1:8000/redoc | ||
http://127.0.0.1:8000/swagger | ||
``` | ||
|
||
# Contributing | ||
|
||
Check out [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on contributing to the repo. |
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,47 @@ | ||
import os | ||
import shutil | ||
from pathlib import Path | ||
|
||
|
||
def delete_migration_files(app_name): | ||
migrations_folder = Path(app_name) / "migrations" | ||
|
||
# Delete all files except '__init__.py' | ||
for file in migrations_folder.iterdir(): | ||
if file.name == "__pycache__": | ||
shutil.rmtree(file.resolve()) | ||
elif file.name != "__init__.py": | ||
file.unlink() | ||
|
||
|
||
def delete_sqlite_db(db_path): | ||
db_path = Path(db_path) | ||
if db_path.exists(): | ||
db_path.unlink() | ||
|
||
|
||
def confirm_action(): | ||
confirmation = input( | ||
"This action will hard-reset all your migrations and delete your database. Are you sure you want to continue? (yes/no): " | ||
).lower() | ||
return confirmation == "yes" | ||
|
||
|
||
if __name__ == "__main__": | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "backend.settings") | ||
if not confirm_action(): | ||
print("Script execution aborted.") | ||
exit() | ||
|
||
# Find Django app names in the current project directory | ||
django_apps = [ | ||
path.parent.parent.name for path in Path(".").glob("**/migrations/__init__.py") | ||
] | ||
|
||
for app_name in django_apps: | ||
# Delete migration files for each app | ||
delete_migration_files(app_name) | ||
|
||
# Delete SQLite DB using a relative path | ||
db_path = "db.sqlite3" # Relative path from the current working directory | ||
delete_sqlite_db(db_path) |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.project-cards { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); | ||
grid-gap: 20px; | ||
} | ||
|
||
.project-card { | ||
background-color: #fff; | ||
border-radius: 10px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
padding: 20px; | ||
} | ||
|
||
.project-card h2 { | ||
font-size: 24px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.project-card p { | ||
font-size: 16px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.project-card button { | ||
background-color: #007bff; | ||
border: none; | ||
border-radius: 5px; | ||
color: #fff; | ||
cursor: pointer; | ||
font-size: 16px; | ||
padding: 10px 20px; | ||
transition: background-color 0.3s ease; | ||
} | ||
|
||
.project-card button:hover { | ||
background-color: #0069d9; | ||
} |
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.
Oops, something went wrong.