Skip to content

Commit

Permalink
Merge pull request #1 from codescalersinternships/development
Browse files Browse the repository at this point in the history
Secret-Note-MVC
  • Loading branch information
xmonader authored Jan 13, 2025
2 parents 965ce4b + 042611e commit b523109
Show file tree
Hide file tree
Showing 37 changed files with 1,498 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Django CI/CD

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
cd SecretNote
pip install -r requirements.txt
cd ..
- name: Run Tests
run: |
cd SecretNote
python manage.py test
cd ..
91 changes: 91 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Created by https://www.gitignore.io

### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo
*.pot

# Sphinx documentation
docs/_build/

# PyBuilder
target/


### Django ###
*.log
*.pot
*.pyc
__pycache__/
local_settings.py

.env
db.sqlite3
.vscode
SecretNote/*/migrations
13 changes: 13 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = "*"
django-debug-toolbar = "*"

[dev-packages]

[requires]
python_version = "3.10"
63 changes: 63 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
# Secret-Note-MVC-Rawan-Mostafa
# Secret-Note Application

This repository implements a Secret Note Sharing Application, it's a web application that allows users to securely share self-destructing secret notes.

The notes are created with a random url that can't be easily guessed, has self destruction feature using maximum views or expiration time

## Table of Contents

- [features](#features)
- [Installation](#installation)
- [Usage](#usage)

## Features
- Note Creation :

- Users can create a note with text content
- Generate a unique, secure URL for each note
- Set an expiration time or number of views before destruction
- Note Retrieval :

- Users can view a note using the unique URL
- After viewing or upon expiration, the note is permanently deleted
- Security Features:

- We use secure random generation for URLs so that the urls aren't predictable

## Installation

Clone the repository

```bash
git clone https://github.com/codescalersinternships/Secret-Note-MVC-Rawan-Mostafa.git
```

## Usage
Run the docker container using docker-compose
```bash
docker-compose up
```
You'll then find the url of your app printed in the terminal, and here you go you can signup and start making notes securely!

![alt text](image.png)
14 changes: 14 additions & 0 deletions SecretNote/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.10
ENV PYTHONUNBUFFERED=1

WORKDIR /code

COPY requirements.txt .

RUN pip install -r requirements.txt

COPY . .

EXPOSE 8000

CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
Empty file.
16 changes: 16 additions & 0 deletions SecretNote/SecretNote/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for SecretNote project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'SecretNote.settings')

application = get_asgi_application()
Loading

0 comments on commit b523109

Please sign in to comment.