Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Oroshine

A flask application with mySQL database

πŸš€ Quick Start

Choose your preferred setup method:

πŸ“‹ Prerequisites

For Local Development

  • Python 3.8+
  • pip (Python package installer)
  • PostgreSQL
  • Git

For Docker Deployment

  • Docker & Docker Compose
  • Git

πŸ› οΈ Local Development Setup

1. Clone Repository

git https://github.com/Rohan123code/EDUINTEL
cd EDUINTEL/server

2. Create Virtual Environment

Linux/macOS:

python3 -m venv .aipdf
source env/bin/activate

Windows:

python -m venv .aipdf
.\aipdf\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Environment Configuration

Create a .env file in the project root:

# Database Configuration
PPERPLEXITY_API_KEY = ****

GOOGLE_API_KEY = ****

CLOUD_NAME=****

CLOUD_API_KEY=****

CLOUD_API_SECRET=****

MYSQL_HOST=localhost
MYSQL_USER=admin
MYSQL_PASSWORD=admin123
MYSQL_DB=ragdb

5. Database Setup

Linux/macOS:

# Start PostgreSQL and create database
sudo mysql -u root -p

Windows:

# Open pgAdmin or use psql from PostgreSQL installation
mysql -u root -p

In PostgreSQL shell:

CREATE DATABASE ragdb;
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin123';
GRANT ALL PRIVILEGES ON ragdb.* TO 'admin'@'localhost';
FLUSH PRIVILEGES;
\q

6. Django Setup

# Create Django app (if needed)
python manage.py startapp oroshine_webapp

# Run migrations
python manage.py makemigrations
python manage.py migrate

# Create admin user
python manage.py createsuperuser

7. Run Development Server

python manage.py runserver

🌐 Access your application:

🐳 Docker Deployment

1. Environment Setup for Docker

Update your .env file for Docker (change database host):

# Database Configuration (Docker)
PG_DB=oroshine
PG_USER=postgres
PG_PASSWORD=postgres
PG_HOST=db
PG_PORT=5432

# Django Configuration
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1,0.0.0.0

# Email Configuration
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-app-password

# Calendar Integration
NOCODEAPI_CALENDAR_URL=https://v1.nocodeapi.com/your-username/calendar/your-api-key

2. Build and Run

Linux/macOS:

# Build and start services
sudo docker-compose up --build

# Run in background
sudo docker-compose up --build -d

Windows:

# Build and start services
docker-compose up --build

# Run in background
docker-compose up --build -d

3. Docker Management

Stop services:

docker-compose down

Complete cleanup:

# Stop and remove everything
docker-compose down -v
docker system prune -af

View logs:

docker-compose logs web
docker-compose logs db

Execute commands in container:

docker-compose exec web python manage.py createsuperuser

πŸ“ Project Structure

oroshine/
β”œβ”€β”€ oroshine_app/          # Main Django project
β”‚   β”œβ”€β”€ settings.py        # Django settings
β”‚   β”œβ”€β”€ urls.py           # URL routing
β”‚   └── wsgi.py           # WSGI configuration
β”œβ”€β”€ oroshine_webapp/       # Django application
β”‚   β”œβ”€β”€ models.py         # Database models
β”‚   β”œβ”€β”€ views.py          # View functions
β”‚   β”œβ”€β”€ urls.py           # App URLs
β”‚   └── templates/        # HTML templates
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ docker-compose.yml     # Docker services
β”œβ”€β”€ Dockerfile            # Docker image config
β”œβ”€β”€ .env                  # Environment variables
└── README.md             # Documentation

πŸ—“οΈ Google Calendar Integration Setup

1. Create NoCodeAPI Account

  1. Visit NoCodeAPI.com
  2. Sign up or log in
  3. Verify your email

2. Setup Google Calendar Integration

  1. Create API: Dashboard β†’ "Create New API" β†’ "Google Calendar"
  2. Connect Google: Sign in and grant calendar permissions
  3. Configure: Set API name and permissions (Read/Write)
  4. Get Endpoint: Copy your unique API URL

3. Update Environment

Add the API URL to your .env file:

NOCODEAPI_CALENDAR_URL=https://v1.nocodeapi.com/your-username/calendar/your-api-key

4. Test Connection

curl -X GET "https://v1.nocodeapi.com/your-username/calendar/your-api-key/events"

πŸ“§ Email Configuration

Gmail Setup

  1. Enable 2FA: Go to Google Account β†’ Security β†’ 2-Step Verification
  2. Generate App Password: Security β†’ App passwords β†’ Generate
  3. Update .env: Use the generated app password (not your Gmail password)

πŸ”§ Troubleshooting

Database Issues

# Reset migrations
python manage.py migrate --fake-initial

# Check database connection
python manage.py dbshell

Docker Issues

# Check running containers
docker ps

# Check logs for errors
docker-compose logs

# Restart services
docker-compose restart

Common Solutions

Issue Solution
Port 8000 in use Kill process: lsof -ti:8000 | xargs kill -9 (Linux/macOS)
Permission denied Use sudo for Docker commands (Linux)
Database connection failed Check PostgreSQL service status
Migration errors Delete migration files and recreate

🌟 Key Features

  • PostgreSQL Integration - Robust database with Django ORM
  • Email System - SMTP configuration for notifications
  • Calendar Sync - Google Calendar integration via NoCode API
  • Admin Interface - Django admin panel for management
  • Cross-Platform - Works on Linux, macOS, and Windows
  • Docker Ready - Containerized deployment option

πŸ“ Development Notes

  • Never commit .env files to version control
  • Use strong secret keys in production
  • Set DEBUG=False for production
  • Regularly backup your database
  • Monitor API usage limits for NoCode Calendar

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages