IMGIITRoorkee / IMGIITRoorkee/Ticketify

Replace Hardcoded API Endpoints with Environment Variables

Open
#31 7 comments 0 reactions 0 assignees View on GitHub
easy enhancement
Dominant language
JavaScript
Stars
0
Forks
6
PR merge metrics
No merged PRs in 30d

Description

### **Description**

All the utility functions in the project currently use **hardcoded API endpoints**. For example:

```javascript
const res = await fetch("http://localhost:3000/api/Tickets", {
cache: "no-store",
});
```

Hardcoding URLs can lead to deployment issues when switching between different environments, such as production, staging, or testing. To ensure flexibility and maintainability, these values should be moved to environment variables.

---

### **Acceptance Criteria**
- [ ] No hardcoded URLs remain in the project.
- [ ] API calls use the `process.env.NEXT_PUBLIC_API_URL` variable.
- [ ] The README includes updated documentation for environment variable setup.
- [ ] Existing functionality (e.g., data fetching) works as expected in local development environment.

Contributor guide

No contributing guide indexed for this repository

Research direction

Search the project for hardcoded API URLs and inspect the utility functions that make those requests. Read the README before updating its environment-variable setup guidance, then verify that API calls use process.env.NEXT_PUBLIC_API_URL and that local data fetching still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs
Domain
full-stack
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.