diff --git a/.env.TEMPLATE b/.env.TEMPLATE new file mode 100644 index 0000000..c34971f --- /dev/null +++ b/.env.TEMPLATE @@ -0,0 +1,9 @@ +RUST_LOG=debug,actix=warn,diesel_migrations=warn,reqwest=warn,hyper=warn +DATABASE_CONTAINER=weather-db +DATABASE_HOST=db +DATABASE_USER= +DATABASE_PASSWORD= +DATABASE_NAME=weather +DATABASE_PORT=5432 +SERVICE_HOST=localhost +SERVICE_PORT=5000 \ No newline at end of file diff --git a/weather-service/Makefile b/Makefile similarity index 85% rename from weather-service/Makefile rename to Makefile index 22a9c81..eb9690a 100644 --- a/weather-service/Makefile +++ b/Makefile @@ -21,13 +21,7 @@ down: ## Stop Docker service containers docker compose down connect: ## Connect to the Weather DB - docker exec -it aviation_weather_db psql -U postgres - -lint: ## Run the linter - npm run lint - -clean: ## Clean up the service - rm -rf target + docker exec -it ${DATABASE_CONTAINER} psql -U postgres clean-db: ## Remove database docker exec -i ${DATABASE_CONTAINER} sh -c 'PGPASSWORD=${DATABASE_PASSWORD} psql -U ${DATABASE_USER} -d postgres -c "DROP DATABASE IF EXISTS \"${DATABASE_NAME}\";"' diff --git a/README.md b/README.md index 73b30a9..ae7b2b4 100755 --- a/README.md +++ b/README.md @@ -1,24 +1,4 @@ # Aviation Weather -# Getting Started -The main installed packages are the following: -- [Next.js](https://nextjs.org/docs) -- [ESLint](https://eslint.org/docs/latest/rules/) -- [Typescript](https://www.typescriptlang.org/docs/) - -ESLint rules can be configured in the `.eslintrc.json` file. -Prettier rules can be configured in the `.prettierrc.json` file. -TypeScript rules can be configured in the `.tsconfig.json` file. - -Next.js (React Framework) -- [Next.js Project Structure](https://nextjs.org/docs/getting-started/project-structure) -- [Next.js App Routing](https://nextjs.org/docs/app/building-your-application/routing) -- [Next.js Pages Routing](https://nextjs.org/docs/pages/building-your-application/routing) - -Redux -- [Getting Started](https://redux.js.org/introduction/getting-started) -- [Code Structure](https://redux.js.org/faq/code-structure) -- [React Redux](https://redux.js.org/faq/react-redux) - ## Makefile `make help` to list all commands \ No newline at end of file diff --git a/weather-service/docker-compose.yml b/docker-compose.yml similarity index 96% rename from weather-service/docker-compose.yml rename to docker-compose.yml index fb49d06..1807c4b 100644 --- a/weather-service/docker-compose.yml +++ b/docker-compose.yml @@ -25,7 +25,7 @@ services: ports: - "${SERVICE_PORT}:${SERVICE_PORT}" build: - context: ./ + context: service depends_on: - db restart: unless-stopped diff --git a/weather-service/Cargo.lock b/service/Cargo.lock similarity index 100% rename from weather-service/Cargo.lock rename to service/Cargo.lock diff --git a/weather-service/Cargo.toml b/service/Cargo.toml similarity index 100% rename from weather-service/Cargo.toml rename to service/Cargo.toml diff --git a/weather-service/README.md b/service/README.md similarity index 100% rename from weather-service/README.md rename to service/README.md diff --git a/weather-service/airport-codes.json b/service/airport-codes.json similarity index 100% rename from weather-service/airport-codes.json rename to service/airport-codes.json diff --git a/weather-service/diesel.toml b/service/diesel.toml similarity index 100% rename from weather-service/diesel.toml rename to service/diesel.toml diff --git a/weather-service/migrations/000000_create_airports/down.sql b/service/migrations/000000_create_airports/down.sql similarity index 100% rename from weather-service/migrations/000000_create_airports/down.sql rename to service/migrations/000000_create_airports/down.sql diff --git a/weather-service/migrations/000000_create_airports/up.sql b/service/migrations/000000_create_airports/up.sql similarity index 100% rename from weather-service/migrations/000000_create_airports/up.sql rename to service/migrations/000000_create_airports/up.sql diff --git a/weather-service/migrations/000001_create_metars/down.sql b/service/migrations/000001_create_metars/down.sql similarity index 100% rename from weather-service/migrations/000001_create_metars/down.sql rename to service/migrations/000001_create_metars/down.sql diff --git a/weather-service/migrations/000001_create_metars/up.sql b/service/migrations/000001_create_metars/up.sql similarity index 100% rename from weather-service/migrations/000001_create_metars/up.sql rename to service/migrations/000001_create_metars/up.sql diff --git a/weather-service/migrations/000002_create_users/down.sql b/service/migrations/000002_create_users/down.sql similarity index 100% rename from weather-service/migrations/000002_create_users/down.sql rename to service/migrations/000002_create_users/down.sql diff --git a/weather-service/migrations/000002_create_users/up.sql b/service/migrations/000002_create_users/up.sql similarity index 100% rename from weather-service/migrations/000002_create_users/up.sql rename to service/migrations/000002_create_users/up.sql diff --git a/weather-service/src/airports/mod.rs b/service/src/airports/mod.rs similarity index 100% rename from weather-service/src/airports/mod.rs rename to service/src/airports/mod.rs diff --git a/weather-service/src/airports/model.rs b/service/src/airports/model.rs similarity index 100% rename from weather-service/src/airports/model.rs rename to service/src/airports/model.rs diff --git a/weather-service/src/airports/routes.rs b/service/src/airports/routes.rs similarity index 100% rename from weather-service/src/airports/routes.rs rename to service/src/airports/routes.rs diff --git a/weather-service/src/auth/mod.rs b/service/src/auth/mod.rs similarity index 100% rename from weather-service/src/auth/mod.rs rename to service/src/auth/mod.rs diff --git a/weather-service/src/db.rs b/service/src/db.rs similarity index 100% rename from weather-service/src/db.rs rename to service/src/db.rs diff --git a/weather-service/src/error_handler.rs b/service/src/error_handler.rs similarity index 100% rename from weather-service/src/error_handler.rs rename to service/src/error_handler.rs diff --git a/weather-service/src/main.rs b/service/src/main.rs similarity index 100% rename from weather-service/src/main.rs rename to service/src/main.rs diff --git a/weather-service/src/metars/mod.rs b/service/src/metars/mod.rs similarity index 100% rename from weather-service/src/metars/mod.rs rename to service/src/metars/mod.rs diff --git a/weather-service/src/metars/model.rs b/service/src/metars/model.rs similarity index 100% rename from weather-service/src/metars/model.rs rename to service/src/metars/model.rs diff --git a/weather-service/src/metars/routes.rs b/service/src/metars/routes.rs similarity index 100% rename from weather-service/src/metars/routes.rs rename to service/src/metars/routes.rs diff --git a/weather-service/src/schema.rs b/service/src/schema.rs similarity index 100% rename from weather-service/src/schema.rs rename to service/src/schema.rs diff --git a/weather-service/src/users/mod.rs b/service/src/users/mod.rs similarity index 100% rename from weather-service/src/users/mod.rs rename to service/src/users/mod.rs diff --git a/weather-service/src/users/model.rs b/service/src/users/model.rs similarity index 100% rename from weather-service/src/users/model.rs rename to service/src/users/model.rs diff --git a/weather-service/src/users/routes.rs b/service/src/users/routes.rs similarity index 100% rename from weather-service/src/users/routes.rs rename to service/src/users/routes.rs diff --git a/weather-service/src/users/user_type.rs b/service/src/users/user_type.rs similarity index 100% rename from weather-service/src/users/user_type.rs rename to service/src/users/user_type.rs diff --git a/weather-ui/.eslintrc.json b/ui/.eslintrc.json similarity index 100% rename from weather-ui/.eslintrc.json rename to ui/.eslintrc.json diff --git a/weather-ui/.prettierrc.json b/ui/.prettierrc.json similarity index 100% rename from weather-ui/.prettierrc.json rename to ui/.prettierrc.json diff --git a/weather-ui/Cargo.lock b/ui/Cargo.lock similarity index 100% rename from weather-ui/Cargo.lock rename to ui/Cargo.lock diff --git a/weather-ui/Makefile b/ui/Makefile similarity index 100% rename from weather-ui/Makefile rename to ui/Makefile diff --git a/weather-ui/next-env.d.ts b/ui/next-env.d.ts similarity index 100% rename from weather-ui/next-env.d.ts rename to ui/next-env.d.ts diff --git a/weather-ui/next.config.js b/ui/next.config.js similarity index 100% rename from weather-ui/next.config.js rename to ui/next.config.js diff --git a/weather-ui/package.json b/ui/package.json similarity index 100% rename from weather-ui/package.json rename to ui/package.json diff --git a/weather-ui/postcss.config.js b/ui/postcss.config.js similarity index 100% rename from weather-ui/postcss.config.js rename to ui/postcss.config.js diff --git a/weather-ui/public/favicon.ico b/ui/public/favicon.ico similarity index 100% rename from weather-ui/public/favicon.ico rename to ui/public/favicon.ico diff --git a/weather-ui/public/layers-2x.png b/ui/public/layers-2x.png similarity index 100% rename from weather-ui/public/layers-2x.png rename to ui/public/layers-2x.png diff --git a/weather-ui/public/layers.png b/ui/public/layers.png similarity index 100% rename from weather-ui/public/layers.png rename to ui/public/layers.png diff --git a/weather-ui/public/marker-icon-2x.png b/ui/public/marker-icon-2x.png similarity index 100% rename from weather-ui/public/marker-icon-2x.png rename to ui/public/marker-icon-2x.png diff --git a/weather-ui/public/marker-icon.png b/ui/public/marker-icon.png similarity index 100% rename from weather-ui/public/marker-icon.png rename to ui/public/marker-icon.png diff --git a/weather-ui/public/marker-shadow.png b/ui/public/marker-shadow.png similarity index 100% rename from weather-ui/public/marker-shadow.png rename to ui/public/marker-shadow.png diff --git a/weather-ui/public/vercel.svg b/ui/public/vercel.svg similarity index 100% rename from weather-ui/public/vercel.svg rename to ui/public/vercel.svg diff --git a/weather-ui/src/api/airport.ts b/ui/src/api/airport.ts similarity index 100% rename from weather-ui/src/api/airport.ts rename to ui/src/api/airport.ts diff --git a/weather-ui/src/api/airport.types.ts b/ui/src/api/airport.types.ts similarity index 100% rename from weather-ui/src/api/airport.types.ts rename to ui/src/api/airport.types.ts diff --git a/weather-ui/src/api/index.ts b/ui/src/api/index.ts similarity index 100% rename from weather-ui/src/api/index.ts rename to ui/src/api/index.ts diff --git a/weather-ui/src/api/metar.ts b/ui/src/api/metar.ts similarity index 100% rename from weather-ui/src/api/metar.ts rename to ui/src/api/metar.ts diff --git a/weather-ui/src/api/metar.types.ts b/ui/src/api/metar.types.ts similarity index 100% rename from weather-ui/src/api/metar.types.ts rename to ui/src/api/metar.types.ts diff --git a/weather-ui/src/app/airport/[icao]/page.tsx b/ui/src/app/airport/[icao]/page.tsx similarity index 100% rename from weather-ui/src/app/airport/[icao]/page.tsx rename to ui/src/app/airport/[icao]/page.tsx diff --git a/weather-ui/src/app/layout.tsx b/ui/src/app/layout.tsx similarity index 100% rename from weather-ui/src/app/layout.tsx rename to ui/src/app/layout.tsx diff --git a/weather-ui/src/app/page.tsx b/ui/src/app/page.tsx similarity index 100% rename from weather-ui/src/app/page.tsx rename to ui/src/app/page.tsx diff --git a/weather-ui/src/app/profile/page.tsx b/ui/src/app/profile/page.tsx similarity index 100% rename from weather-ui/src/app/profile/page.tsx rename to ui/src/app/profile/page.tsx diff --git a/weather-ui/src/app/recoil-root-wrapper.tsx b/ui/src/app/recoil-root-wrapper.tsx similarity index 100% rename from weather-ui/src/app/recoil-root-wrapper.tsx rename to ui/src/app/recoil-root-wrapper.tsx diff --git a/weather-ui/src/components/Metars/MapTiles.tsx b/ui/src/components/Metars/MapTiles.tsx similarity index 100% rename from weather-ui/src/components/Metars/MapTiles.tsx rename to ui/src/components/Metars/MapTiles.tsx diff --git a/weather-ui/src/components/Metars/MetarMap.tsx b/ui/src/components/Metars/MetarMap.tsx similarity index 100% rename from weather-ui/src/components/Metars/MetarMap.tsx rename to ui/src/components/Metars/MetarMap.tsx diff --git a/weather-ui/src/components/Metars/MetarModal.tsx b/ui/src/components/Metars/MetarModal.tsx similarity index 100% rename from weather-ui/src/components/Metars/MetarModal.tsx rename to ui/src/components/Metars/MetarModal.tsx diff --git a/weather-ui/src/components/Metars/index.tsx b/ui/src/components/Metars/index.tsx similarity index 100% rename from weather-ui/src/components/Metars/index.tsx rename to ui/src/components/Metars/index.tsx diff --git a/weather-ui/src/components/Sidebar/Sidebar.css b/ui/src/components/Sidebar/Sidebar.css similarity index 100% rename from weather-ui/src/components/Sidebar/Sidebar.css rename to ui/src/components/Sidebar/Sidebar.css diff --git a/weather-ui/src/components/Sidebar/index.tsx b/ui/src/components/Sidebar/index.tsx similarity index 100% rename from weather-ui/src/components/Sidebar/index.tsx rename to ui/src/components/Sidebar/index.tsx diff --git a/weather-ui/src/components/Topbar/index.tsx b/ui/src/components/Topbar/index.tsx similarity index 100% rename from weather-ui/src/components/Topbar/index.tsx rename to ui/src/components/Topbar/index.tsx diff --git a/weather-ui/src/js/theme.ts b/ui/src/js/theme.ts similarity index 100% rename from weather-ui/src/js/theme.ts rename to ui/src/js/theme.ts diff --git a/weather-ui/styles/globals.css b/ui/styles/globals.css similarity index 100% rename from weather-ui/styles/globals.css rename to ui/styles/globals.css diff --git a/weather-ui/styles/leaflet.css b/ui/styles/leaflet.css similarity index 100% rename from weather-ui/styles/leaflet.css rename to ui/styles/leaflet.css diff --git a/weather-ui/tsconfig.json b/ui/tsconfig.json similarity index 100% rename from weather-ui/tsconfig.json rename to ui/tsconfig.json