This project is a Backend-as-a-Service solution designed for user management within a graph-oriented database. It serves as a practical example of interconnecting a web frontend, a high-performance C++ server, and a NoSQL database.
The system is modular and leverages cutting-edge technologies to ensure fast and secure communication:
- Frontend (Web Interface): Located in
Site_page, it collects data through intuitive forms. - Backend (C++ Server): Developed using the Crow framework. It processes HTTP requests, validates data, and constructs Cypher queries.
- Database (Neo4j): Stores information as nodes and relationships, running within an isolated Docker environment.
To run this project locally, follow the steps below. The project is configured to be portable, allowing the use of any Neo4j instance.
The application requires a Neo4j container. You can start your own instance using Docker:
docker run -d \
--name neo4j-project \
-p 7474:7474 -p 7687:7687 \
--env NEO4J_AUTH=neo4j/your_password_here \
neo4j:4.4
2. Security Configuration (config.h)
For security reasons, authentication credentials are not included in the repository (they are ignored via .gitignore). You must manually create the configuration file:
Navigate to the include/ folder.
Create a file named config.h.
Add the following code, replacing the placeholder with your own Base64 token:
C++
#ifndef CONFIG_H
#define CONFIG_H
#include <string>
// Base64 Token formatted as "username:password"
const std::string NEO4J_AUTH_TOKEN = "INSERT_YOUR_TOKEN_HERE";
const std::string NEO4J_URL = "http://localhost:7474/db/data/transaction/commit";
#endif
3. Running the Frontend
The frontend is most efficiently served through an Nginx container, mapping the local Site_page folder:
Bash
docker run -d \
--name frontend-site \
-p 80:80 \
-v $(pwd)/Site_page:/usr/share/nginx/html \
nginx:latest
4. Compiling and Starting the Server (Backend)
The backend is compiled locally to utilize host system resources (WSL/Linux recommended):
Bash
# Compile with libcurl support
g++ main.cpp -o server -lcurl
# Start the server
./server
๐ Security & Organization
Zero Secrets: No passwords or sensitive tokens are stored in the public source code.
Dockerized: Web components and the database are isolated, preventing system-wide conflicts.
Clean Code: Uses separate header files (include/) for easy maintenance and scalability.
๐ ๏ธ Tech Stack
Backend: C++17, Crow Framework, libcurl
Frontend: HTML5, CSS3, JavaScript
DevOps: Docker, Nginx
Database: Neo4j (Cypher Query Language)