Logo Lanfrica

Fidelengiriyumva/weather-app

Domain:

natural language processing

Record type:

software
Creator:
Fid
Host:
uganda web based application for weather forecasting # Weather App — Setup & Portability Guide This README explains how to prepare and run the app on a different computer so the DB and app run with minimal effort. ## Quick start 1. Copy `.env.example` to `.env` and fill values: - Either set `DATABASE_URL` (a single connection string) OR set `DB_USER`, `DB_PASSWORD`, `DB_HOST`, `DB_PORT` and `DB_NAME`. - Set `API_KEY` (OpenWeather API key) and `SESSION_SECRET`. 2. Install dependencies: ```bash npm install ``` 3. Setup the PostgreSQL database (local setups only): ```bash npm run setup-db ``` This script connects to the default `postgres` database and creates the database named by `DB_NAME`. 4. Start the server: ```bash npm start # or for development with automatic restart npm run dev ``` 5. Open localhost and register an account. ## Run with Docker Compose (one-command) ## Language support / translations This app now includes translations for English (default), Luganda (`lg`) and Runyankore (`nyn`). How to switch language: - Use the language links on the pages or append `?lang=lg` or `?lang=nyn` to the URL (e.g. `/register?lang=lg`). - Language selection is saved in a cookie so the app will remember your choice. Translation files live under the `locales/` folder — add or tweak keys in `locales/*.json`. You can run the app + Postgres locally using Docker Compose. This is the most portable way to share the app across machines. 1. Ensure Docker Engine and Docker Compose are installed on your machine. 2. Copy `.env.example` to `.env` and set values for `API_KEY` and `SESSION_SECRET`. - By default compose uses the `DB_USER`, `DB_PASSWORD`, `DB_NAME` variables declared in `.env` (or uses defaults). 3. Start everything: ```bash npm run docker:up # or build + start by hand docker compose up -d --build ``` 4. Stop and remove containers: ```bash npm run docker:down # or docker compose down ``` ## Notes for portability …