The database schema for the Opportunity Management Module includes a single table named opportunities.
Here's the schema:
SQL code
CREATE TABLE opportunities ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, value REAL, stage TEXT DEFAULT 'Prospect', close_date DATE, customer_id INTEGER, user_id INTEGER, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
The backend provides the following RESTful API endpoints to handle CRUD operations on opportunities:
GET /opportunities: Retrieves a list of all opportunities.
POST /opportunities: Creates a new opportunity.
PUT /opportunities/:id: Updates an existing opportunity by ID.
DELETE /opportunities/:id: Deletes an opportunity by ID.
The frontend components include:
Opportunities: Displays a list of opportunities retrieved from the backend.
OpportunityForm: Provides a form for adding/editing opportunities. Submits data to the backend for processing.
React: Frontend framework for building user interfaces.
React Router: Used for client-side routing in the front-end application.
Express: Backend framework for building RESTful APIs.
SQLite: Lightweight relational database used for storing opportunity data.
Cors: Middleware for configuring Cross-Origin Resource Sharing in the backend.
Bootstrap : To improve the UI.
Clone the repository in your device.
Navigate to the backend directory.
Install dependencies: npm install.
Start the server: npm start.
Navigate to the front-end directory.
Install dependencies: npm install.
Start the development server: npm start.
Ensure that the backend server is running before starting the frontend server. Access the application at http://localhost:3000 in your web browser.