Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secret-Note-MVC #1

Merged
merged 42 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1205970
feat: initialize the django project
RawanMostafa08 Oct 7, 2024
cf4c054
trial: Making my first django app: Mapping urls to views in a simple …
RawanMostafa08 Oct 7, 2024
5a37589
trial: Making my first django app: using templates
RawanMostafa08 Oct 8, 2024
9f128a0
trial: Making my first django app: configuring django debug toolbar
RawanMostafa08 Oct 9, 2024
c75704c
trial: Making my first django app: configuring django debug toolbar: …
RawanMostafa08 Oct 9, 2024
9ff1742
feat: adding Note db model
RawanMostafa08 Oct 9, 2024
c6d881d
fix: adding on delete to user foreign key
RawanMostafa08 Oct 9, 2024
1e92b6a
feat: Adding view for view_note
RawanMostafa08 Oct 9, 2024
7ef6bd1
feat: adding a form for note creation
RawanMostafa08 Oct 14, 2024
68656e1
feat: Authentication added : sign up, login
RawanMostafa08 Oct 14, 2024
6b96fda
feat: Adding feature to view the notes created by this user
RawanMostafa08 Oct 14, 2024
2636ffe
feat: Adding homepage view and template
RawanMostafa08 Oct 14, 2024
bf401d0
fix: change the notes template layout
RawanMostafa08 Oct 16, 2024
da8c399
feat: implementing the note deletion logic on number of views and exp…
RawanMostafa08 Oct 16, 2024
65bcf8c
feat: style: adding style for login form
RawanMostafa08 Oct 16, 2024
f391c11
feat: style: adding style for login form
RawanMostafa08 Oct 16, 2024
b26b52e
feat: style: adding style for home page
RawanMostafa08 Oct 16, 2024
055835c
feat: style: adding style for user_notes page
RawanMostafa08 Oct 16, 2024
8d9d174
fix: style: fixing html of for user_notes page buttons
RawanMostafa08 Oct 16, 2024
e2d4e88
feat: style: adding style for create_note page
RawanMostafa08 Oct 16, 2024
dc5707c
feat: style: adding style for view_note page
RawanMostafa08 Oct 16, 2024
dceaa9d
fix: style: fixing note content overflow ui issue
RawanMostafa08 Oct 16, 2024
6003b54
test: Adding unit tests for signup
RawanMostafa08 Oct 16, 2024
30650ac
test: Adding unit tests for login
RawanMostafa08 Oct 16, 2024
55f1870
Remove tracked files and update .gitignore
RawanMostafa08 Oct 17, 2024
b087719
Remove .vscode
RawanMostafa08 Oct 17, 2024
6dc1848
test: Adding unit test for correct note creation
RawanMostafa08 Oct 17, 2024
46d4626
chore: updating .gitignore
RawanMostafa08 Oct 17, 2024
6cd26c9
test: Adding unit testcase for note deletion after maximum views
RawanMostafa08 Oct 17, 2024
bb7a650
test: Adding unit tests for expiration of a note
RawanMostafa08 Oct 17, 2024
525e3cf
test: Adding unit tests for signup rate limiting
RawanMostafa08 Oct 17, 2024
91ce464
feat: Adding rate limiting for signup and create note with their tests
RawanMostafa08 Oct 17, 2024
f495153
fix: fixing expiration logic and unit tests
RawanMostafa08 Oct 17, 2024
532991a
test: Integration tests: Adding signup testcases
RawanMostafa08 Oct 19, 2024
519308e
test: Integration tests: Adding login testcases
RawanMostafa08 Oct 19, 2024
bc83093
test: Integration tests: Adding create note testcases
RawanMostafa08 Oct 19, 2024
a3feb36
test: Integration tests: Adding deletion test on maximum views
RawanMostafa08 Oct 19, 2024
f787703
chore: adding docker file and docker compose to deploy the app
RawanMostafa08 Oct 19, 2024
c9d3916
chore: github workflow file, fixing the tests to use the ststic live …
RawanMostafa08 Oct 20, 2024
e70cdfc
fix: github workflow test issues fixed
RawanMostafa08 Oct 20, 2024
cf45251
fix: github workflow test issues fixed by adding headless option
RawanMostafa08 Oct 20, 2024
042611e
chore: adding user documentation in README file
RawanMostafa08 Oct 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading