DEV Community

Cover image for How to Create a Web App with Crow C++, MySQL, and TailwindCSS
Marcos Oliveira
Marcos Oliveira

Posted on

How to Create a Web App with Crow C++, MySQL, and TailwindCSS

Watch the series/playlist containing 9 videos that show step-by-step how to develop a web application for task management with Crow C++, MySQL, and Tailwind CSS.

πŸ“Ή Playlist

β–ΆοΈŽβ€’αŠαŠ||၊|။||||α‹αŠ|။‒

The videos are in Portuguese; use YouTube's automatic translation (Audio Track) to find your language.


πŸ’» Step-by-step to run on your machine ↓

Windows and Unix-Like (macOS, GNU/Linux, *BSD, Haiku,...)


πŸͺŸ Windows:

▢️ Install:

  1. How to Install Crow and C++ on Windows
  2. Install MySQL on Windows
  3. How to Connect to MySQL with C/C++ on Windows

©️ Clone the project:

Or download it directly and then unzip it.

git clone https://github.com/terroo/crow-todo
cd crow
Enter fullscreen mode Exit fullscreen mode

🎲 Dump the database:

mysql -u root -p < cpp.sql
Enter fullscreen mode Exit fullscreen mode

πŸ—„οΈ Change your MySQL credentials:

Open the file: todo.cpp and change lines 16 ([YOUR_USER]) and 17 ([YOUR_PASS]):

// ...
  connect = mysql_real_connect(
    connect,
    "localhost",
    "[YOUR_USER]",
    "[YOUR_PASS]",
    "cpp",0, NULL, 0
  );
// ...
Enter fullscreen mode Exit fullscreen mode

πŸ—οΈ Compile:

g++ main.cpp -I"C:/Includes/asio/include" -I"C:/Includes/crow/include" -lws2_32 -lmswsock -o app.exe
Enter fullscreen mode Exit fullscreen mode

Assuming the asio and crow libraries are in the path: C:\Includes, modify the path if you did not follow the installation tutorial mentioned above.

πŸƒ Run:

app.exe
Enter fullscreen mode Exit fullscreen mode

🌎 Access via browser:

http://localhost:18081/


🦬 Unix-Like:

macOS, GNU/Linux, *BSD, Haiku,...

▢️ Install:

  1. How to Install Crow and C++ on Apache
  2. Install MySQL
  3. Install the C/C++ Connector

©️ Clone the project:

git clone https://github.com/terroo/crow-todo
cd crow
Enter fullscreen mode Exit fullscreen mode

🎲 Dump the database:

mysql -u root -p < cpp.sql
Enter fullscreen mode Exit fullscreen mode

πŸ—„οΈ Change your MySQL credentials:

Open the file: todo.cpp and change lines 16 ([YOUR_USER]) and 17 ([YOUR_PASS]):

// ...
  connect = mysql_real_connect(
    connect,
    "localhost",
    "[YOUR_USER]",
    "[YOUR_PASS]",
    "cpp",0, NULL, 0
  );
// ...
Enter fullscreen mode Exit fullscreen mode

πŸ—οΈ Compile:

With CMake.

cmake -B build .
cmake --build build
Enter fullscreen mode Exit fullscreen mode

πŸƒ Run:

./build/app-crow-todo
Enter fullscreen mode Exit fullscreen mode

🌎 Access via browser:

http://localhost:18081/

Credentials to log into the application:

  • Login: marcos@cpp.io
  • Password: teste123@

If you want to create your own credentials to log in, insert them via MySQL, for example:

mysql -u root -p -D cpp # Then enter your password

INSERT INTO `login` VALUES (NULL,'YOUR NAME','LAST NAME','YOUR_USER@EMAIL.COM', SHA2('[YOUR_PASSWORD]', 256),'admin');
Enter fullscreen mode Exit fullscreen mode

Replace the uppercase data with your corresponding details.


πŸ“Ή Video Series showing how crow-todo/ToDo++ was made:

β–ΆοΈŽβ€’αŠαŠ||၊|။||||α‹αŠ|။‒

The videos are in Portuguese; use YouTube's automatic translation (Audio Track) to find your language.

Top comments (0)