Skip to content

Commit

Permalink
Add Project Check changed
Browse files Browse the repository at this point in the history
  • Loading branch information
shiveshcodes committed Oct 14, 2023
2 parents ac92f53 + 41de890 commit a44fc47
Show file tree
Hide file tree
Showing 9 changed files with 221 additions and 164 deletions.
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
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.
59 changes: 58 additions & 1 deletion README.md
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.
47 changes: 47 additions & 0 deletions backend/_scripts/delete_db_files.py
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)
1 change: 1 addition & 0 deletions backend/backend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@
),
path("redoc/", schema_view.with_ui("redoc", cache_timeout=0), name="schema-redoc"),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
37 changes: 37 additions & 0 deletions frontend/src/components/ProjectCard.css
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;
}
14 changes: 7 additions & 7 deletions frontend/src/components/ProjectCard.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from 'react';
import Button from 'react-bootstrap/Button';
import Card from 'react-bootstrap/Card';
import axios from 'axios';
import { useState } from 'react';


function ProjectCard(props) {

function ProjectCard() {
return (
<Card style={{ width: '18rem' }}>
<Card.Img variant="top" src="../../public/logo192.png" />
<Card.Img variant="top" src={props.link} />
<Card.Body>
<Card.Title>Card Title</Card.Title>
<Card.Text>
Some quick example text to build on the card title and make up the
bulk of the card's content.
</Card.Text>
<Card.Title>{props.title}</Card.Title>
<Button variant="primary">Go somewhere</Button>
</Card.Body>
</Card>
Expand Down
122 changes: 0 additions & 122 deletions frontend/src/components/trial.js

This file was deleted.

Loading

0 comments on commit a44fc47

Please sign in to comment.