This project is a web application built with a Next.js frontend and a FastAPI backend. The frontend allows users to create, read, update, and delete issues. The backend serves as an API server that handles these operations.
- Technologies Used
- Getting Started
- Frontend Setup (Next.js)
- Backend Setup (FastAPI)
- Running the Project
- API Endpoints
- License
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
-
Clone the repository:
git clone https://github.com/your-username/your-repo.git cd your-repo
-
Navigate to the
frontend
directory:cd frontend
-
Install dependencies:
npm install
-
Create a
.env.local
file in thefrontend
directory and add your environment variables if necessary:NEXT_PUBLIC_API_URL=http://localhost:8000
-
Run the development server:
npm run dev
The frontend should now be running on http://localhost:3000.
-
Navigate to the
backend
directory:cd be
-
Create and activate a virtual environment:
poetry run uvicorn main:app --reload The backend should now be running on [http://localhost:8000](http://localhost:8000).
To run the entire project, ensure both the frontend and backend servers are running:
-
Start the Next.js frontend:
cd frontend npm run dev
Now you can access the application at http://localhost:3000, and it will communicate with the FastAPI backend at http://localhost:8000.
The FastAPI server exposes the following endpoints:
POST /issues/
: Create a new issue.GET /issues/
: Retrieve all issues.GET /issues/{issue_id}
: Retrieve a specific issue by ID.PUT /issues/{issue_id}
: Update a specific issue by ID.DELETE /issues/{issue_id}
: Delete a specific issue by ID.
- Create Issue:
curl -X POST http://localhost:8000/issues/ \ -H "Content-Type: application/json" \ -d '{"title": "New Issue", "description": "Description of the new issue"}'
- Read All Issues:
curl -X GET http://localhost:8000/issues/
3. Read Specific Issue:
curl -X GET http://localhost:8000/issues/1
4. Update Issue:
curl -X PUT http://localhost:8000/issues/1 \
-H "Content-Type: application/json"
-d '{"title": "Updated Issue Title", "description": "Updated description of the issue"}'
5. Delete Issue:
curl -X DELETE http://localhost:8000/issues/1
This project is licensed under the MIT License - see the LICENSE file for details.