From b75fb18e425bc4e96f8553dedee1aca55f1661da Mon Sep 17 00:00:00 2001 From: Chneemann Date: Tue, 15 Apr 2025 16:32:22 +0200 Subject: [PATCH] feat: add environment.example.ts and update README with setup instructions --- .gitignore | 8 +++----- README.md | 17 +++++++++++++++-- angular.json | 6 ++++++ src/app/services/api.service.ts | 6 +++--- src/environments/environment.example.ts | 13 +++++++++++++ 5 files changed, 40 insertions(+), 10 deletions(-) create mode 100755 src/environments/environment.example.ts diff --git a/.gitignore b/.gitignore index 1855f1c..4402cd8 100644 --- a/.gitignore +++ b/.gitignore @@ -41,8 +41,6 @@ testem.log .DS_Store Thumbs.db -# Firebase -.firebase -*-debug.log -.runtimeconfig.json -/src/app/environments/config.ts +# Environments +src/environments/environment.ts +src/environments/environment.prod.ts diff --git a/README.md b/README.md index 76deb9d..8d8ed01 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ A task manager modeled after the Kanban system. Create and organize tasks using ## Technologies Used -- HTML / SCSS - Angular / TypeScript - Django REST / PostgreSQL / Redis @@ -18,7 +17,7 @@ A task manager modeled after the Kanban system. Create and organize tasks using ## Description -Join Task Manager is a robust platform built on the Kanban system, designed for efficient task management. With a user-friendly interface, you can easily create and organize tasks using drag-and-drop functionality. Built with HTML / SCSS, Angular / TypeScript, and Django REST, Join offers a powerful and reliable environment for managing your tasks. +Join Task Manager is a robust platform built on the Kanban system, designed to help you manage tasks efficiently. With an intuitive, user-friendly interface, you can easily create, organize, and prioritize tasks using drag-and-drop functionality. Built with Angular, TypeScript, and Django REST, Join offers a powerful and reliable environment for managing your tasks. Key features include: @@ -29,3 +28,17 @@ Key features include: - Simple and intuitive task organization using drag-and-drop Join helps you manage tasks quickly and efficiently, keeping you focused on what truly matters. + +## Environment Setup + +Before starting the app, copy the example environment file: + +```bash +cp src/environments/environment.example.ts src/environments/environment.ts +``` + +If you’re planning to build for production, you can also copy it as: + +```bash +cp src/environments/environment.example.ts src/environments/environment.prod.ts +``` diff --git a/angular.json b/angular.json index 9c05626..dd23748 100644 --- a/angular.json +++ b/angular.json @@ -29,6 +29,12 @@ }, "configurations": { "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], "budgets": [ { "type": "initial", diff --git a/src/app/services/api.service.ts b/src/app/services/api.service.ts index 487dec1..114f778 100644 --- a/src/app/services/api.service.ts +++ b/src/app/services/api.service.ts @@ -1,7 +1,7 @@ -import { Injectable, signal } from '@angular/core'; +import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Observable } from 'rxjs'; -import { apiConfig } from '../environments/config'; +import { environment } from '../../environments/environment'; import { Task } from '../interfaces/task.interface'; import { User } from '../interfaces/user.interface'; import { TokenService } from './token.service'; @@ -10,7 +10,7 @@ import { TokenService } from './token.service'; providedIn: 'root', }) export class ApiService { - private readonly apiUrl = apiConfig.apiUrl; + private readonly apiUrl = environment.apiUrl; constructor(private http: HttpClient, private tokenService: TokenService) {} diff --git a/src/environments/environment.example.ts b/src/environments/environment.example.ts new file mode 100755 index 0000000..6fab359 --- /dev/null +++ b/src/environments/environment.example.ts @@ -0,0 +1,13 @@ +export const environment = { + /** + * Is this a production build? + * Use `true` for production deployments. + */ + production: false, + + /** + * Base URL of your backend API. + * For example: 'http://localhost:8000' or 'https://api.example.com' + */ + apiUrl: 'https://your-api-url.here', +};