Prerequisites: Node.js 16+, Git, FiveM server, MySQL database.
Setup in 5 steps:
git clone https://github.com/CodeMeAPixel/pxBlipCreator.git
cd pxBlipCreator
cd web && npm install && npm run build
Add to server.cfg:
ensure oxmysql
ensure pxBlipCreator
Grant permission:
add_ace group.admin "command.blipcreator" allow
Run /blipcreator in-game to test.
pxBlipCreator/
├── client/
│ ├── main.lua # Client core
│ ├── utils.lua # NUI callbacks
│ └── framework/ # Framework stubs
├── server/
│ └── main.lua # Server core & database
├── web/ # Vite + React
│ ├── src/
│ │ ├── App.tsx # Root component
│ │ ├── components/ # Reusable components
│ │ ├── layouts/ # Page views
│ │ ├── hooks/ # Custom hooks
│ │ ├── store/ # Zustand state
│ │ ├── theme/ # Theme config
│ │ └── utils/ # Utilities
│ ├── vite.config.ts # Build config
│ └── build/ # Built files (generated)
├── .ideas/ # Planning docs
├── fxmanifest.lua # FiveM manifest
└── runme.sql # Database schema
Start dev server:
cd web
npm run dev
Build for production:
npm run build
Output goes to web/build/ (loaded in-game).
Client → Server:
TriggerServerEvent('pxBlipCreator:editBlip', id, data)
Server → Client:
TriggerClientEvent('pxBlipCreator:setBlips', source, blips)
Web → Client (NUI):
RegisterNUICallback('createBlip', function(data, cb)
cb(1) -- Acknowledge
end)
Frontend (in-game console F8):
console.log('Debug info');
Backend (server console):
refresh pxBlipCreator
stop pxBlipCreator
start pxBlipCreator
Database:
SELECT id, name FROM pxBlipCreator;
- Update IMPROVEMENT_PLAN.md
- Make code changes (frontend, backend, or both)
- Test thoroughly
- Update documentation
- Submit PR
- Backup database first
- Update
server/main.luaif adding columns - Update TypeScript types in
web/src/types.ts - Document changes in
.ideas/SCHEMA.md - Test thoroughly
Example:
ALTER TABLE pxBlipCreator ADD COLUMN created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
Frontend:
- React 18 with TypeScript
- Mantine UI components
- Zustand for state management
- Vite for builds
Backend:
- FiveM Lua runtime
- oxmysql for database
- NUI for client-server communication
Database:
- MySQL/MariaDB
-- Descriptive names
local function getBlipById(blipId)
return blips[blipId]
end
-- Comment complex logic
if not data.coords then
local ped = GetPlayerPed(source)
data.coords = GetEntityCoords(ped)
end
-- 4-space indentation
if condition then
doSomething()
end
interface BlipData {
id: number;
name: string;
}
const BlipTable: React.FC<Props> = ({ blips }) => {
const [visible, setVisible] = useState(false);
return <table>{/* ... */}</table>;
};
Before submitting PR:
- Tested in-game with admin permissions
- Create, edit, delete blips work
- Group visibility works
- Database entries created
- No console errors
- TypeScript compiles
- Web builds:
npm run build
Don't:
- Hardcode database table names
- Use synchronous DB calls
- Skip server-side validation
- Forget to rebuild web UI
- Ignore TypeScript errors
Do:
- Use constants for magic numbers
- Use async/await or promises
- Validate on server before DB write
- Always rebuild:
npm run build - Fix TypeScript issues before commit
Branches:
feature/namefor featuresbugfix/namefor bug fixesdocs/namefor documentationrefactor/namefor refactoring
Commits:
[FEATURE] Brief description
Optional detailed explanation.
Before committing:
- Code follows style guide
- TypeScript builds
- Web builds successfully
- Tested in-game
- Documentation updated
- No debug console.log() statements
Resources:
Questions:
- Check existing documentation
- Search GitHub Issues
- Ask in an issue or discussion
Include:
- Description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Environment (server, FiveM build)
- Logs or error messages
Example:
## Bug: Blips not visible for new players
### Steps
1. Create a blip
2. Have another player join
3. New player doesn't see it
### Expected
New players see all existing blips
### Actual
Only appear after new player runs /blipcreator
### Environment
- FiveM: [build]
- Server: Linux/Windows
Comment code to explain why, not just what. Update relevant docs:
README.mdfor user featuresDEVELOPMENT.mdfor dev changes.ideas/for architecture decisions