Skip to content

RansfordGenesis/Access_Key_Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ACCESS KEY MANAGER

Deployed Application

The Access Key Manager is deployed and accessible at the following link:

Access Key Manager - Deployed Application

LINK: https://access-key-manager-mtco.onrender.com/


A Take-Home Project

πŸ“ Table of Contents

Todo

See TODO

🎲About

Access Key Manager is a web application designed for managing multi-tenant access keys, especially for school management platforms. The application includes features like user registration, email verification, password reset, and key management. It is built using these technologies.

🏁 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Postgres: A relational database(or your preferred database).
  • Python 3.10^: The Python programming language.
  • Django 5.0 or higher
  • Courier: For email services
  • AutoPEP8: An auto-formatter for Python code.

Setting up a development environment

Step 1: Clone the repository

https://github.com/RansfordGenesis/Access_Key_Manager.git

or with GithubCLI

gh repo clone RansfordGenesis/Access_Key_Manager

step 2: Create a virtual environment

python -m venv venv

OR by using the virtualenvwrapper

  mkvirtualenv venv

Activate the virtual environment with

source venv/bin/activate  # On Windows use `venv\Scripts\activate`

Step 3: Install dependencies

pip install -r requirements.txt

Note to add a package to the project, run

pip install <package-name>

Step 4: Create a .env file in the project's root directory and add the following environment variables, replacing the placeholders with your specific values:

# Postgres env
DB_NAME = #eg. key_manager
DB_USER = #e.g postgres
DB_PASSWORD = #e.g password123
DB_HOST = #e.g localhost
DB_PORT = #e.g 5432


SECRET= #notasecretkey

# Email env
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = #Email account
EMAIL_HOST_PASSWORD = #Email Password

# Courier env
COURIER_TOKEN = #API Token
ACTIVATE_TEMPLATE = #Activate Mail Template
RESET_TEMPLATE =  #Reset Mail Template

ADMIN_EMAIL = #Superuser email
ADMIN_PASSWORD = #Superuser password

Note to uncomment postgres database in settings.py

Step 5: Apply database migrations

    python manage.py migrate

Step 6: Create a superuser

    python manage.py createsuperuser

or with command script

    python manage.py createsu

Step 7: Run the development server

    python manage.py runserver

βš™οΈ Project Structure

Access_Key_Manager
β”œβ”€ .gitignore
β”œβ”€ Access_Key_Manager
β”‚  β”œβ”€ asgi.py
β”‚  β”œβ”€ settings.py
β”‚  β”œβ”€ urls.py
β”‚  β”œβ”€ wsgi.py
β”‚  └─ __init__.py
β”œβ”€ build.sh
β”œβ”€ key_manager
β”‚  β”œβ”€ admin.py
β”‚  β”œβ”€ apps.py
β”‚  β”œβ”€ migrations
β”‚  β”‚  β”œβ”€ 0001_initial.py
β”‚  β”‚  β”œβ”€ 0002_accesskey_key_alter_accesskey_date_of_procurement_and_more.py
β”‚  β”‚  β”œβ”€ 0003_alter_accesskey_key.py
β”‚  β”‚  └─ __init__.py
β”‚  β”œβ”€ models.py
β”‚  β”œβ”€ templates
β”‚  β”‚  └─ key_manager
β”‚  β”‚     β”œβ”€ base.html
β”‚  β”‚     └─ home.html
β”‚  β”œβ”€ tests.py
β”‚  β”œβ”€ urls.py
β”‚  β”œβ”€ views.py
β”‚  └─ __init__.py
β”œβ”€ manage.py
β”œβ”€ README.md
β”œβ”€ requirements.txt
└─ users
   β”œβ”€ admin.py
   β”œβ”€ apps.py
   β”œβ”€ forms.py
   β”œβ”€ management
   β”‚  └─ commands
   β”‚     └─ createsu.py
   β”œβ”€ migrations
   β”‚  β”œβ”€ 0001_initial.py
   β”‚  └─ __init__.py
   β”œβ”€ models.py
   β”œβ”€ templates
   β”‚  └─ users
   β”‚     β”œβ”€ account_activated.html
   β”‚     β”œβ”€ account_activation_invalid.html
   β”‚     β”œβ”€ account_activation_sent.html
   β”‚     β”œβ”€ account_already_verified.html
   β”‚     β”œβ”€ login.html
   β”‚     β”œβ”€ password_reset.html
   β”‚     β”œβ”€ password_reset_complete.html
   β”‚     β”œβ”€ password_reset_confirm.html
   β”‚     β”œβ”€ password_reset_done.html
   β”‚     β”œβ”€ password_reset_email.html
   β”‚     β”œβ”€ password_reset_subject.txt
   β”‚     └─ signup.html
   β”œβ”€ tests.py
   β”œβ”€ tokens.py
   β”œβ”€ utils.py
   β”œβ”€ views.py
   └─ __init__.py

✏️ER Diagram

Below is the ER diagram for the Access Key Manager project:

ER Diagram

🎈 Usage

User Registration and Email Verification

  1. Sign Up

    • Users can sign up using their email and password.
    • After signing up, an email will be sent to the user to verify their account.
  2. Email Verification

    • Users need to click the link sent to their email to verify their account.
    • Once verified, they can log in to the system.

Access Key Management

  1. Requesting a Key

    • Normal users can request a new access key(only if no active key exists).
    • Admins can manage all the access keys.
  2. Viewing Keys

    • Admins can view all the access keys in a paginated format, grouped by user email.
    • Users can view details and status of their access keys.
  3. Revoking Keys

    • Admins can revoke keys that are currently active.
  4. Expiration of Keys

    • Home function checks for expired keys and changes it's status.
  5. API endpoint

    • The application has an endpoint to check active key details by school email.

⛏️ Built Using

  • Django: The web framework used for building the application.
  • PostgreSQL: The database used for storing user and key information.
  • Bootstrap: The frontend framework for styling and responsive design.
  • Courier: For sending email notifications.
  • Render: For hosting the application.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors