API REST para gerenciamento de tarefas construída do zero em C puro, sem frameworks.
Este projeto implementa uma API REST completa em C, incluindo:
- ✅ Servidor HTTP construído manualmente com Winsock (sockets TCP/IP)
- ✅ Parser HTTP para processar requisições
- ✅ Sistema de roteamento para múltiplos endpoints
- ✅ Persistência de dados com SQLite
- ✅ Suporte completo a CRUD (Create, Read, Update, Delete)
Objetivo: Solidificar conhecimentos de programação de baixo nível, networking e arquitetura de APIs.
- Linguagem: C (C11)
- Networking: Winsock2 (Windows Sockets API)
- Banco de Dados: SQLite3
- Protocolo: HTTP/1.1
- Formato de Dados: JSON
- Sistema Operacional: Windows 10/11 (64-bit)
- Compilador: GCC (através do MinGW-w64 ou MSYS2)
- Bibliotecas: Winsock2 (inclusa no Windows), SQLite3 (incluída no projeto)
- Baixe o instalador: https://www.msys2.org/
- Instale e execute o MSYS2 UCRT64
- Atualize os pacotes:
pacman -Syu- Instale o GCC:
pacman -S mingw-w64-ucrt-x86_64-gcc- Adicione ao PATH:
C:\msys64\ucrt64\bin
- Baixe em: https://www.mingw-w64.org/
- Instale e adicione ao PATH do sistema
O projeto já inclui todas as dependências necessárias:
project/
└── sqlite/
├── sqlite3.h
└── sqlite3.c
SQLite está embutido no projeto. Não é necessário instalar separadamente.
- Winsock2 (
ws2_32.dll) – incluída no Windows - Linkada na compilação com
-lws2_32
gcc --versionc-task-manager-api/
├── project/
│ ├── main.c
│ ├── server.h / server.c
│ ├── http.h / http.c
│ ├── json_parser.h / json_parser.c
│ ├── cli.h / cli.c
│ ├── tests.h / tests.c
│ ├── database.h / database.c
│ ├── sqlite/
│ │ ├── sqlite3.h
│ │ └── sqlite3.c
│ └── tasks.db
├── screenshots/
├── README.md
└── .gitignore
Responsável pela inicialização da aplicação, menu interativo e seleção de modo de execução.
Gerencia sockets TCP/IP, aceita conexões e delega requisições ao módulo HTTP.
Parseia requisições, roteia endpoints e monta respostas HTTP/JSON.
Extrai dados simples de tarefas a partir de JSON bruto.
Abstrai operações CRUD usando SQLite embutido.
Menu interativo para gerenciamento de tarefas via terminal.
Valida banco de dados, parser JSON e operações principais.
- Windows 10/11
- GCC (MinGW ou MSYS2)
- Git (opcional)
- Clone o repositório:
git clone https://github.com/Daniel16Bit/c-task-manager-api.git
cd c-task-manager-api/project- Compile o projeto:
gcc main.c database.c sqlite/sqlite3.c -o server.exe -lws2_32- Execute o servidor:
./server.exe- Acesse no navegador:
http://localhost:8080
| Método | Endpoint | Descrição |
|---|---|---|
| GET | / | Página inicial |
| GET | /tasks | Lista tarefas |
| GET | /tasks/:id | Busca por ID |
| POST | /tasks | Cria tarefa |
| PUT | /tasks/:id | Atualiza |
| DELETE | /tasks/:id | Remove |
- Programação de sockets TCP/IP
- HTTP em baixo nível
- Gerenciamento manual de memória
- Integração C + SQLite
- Arquitetura REST
- Entender networking em baixo nível
- Dominar gerenciamento manual de memória
- Aprender como servidores funcionam "por baixo dos panos"
- Banco de dados leve e embutido
- Não requer servidor separado
- Ideal para projetos acadêmicos/portfólio
- Frameworks abstraem demais o funcionamento real
- Aprendizado profundo do protocolo HTTP
- Diferencial em entrevistas técnicas
- Este projeto é de código aberto para fins educacionais.
Marcos Daniel
- GitHub: @Daniel16Bit
- LinkedIn: Marcos Daniel
- Email: mdaniel.main@gmail.com
Projeto desenvolvido como parte dos meus estudos em Engenharia de Software, com foco em programação de sistemas e networking.
REST API for task management built from scratch in pure C, without frameworks.
This project implements a complete REST API in C, including:
- ✅ HTTP server manually built with Winsock (TCP/IP sockets)
- ✅ HTTP parser to process requests
- ✅ Routing system for multiple endpoints
- ✅ Data persistence using SQLite
- ✅ Full CRUD support (Create, Read, Update, Delete)
Goal: Strengthen knowledge of low-level programming, networking, and API architecture.
- Language: C (C11)
- Networking: Winsock2 (Windows Sockets API)
- Database: SQLite3
- Protocol: HTTP/1.1
- Data Format: JSON
- Operating System: Windows 10/11 (64-bit)
- Compiler: GCC (via MinGW-w64 or MSYS2)
- Libraries: Winsock2 (included with Windows), SQLite3 (included in the project)
- Download the installer: https://www.msys2.org/
- Install and run MSYS2 UCRT64
- Update packages:
pacman -Syu- Install GCC:
pacman -S mingw-w64-ucrt-x86_64-gcc- Add to PATH:
C:\msys64\ucrt64\bin
- Download from: https://www.mingw-w64.org/
- Install and add it to the system PATH
The project already includes all required dependencies:
project/
└── sqlite/
├── sqlite3.h
└── sqlite3.c
SQLite is embedded in the project. No separate installation is required.
- Winsock2 (
ws2_32.dll) – included with Windows - Linked during compilation using
-lws2_32
gcc --versionc-task-manager-api/
├── project/
│ ├── main.c
│ ├── server.h / server.c
│ ├── http.h / http.c
│ ├── json_parser.h / json_parser.c
│ ├── cli.h / cli.c
│ ├── tests.h / tests.c
│ ├── database.h / database.c
│ ├── sqlite/
│ │ ├── sqlite3.h
│ │ └── sqlite3.c
│ └── tasks.db
├── screenshots/
├── README.md
└── .gitignore
Responsible for application initialization, interactive menu, and execution mode selection.
Manages TCP/IP sockets, accepts connections, and forwards requests to the HTTP module.
Parses requests, routes endpoints, and builds HTTP/JSON responses.
Extracts simple task data from raw JSON.
Abstracts CRUD operations using embedded SQLite.
Interactive command-line menu for task management.
Validates database operations, JSON parsing, and core functionalities.
- Windows 10/11
- GCC (MinGW or MSYS2)
- Git (optional)
- Clone the repository:
git clone https://github.com/Daniel16Bit/c-task-manager-api.git
cd c-task-manager-api/project- Compile the project:
gcc main.c database.c sqlite/sqlite3.c -o server.exe -lws2_32- Run the server:
./server.exe- Access in the browser:
http://localhost:8080
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Home page |
| GET | /tasks | List all tasks |
| GET | /tasks/:id | Get task by ID |
| POST | /tasks | Create a task |
| PUT | /tasks/:id | Update a task |
| DELETE | /tasks/:id | Delete a task |
- TCP/IP socket programming
- Low-level HTTP handling
- Manual memory management
- C + SQLite integration
- REST architecture
- To understand low-level networking
- To master manual memory management
- To learn how servers work under the hood
- Lightweight and embedded database
- No separate server required
- Ideal for academic and portfolio projects
- Frameworks hide how things actually work
- Deep understanding of the HTTP protocol
- Strong differentiator in technical interviews
- This project is open source for educational purposes.
Marcos Daniel
- GitHub: @Daniel16Bit
- LinkedIn: Marcos Daniel
- Email: mdaniel.main@gmail.com
Project developed as part of my Software Engineering studies, with a focus on systems programming and networking.