As a user,
I want to get access to my data from a database through the application,
so that I can store my data on a save place .
Acceptence Criteria
The App successfully renders the data from database.
The application displays loading indicators or placeholders while waiting for API responses to improve user experience
The application handles API errors, providing meaningful error messages to inform users of any issues encountered during API interactions.
Tasks
[x] Create feature branch feature/backend-read
[x] Install package mongoose
[x] Create a .env.local file and fill it with MONGODB_URI
[x] Create a database for the activity-app with a collection activities
[x] Implement a connect.js file to connect to the database
[x] Write a schema to create a activities model that fits the database-structure. Id, title, category, categoryFilter, Area, country, description, image, lat, lng
[x] Create a route /pages/api/index.js with a handler-function that receives a GET request from the client and sends a response including the data from the database
[x] Integrate error handling in the backend using common HTTP status codes
Value Proposition
As a user, I want to get access to my data from a database through the application, so that I can store my data on a save place .
Acceptence Criteria
Tasks
mongoose
MONGODB_URI
activities
connect.js
file to connect to the databaseschema
to create a activities model that fits the database-structure.Id, title, category, categoryFilter, Area, country, description, image, lat, lng
/pages/api/index.js
with a handler-function that receives a GET request from the client and sends a response including the data from the database