A Django web application for institutions (companies, schools) to manage their internal network: devices, events, reports, and role-based user access.
See prd.md for the full project brief.
| Area | Status |
|---|---|
| Auth (register/login/logout/password reset), profile | Working |
| Role-based access control (Admin / Manager / Employee) | Working |
| Device management (create/read/update/delete) | Working |
| Event logging (auto-logged on device changes and login/logout/failed login) | Working |
| Reports (generation, CSV/PDF export) | Not implemented yet -- listing only |
| REST API | Scaffolding only, no live endpoints |
| Automated tests | Not written yet |
- Backend: Django 5, Django REST Framework, Simple JWT
- Database: SQLite (development), PostgreSQL (production)
- Auth: Django's built-in auth + Google OAuth2 (
social-auth) - Frontend: Django templates, Tailwind CSS, vanilla JavaScript
Prerequisites:
- Python 3.10+
- pip
Steps:
-
Clone the repository:
git clone https://github.com/alanhasn/INMS.git cd INMS -
Create and activate a virtual environment:
python -m venv venv # Windows: venv\Scripts\activate # macOS/Linux: source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt -
Create your local environment file:
cp .env.example .envThen fill in
.envwith real values -- see .env.example for what each variable is for. At minimum, for local development you need:-DJANGO_SETTINGS_MODULE=config.settings.devDJANGO_SECRET_KEY-- generate one with:python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"client_id/client_secret(Google OAuth2 -- required even if you don't use social login; see note below)EMAIL_HOST_USER/EMAIL_HOST_PASSWORD(used for password reset emails)
-
Run migrations:
python manage.py migrate -
Create a superuser:
python manage.py createsuperuserNew users default to the
Employeerole. To use an Admin/Manager account, setroleon your superuser via/admin/after creating it. -
Run the development server:
python manage.py runserver
Note:
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY/SECRETare read unconditionally at settings-import time (config/settings/base.py), soclient_id/client_secretmust be set in.enveven if you don't intend to use Google login yet -- any placeholder string works for that case.
- Local development uses SQLite by default (no separate DB server required).
config/settings/dev.pypointsDATABASESatdb.sqlite3in the project root. - Production is expected to use PostgreSQL. Configure the connection with the
environment variables
DB_NAME,DB_USER,DB_PASSWORD,DB_HOST, andDB_PORT(read inconfig/settings/prod.py).
- Access the application at http://localhost:8000
- Use the admin panel at http://localhost:8000/admin
- Login with the superuser credentials created during installation
config/settings/prod.py sets DEBUG = False and reads ALLOWED_HOSTS (comma-separated)
plus HTTPS-related security settings from the environment -- see
.env.example. Before deploying, run:
python manage.py check --deploy
and resolve anything it flags.
See CONTRIBUTING.md for how to set up your dev environment, coding conventions, and how to submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details
For any questions or suggestions, please open an issue or contact:
- Email: vorsynth1987@gmail.com
- GitHub: https://github.com/alanhasn