You can find the back-end right here : https://github.com/sludovicdelys/going-the-distance-api
This is the front-end application for the "Go the Distance" project, built with Next.js.
Ensure you have the following software installed:
- Git
- Node.js (version 14 or higher)
- npm or yarn
-
Clone the repository:
git clone https://github.com/sludovicdelys/go_the_distance.git cd go_the_distance
-
Install dependencies:
npm install # or yarn install
-
Configure environment variables: Create a
.env.local
file in the root directory and add the following lines:NEXT_PUBLIC_API_URL=http://localhost:8000/api NEXT_PUBLIC_API_USERNAME=runner NEXT_PUBLIC_API_PASSWORD=secret
-
Start the development server:
npm run dev # or yarn dev
-
Access the application: Open your browser and navigate to
http://localhost:3000
.
- Environment Variables: Ensure all required environment variables are set in your
.env.local
file. - API Configuration: The front-end application communicates with the back-end API. Ensure the back-end API is running and accessible.
- 500 Internal Server Error: Check the browser console and network logs for detailed error messages.
- 404 Not Found: Ensure routes are correctly defined and that you are accessing the correct URLs.
- Authentication Issues: Verify the Basic HTTP Authentication setup in the
.env.local
file and ensure the credentials are correct.
By following these steps, you ensure that sensitive information like usernames and passwords are managed through environment variables, providing better security for your application.