Current-ly is a web application focused on helping residents of Tbilisi, Georgia, track and report utility outages. This app empowers users to report issues with power, water, and other utilities by location. It provides real-time updates and notifications, historical data analysis, and helps people make informed choices about where to live based on utility reliability.
- Report Outages: Users can submit outage reports for specific locations or general areas for privacy.
- Real-Time Updates: Users receive notifications when outage statuses change.
- Historical Data: Analyze historical outage data to track reliability by area.
- Location-Based Outage Information: Provides outage details using a map interface to enhance user accessibility.
- Backend: FastAPI, SQLAlchemy, PostgreSQL
- Frontend: React.js
- Database: PostgreSQL (Dockerized)
- Data Storage & Caching: Firebase for notifications, Redis for caching
- Geospatial Data: GeoAlchemy2 to handle location-based data and mapping
- Authentication: JWT-based authentication for secure user access
- Containerization: Docker for PostgreSQL and potentially the full app stack
- Python (3.12+)
- Docker (for PostgreSQL setup)
- Node.js
- Redis
-
Clone the Repository
git clone https://github.com/M-Studley/current-ly_backend.git cd Current-ly
-
Backend Setup
- Create a virtual environment:
python3 -m venv env source env/bin/activate # On Windows, use `env\Scripts\activate`
- Install backend dependencies:
pip install -r requirements.txt
- Apply database migrations:
alembic upgrade head
- Create a virtual environment:
-
Run Dockerized PostgreSQL
docker-compose up -d
-
Frontend Setup (if applicable)
cd frontend npm install npm start
Create an .env
file at the root with the following settings:
DATABASE_URL=postgresql://user:password@localhost:(desired port #)/currently
JWT_SECRET_KEY=your_jwt_secret
FIREBASE_CONFIG=your_firebase_config
REDIS_URL=redis://localhost:(desired port #)/0
-
Backend Server:
uvicorn app.main:app --reload
-
Frontend Server (if using React):
cd frontend npm start
- Visit the app’s home page to view current outages or report a new one.
- Use the map interface to view or report outages by specific or general locations.
- Receive real-time updates on outage resolutions.
- Implement more detailed outage history analytics
- User role-based access for administrators and verified reporters
- Expand utility tracking and add user notification preferences
This project is licensed under the MIT License.
/current-ly/ │ ├── alembic/ │ ├── versions/ │ │ └── ... │ ├── env.py │ ├── README │ └── script.py.mako │ ├── app/ │ ├── api/ │ │ └── routes/ │ │ │ ├── db/ │ │ ├── init.py │ │ ├── pg_connection.py │ │ └── redis_connection.py │ │ │ ├── models/ │ │ ├── init.py │ │ ├── base.py │ │ ├── location.py │ │ ├── notification.py │ │ ├── outage.py │ │ ├── outage_report.py │ │ └── user.py │ │ │ ├── schemas/ │ │ ├── init.py │ │ ├── base.py │ │ ├── location.py │ │ ├── notification.py │ │ ├── outage.py │ │ ├── outage_report.py │ │ └── user.py │ │ │ ├── services/ │ │ ├── init.py │ │ ├── base.py │ │ ├── location.py │ │ ├── notification.py │ │ ├── outage.py │ │ ├── outage_report.py │ │ └── user.py │ │ │ ├── utils/ │ │ │ ├── init.py │ ├── config.py │ └── main.py │ ├── tests/ │ ├── init.py │ ├── test_api.py │ ├── test_helpers.py │ ├── test_pg_db.py │ └── test_redis_db.py │ ├── .env ├── .gitignore ├── pytest.ini ├── README.md └── requirements.txt