DBackend is a robust Go-based API service that powers the investment platform, facilitating connections between investors and startups. The system provides comprehensive deal flow management, matchmaking services, and secure authentication.
- Language: Go 1.22+
- Framework: Fiber (HTTP server)
- Database: MongoDB
- Authentication: JWT-based auth
- ML Services: Python FastAPI for matchmaking algorithms
- Containerization: Docker & Docker Compose
- CI/CD: GitHub Actions
- User Management: Complete user lifecycle with role-based access control
- Authentication: Secure JWT-based authentication system
- Deal Flow Management: Track and manage investment opportunities
- Matchmaking: AI-powered matching between investors and startups
- Meeting Coordination: Schedule and manage meetings
- Task Management: Track and assign tasks
- Grant Management: Handle grant applications and approvals
- Go 1.22 or higher
- Docker and Docker Compose
- MongoDB (or use the provided Docker setup)
- Python 3.8+ (for MatchMaking service)
-
Clone the repository:
git clone https://github.com/your-organization/dbackend.git cd dbackend -
Set up environment variables by creating a
.envfile:APP_ENV=development PORT=8080 BLUEPRINT_DB_HOST=localhost BLUEPRINT_DB_PORT=27017 BLUEPRINT_DB_USERNAME=dbadmin BLUEPRINT_DB_ROOT_PASSWORD=securepassword BLUEPRINT_DB_DATABASE=ddb -
Start the MongoDB container:
make docker-run
-
Build and run the application:
make build make run
-
For development with live reload:
make watch
DBackend/
├── cmd/ # Application entry points
│ └── api/ # Main API server
├── internal/ # Private application code
│ ├── database/ # Database interfaces and implementations
│ ├── models/ # Data models
│ ├── server/ # HTTP server setup
│ │ ├── middleware/ # HTTP middleware
│ │ └── routes/ # API route definitions
│ └── utils/ # Utility functions
├── MatchMakingService/ # Python-based ML service for matching
├── scripts/ # Utility scripts
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose configuration
├── go.mod # Go module definition
└── Makefile # Build and development commands
The API follows RESTful conventions and is versioned. All endpoints are prefixed with /api/v1/.
POST /api/v1/auth/register- Register a new userPOST /api/v1/auth/login- Authenticate and receive JWTGET /api/v1/auth/refresh- Refresh JWT token
GET /api/v1/users- List all usersGET /api/v1/users/:id- Get user by IDPUT /api/v1/users/:id- Update userDELETE /api/v1/users/:id- Delete user
POST /api/v1/dealflow- Add startup to dealflowGET /api/v1/dealflow- List all dealflow entriesGET /api/v1/dealflow/:id- Get dealflow by IDPUT /api/v1/dealflow/:id- Update dealflow entryDELETE /api/v1/dealflow/:id- Remove from dealflow
For a complete list of endpoints with example requests, see curl_examples.md.
make all # Build and run tests
make build # Build the application
make run # Run the application
make docker-run # Create and start DB container
make docker-down # Shutdown DB container
make test # Run unit tests
make itest # Run integration tests
make watch # Live reload during development
make clean # Clean up binary from last buildThe project includes both unit tests and integration tests:
# Run all tests
make test
# Run integration tests (requires DB)
make itest- Create appropriate models in
internal/models - Implement database operations in
internal/database - Add routes in
internal/server/routes - Update the route registration in
internal/server/routes.go - Write tests for your implementation
-
Build the Docker image:
docker build -t dbackend:latest . -
Deploy using Docker Compose:
docker-compose up -d
The application is designed to run behind Nginx. A sample configuration is provided in nginx-config.conf.
The MatchMaking service is a Python-based ML service that provides intelligent matching between investors and startups.
-
Navigate to the MatchMaking directory:
cd MatchMakingService -
Create a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install fastapi uvicorn tensorflow pandas scikit-learn joblib
-
Start the service:
uvicorn app:app --host 0.0.0.0 --port 4040
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/my-feature - Submit a pull request
- Database Connection Issues: Ensure MongoDB is running and credentials are correct
- Build Errors: Make sure you're using Go 1.22 or higher
- API Errors: Check the logs for detailed error messages
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or support, please contact the development team at [email protected].